$table->setWidth("100%"); $table->setHeight("100%"); $table->setClass("table.white"); $table_form = new Table(); $table_form->setRowsStyle("76dip;76dip;76dip;76dip"); $table_form->setClass("table.forms"); $input_value = new InputNumeric(15); $input_value->setClass("input.form"); $input_date = new InputDate(); $input_date->setClass("input.form"); $input_desc = new InputText(); $input_desc->setLabelCaption("Description"); $input_desc->setClass("input.form"); $dc_cat = new DynamicComboBox(); $dc_cat->setValues(load_cat()); $dc_cat->setAddEmptyItem(false); $dc_cat->setClass("input.form"); $button = new Button(); $button->setCaption("Confirm"); $button->onTap(confirm()); $button->setClass("button.blue"); $table_form->addControl($input_value, 1, 1, 1, 1, "Center", "Middle"); $table_form->addControl($input_date, 2, 1, 1, 1, "Center", "Middle"); $table_form->addControl($input_desc, 3, 1, 1, 1, "Center", "Middle"); $table_form->addControl($dc_cat, 4, 1, 1, 1, "Center", "Middle"); $table_button = new Table(); $table_button->addControl($button, 1, 1, 1, 1, "Center", "Middle"); $table->addControl($table_form, 1, 1); $table->addControl($table_button, 2, 1); $win->addControl($table); function load_cat()
/** * Main object. * @author Kikapp * @version 1.0 */ $win = new SDPanel(); $win->setCaption("Dynamic Combo Box!"); $actionBar = new ActionBar(); $actionBar->setClass("applicationBars"); $mainTable = new Table(); $button = new Button(); $button->setCaption("Click me!"); $button->onTap(clickme()); $dc = new DynamicComboBox(); $dc->setValues(load_data()); $dc->setAddEmptyItem(false); $mainTable->addControl($button, 1, 1); $mainTable->addControl($dc, 2, 1); $win->addControl($mainTable); function clickme() { echo "Hello !"; } function load_data() { $url = "http://www.devxtend.com/Gecko/samples/3_2/rest/main_load_data"; $hc = new httpClient(); $rs = $hc->Execute("GET", $url); $struct = array(array("id" => DataType::Character(6), "name" => DataType::Character(100))); Data::FromJson($struct, $rs); }