Modify Seam-gen default column sorting to AJAX
gerryjun Nov 25, 2010 2:43 AMHi,
Notes:
Seam-gen generated
Seam 2.2
I need some help pls, im trying to modify the sorting columns generated by seam-gen sortable via AJAX as per client requirement.
My problem is, it would seem that the query is being generated before the sort and dir param could be set on the entityList component.
Looking at the system.out on the getResultList() to print the orderColumn it still shows null, then after the query is generated, is the time that it gets the params for the filter.
The list is being reRender with out a problme, i have verified that the params are bieng passed, it would seem its just late.
How can i correct this?
--------------- sort.xhtml --------------
<ui:composition xmlns="http://www.w3.org/1999/xhtml"> <a4j:commandLink styleClass="columnHeader" value="#{propertyLabel} #{entityList.orderColumn == propertyPath ? (entityList.orderDirection == 'desc' ? messages.down : messages.up) : ''}" reRender="mainbody" ajaxSingle="true" > <a4j:actionparam name="sort" value="#{propertyPath}" assignTo="#{entityList.orderColumn}" /> <a4j:actionparam name="dir" value="#{entityList.orderColumn == propertyPath and entityList.orderDirection == 'asc' ? 'desc' : 'asc'}" assignTo="#{entityList.orderDirection}"/> <s:conversationPropagation type="join" /> </a4j:commandLink> </ui:composition>
------------------ System out from entityList.getResultList() ------------------------------
15:26:11,898 INFO [STDOUT] (orderColumn from entityList getResultList()) null 15:26:11,899 INFO [STDOUT] Hibernate: select masteruser0_.UserType as UserType132_, masteruser0_.AccountingAccess as Accounti2_132_, masteruser0_.CaseAdminAccess as CaseAdmi3_132_, masteruser0_.CaseProcessAccess as CaseProc4_132_, masteruser0_.ClientAdminAccess as ClientAd5_132_, masteruser0_.EDDTechAccess as EDDTechA6_132_, masteruser0_.RecordActiveFlag as RecordAc7_132_, masteruser0_.SysAdminAccess as SysAdmin8_132_, masteruser0_.SystemRequiredFlag as SystemRe9_132_, masteruser0_.UserTypeDescription as UserTyp10_132_, masteruser0_.UserTypeShortName as UserTyp11_132_ from edd_master.MasterUserType masteruser0_ limit ? 15:26:11,925 INFO [STDOUT] (orderColumn from entityList getResultList()) masterUserType.userType 15:26:11,926 INFO [STDOUT] (orderColumn from entityList getResultList()) masterUserType.userType 15:26:11,926 INFO [STDOUT] (orderColumn from entityList getResultList()) masterUserType.userType 15:26:11,927 INFO [STDOUT] (orderColumn from entityList getResultList()) masterUserType.userType 15:26:11,928 INFO [STDOUT] (orderColumn from entityList getResultList()) masterUserType.userType 15:26:11,928 INFO [STDOUT] (orderColumn from entityList getResultList()) masterUserType.userType 15:26:11,928 INFO [STDOUT] (orderColumn from entityList getResultList()) masterUserType.userType 15:26:11,946 INFO [STDOUT] (orderColumn from entityList getResultList()) masterUserType.userType 15:26:11,946 INFO [STDOUT] (orderColumn from entityList getResultList()) masterUserType.userType