I’m wondering, if it would be possible to populate a combobox on the server-side.
What I’m trying is to populate a combo-box on a form.
My server-side code code looks like this:
function viewForm($connection, $where, $customerid) {
$invoices = new ComboConnector($connection, "MySQL");
$invoices->render_sql("select inv_title from invoices where customerid = ".$customerid, "id", "inv_title");
$formConn = new FormConnector($connection, "MySQL");
$sql = "SELECT id, orderdate, customer, orderno, invoice from orders "; // invoice is the FK to the table invoicess - I want to be able to select that via a combo-box
$formConn->set_options("invoice", $invoicess);
$formConn->render_sql($sql . $where, "id", "id,oderdate,customer,orderno");
}
On the client side, I’m initializing a form that needs to be populated. Somehow it doesn’t render my form-data, instead the combo-options are rendered, even though I use the set_options-command.
I’ve tried an options-connector, which also doesn’t work somehow (only my foreign key an NO options are displayed).
Is there any way to populate select-items or combobox-items on load-time on the server side? I can’t use an connector:“url” in my init, because i don’t want the overhead of 10.000+ invoices in this single combo. The combo-content is dependant on the customer’s id… it would be nice if there was any way to populate a combo the way it works on grids and stuff, too.
Could anyone provide a working example?