Get result of picklist in a grid

Posted by Abir ben salem on 18-May-2016 04:37

hi ,

class level is an object , and the record are displayed in the picklist. 

student is an object . 

I want to display student by choosing a value from the picklist . 

help !

All Replies

Posted by Shiva Duriseati on 18-May-2016 06:37

Hi Abir,

Please declare a function "loadStudents" in onchange() event handler of "class" picklist. And define the function as below in script component of new page by adding script component.

<script>

 function loadStudents(){

  var className=rbf_getFieldValue("R48928");

  rbf_selectQuery("SELECT name FROM Student WHERE R48813="+className, 100,function    callback(arr){

  for(var i=0;i<arr.length;i++){

   rbf_addGridRow("0");

   rbf_setGridValue2("0", 'name', i, arr[i][0]);

 }

 }

 );

}

</script>

Attaching app.xml for your reference. I have created three objects 1)Class 2)Students 3)Attendance. Please find the script in new page of "attendance" object.

[View:/cfs-file/__key/communityserver-discussions-components-files/25/sample_5F00_grid.xml:320:240]

Regards,

Shiva

This thread is closed