function dynarea_1_onGetData($app) { // Create a row, a column and a dropdown inside the dynamic area $this->addRow('row_compuestos'); $this->addCol('col_compuestos','row_compuestos'); $field=$this->addField('col_compuestos',new spdbdropdown('drop_compuestos',$this->form)); $field->label='Compuesto que adicionará'; // Populate drop down with values from a database table $r = $$dbsq_compuestos->simpleOpen(true); while (! $$dbsq_compuestos->eof) { $field->AddItem($r['pkCompuesto'],$r['nombreCompuesto']); $r = $$dbsq_compuestos->simpleRead(); } $$dbsq_compuestos->Close(); }
As this is a dynamic field, it is not added to the internal component list, that retrieves and caches the result automatically. Although in the upcoming version we have added functionality to retrieve values similar to your explanation, the easiest way to retrieve the values is using the rtrGetVar function. Suppose you have a field 'myfield' created, then you can access the value by rtrGetVar('myfield', ''); The second value is used as a default if the 'myfield' is not found. Don't use the $_POST fields directly as these values are not protected against XSS etc. rtrGetVar does.