-
1. Richfaces 4 + datatable + onrowclick
nbelaevski Mar 23, 2011 12:33 PM (in response to aagenielsen)Hi Aage,
Use a4j:ajax for 'rowclick' event.
-
2. Richfaces 4 + datatable + onrowclick
aagenielsen Mar 24, 2011 10:27 AM (in response to nbelaevski)Point taken ;-)
But it is the action part that we miss.
/aage
-
3. Richfaces 4 + datatable + onrowclick
nbelaevski Mar 24, 2011 10:29 AM (in response to aagenielsen)Action is not available, use 'listener' attribute.
-
4. Re: Richfaces 4 + datatable + onrowclick
aagenielsen Mar 24, 2011 10:41 AM (in response to nbelaevski)But is actionlisteners not used for logic + non navigtion handling and actions for logic + navigation handling ?
And how to use the navigation handler in an actionslistener - more specific how to get the context for the handleNavigation method - is it the FacesContext.getCurrentInstance() ?
/aage
-
5. Re: Richfaces 4 + datatable + onrowclick
ilya_shaikovsky Mar 25, 2011 5:41 AM (in response to aagenielsen)then use jsFunction instead. It's provides action/actionListener attributes and being and action component. a4j:ajax is just a behavior and designed according to standard JSF principles(parent component events like action/actionListener fired by parent button/link component, valueChange by inputs and so on). And the behavior itself provides only the listener for behavior event.
P.S. in case of using the jsFunction - you should pass parameter to identify the row additionally.
-
6. Re: Richfaces 4 + datatable + onrowclick
aagenielsen Mar 28, 2011 6:31 AM (in response to ilya_shaikovsky)Hmm we have tried without any luck. You mean something like:
<rich:extendedDataTable id="userdatatable" name="userdatatable"
value="#{userBean.baUserInfoList}" var="user" rows="10" onrowclick="showUser();">
<a4j:jsFunction name="showUser" action="showusernavigationrule"><a4j:param name="suser" assignTo="#{userBean.selection }"></a4j:param> </a4j:jsFunction>
...
...
/aage
-
7. Richfaces 4 + datatable + onrowclick
sadinenianil Mar 28, 2011 11:39 AM (in response to aagenielsen)Here is the code that works -
<rich:extendedDataTable id="userdatatable" name="userdatatable"
value="#{userBean.baUserInfoList}" var="user" rows="10" onrowclick="showUser('#{user.id}');">
<a4j:jsFunction name="showUser" action="showusernavigationrule"><a4j:param name="param1" assignTo="#{userBean.selectedRowId }"></a4j:param> </a4j:jsFunction>
I am not sure if this resolves your issue. Here the problem is, you can assign only id of row selected, Not the complete selected row object.
Thanks,
Anil.
-
8. Richfaces 4 + datatable + onrowclick
ilya_shaikovsky Mar 29, 2011 3:06 AM (in response to sadinenianil)to assign complete object you should just use f:setPropertyActionListener or to define converter for object if using a4j:param.