With Servoy 1.2final (java 1.4 on Linux) this doesn’t happen for me. As in the “real” fields in the portal are sortable just fine (i.e. by clicking on the column heading) but with the calculated fields[1] nothing happens at all. Bug or limitation?
Thanks,
Neale.
[1] FWIW, this particular portal only uses calculated fields because we need indirectly related values and this is the only way we can see of getting them
unstored calcs aren’t sortable because they aren’t stored in a database column. You can make them stored by creating a column with identical name. Servoy will then automatically store the calc inside the database column.
FWIW, this particular portal only uses calculated fields because we need indirectly related values and this is the only way we can see of getting them
Use tabless panels here.
create a form on table B
make a relation from table B to table C
display fields in form B from table C
create a tabpanel in form A showing form B through relation A to B
If you want the same behaviour like in portals (auto sort headers etc) , set form B to tableview
maarten:
unstored calcs aren’t sortable because they aren’t stored in a database column.
But they are in the returned result (IIRC, the “cursor”?). Why can’t we sort that?
maarten:
You can make them stored by creating a column with identical name. Servoy will then automatically store the calc inside the database column.
I’d prefer to keep the data normalised.
maarten:
FWIW, this particular portal only uses calculated fields because we need indirectly related values and this is the only way we can see of getting them
Use tabless panels here.
create a form on table B
make a relation from table B to table C
display fields in form B from table C
create a tabpanel in form A showing form B through relation A to B
If you want the same behaviour like in portals (auto sort headers etc) , set form B to tableview
Yes, that appears like it would work a treat - but for one key detail: the data I need to display (and desire to be sortable) lives in table D, which is parent of table C and doesn’t appear to be accessible from the form based on table B. In table C this data is present as a calculated field - this is not sortable in a tableview based on table B
If only the multi-level indirection that works in the javascript bits (e.g. tableB_to_tableC.tableC_to_tableD.columnName) could be used on forms…
In attached solution you can find a totally different approach.
It’s a sample of how to create a “html portal” that relies on a fully custom build query using the database manager.
Please have close look. It does solve your sorting problem over multiple tables.
upside: total data control over your “portal”
downside: data not editable, more programming needed.
Let me know if you have any questions about the sample solution.
The solution was exported with a newer version of Servoy than you are currently running. Upgrade to at least Servoy R2 2.0 rc7-build 266 to import this solution.
Is upgrading the only option open to me?
I had a look in solution.xml and get the idea - 'tis a pity that portals and tableviews don’t sort the answer like this.