Hi Immi,
> Only restriction: It's sorting on database fields, so it's only working on
> database field columns.
What other columns would you like to sort by?
Sometimes, you might want to sort by a field that is external to the "findBy" request. Say your
SQL statement retrieves WorkEffort.currentStatusId and you want to sort by an external value say
in StatusType.description. You'll have to do a combined query (SQL joins), and then simply feed in
"ORDER BY StatusType.description".
Or do you mean sorting outside of the database query?
I'm interested in this too. I've been beefing up the widget module, like you did. Looking for a
"header column sort UI" that doesn't use GET, but POST instead (to workaround possible problems
with characters incompatible with URL strings).
Jonathon
Immi wrote:
I'm missing a functionality to sort a list by clicking on a column header.
I saw a few implementations using header-link=<url>?orderBy=<fieldname> but
there's no generic
construct.
In our project I'm using such a generic construct. Internally of the
ModelFormField class, I'm building
a hyper-link out of the name.
Now the only thing I have to do is setting the new attribute sort="true" and
I got a header sorting mechanism.
Only restriction: It's sorting on database fields, so it's only working on
database field columns.
I'm just wondering if there's a implementation planned for this subject
or if I should submit my changes to the JIRA. What do you think??
Regards,
Michael
Sample: Table with two rows Login/ Enabled. Sorting available on Login.
---------------------------------------------------------------------------------------
<form name="ListLogin" type="list" list-name="listIt">
<actions>
<set field="entityName" value="UserLogin"/>
<service service-name="performFind" result-map-name="result"
result-map-list-name="listIt">
<field-map field-name="inputFields"
env-name="requestParameters"/>
<field-map field-name="entityName" env-name="entityName"/>
</service>
</actions>
<field name="userLoginId" title="Login" sort="true">
<display/>
</field>
<field name="enabled" title="Enabled">
<display/>
</field>
</form>
http://www.nabble.com/file/7851/list.jpg