I use a query to fetch certain data into a dataset. I need to display the dataset columns in a table view. Is there anyway of doing this?
I also need to show additional fields based on the form table alongside the dataset fields. Is this also possible?
To display the data you can use a InMemDataGrid bean for this. Another way would be to use HTML inside a HTML_AREA field.
And for extra data you can add extra columns to the dataset and fill them. See the JSDataSet node under the Database Manager node.
I use a query to fetch certain data into a dataset. I need to display the dataset columns in a table view. Is there anyway of doing this?
I also need to show additional fields based on the form table alongside the dataset fields. Is this also possible?
Thank you
Regards,
Aruna
In Servoy 4.1 you can also base forms on datasets which would address your question.
Can you elaborate on how this is done? When looking at the property panel for a form under v4.1.0 I don’t see a way of setting a dataset as a property of the form.
Is there going to be a more 4GL-like way of doing this in the future for cases where you want to be build a form based on a complex query spanning multiple tables etc. but still be able to use the GUI form builder? Ideally, I’d like to have the ability to tie a form to an arbitrary (select) query instead of a table in certain cases and have Servoy introspect the query and let me drag and drop the fields on the form.
Note that I still appreciate the flexibility that Solution Model gives but it’s cumbersome going back to the Swing-like model of UI programming for cases where that’s over-kill.
Servoy will need a table (or a view) to build a form on to be able to perform updates or inserts.
Suppose for example when a form would be build on sql ‘select tab1.f1, tab2.f2 from tab1, tab2 where …’ how would a new record be inserted? or an update?
You can build a form on an updatable view though, the insert/update will be handled by the database in that case.
You can base a form on an arbitrary query though using controler.loadRecords(sql) but this query is only used to find the PKs, the other columns are retrieved from the base table.
In 4.1.1 you can build your form in the designer. Just create it the way you want (use a dummy table or something)
then the only thing you need to do when you want to use that form with a dataset is alter the forms datasource and the fields data providers to match the datasource.
problem is that you cant do that in 4.1 yet because of a missing new datasource property on a solution model form object.