-
1. Re: how to retrieve richfaces datatable column values????
nbelaevski Oct 17, 2009 9:01 AM (in response to hasitharandika)Hi Hasith,
Please post page and bean code. -
2. Re: how to retrieve richfaces datatable column values????
hasitharandika Oct 17, 2009 9:43 AM (in response to hasitharandika)hi nbelaevski,
here's the code
this is the richfaces datatable
<rich:dataTable id="dt1" value="#{tableBean.loadAllUserRoles}" var="item" >
<f:facet name="header">
<h:outputText value="#{msg.role}"/>
</f:facet>
<rich:column>
<f:facet name="header">
<h:outputText value="#{msg.editRole}" id="userRoleName"/>
</f:facet>
<a4j:commandLink value="Edit" actionListener="#{tableBean.countListener}" reRender="userRoleName, loadAllUserRoles">
</a4j:commandLink>
</rich:column>
<rich:column sortBy="#{item.userRoleName}" filterBy="#{item.userRoleName}" filterEvent="onkeyup" >
<f:facet name="header">
<h:outputText value="#{msg.roleName}"/>
</f:facet>
<h:outputText value="#{item.userRoleName}" id="name"></h:outputText>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="#{msg.status}"/>
</f:facet>
<h:outputText value="#{item.status}"></h:outputText>
</rich:column>
<f:facet name="footer">
<rich:datascroller selectedStyle="font-weight:bold"/>
</f:facet>
</rich:dataTable>
and this is my Bean
public void countListener(ActionEvent event) {
System.out.println("Event:::::" event.toString());
System.out.println("\n""current Item:"+event.getComponent());
}
and i have getter and setter for userRoleName
i want to retrieve selected rows roleName from the bean
regards,
Randika -
3. Re: how to retrieve richfaces datatable column values????
nbelaevski Oct 17, 2009 10:00 AM (in response to hasitharandika)You can use f:setPropertyActionListener to assign value to bean property and "action" method instead of "actionListener".
-
4. Re: how to retrieve richfaces datatable column values????
hasitharandika Oct 17, 2009 10:09 AM (in response to hasitharandika)hi nbelaevski,
<a4j:commandLink value="Edit"
reRender="#{item.userRoleName}">
<f:setPropertyActionListener value="#{item.userRoleName}" target="#{tableBean.countListener}"/>
</a4j:commandLink>
so what are the changes that i should do in the Bean in order to get the assign value??? -
5. Re: how to retrieve richfaces datatable column values????
nbelaevski Oct 17, 2009 10:21 AM (in response to hasitharandika)BTW, there's an "Edit table with modal panel" example in livedemo.
-
6. Re: how to retrieve richfaces datatable column values????
hasitharandika Oct 17, 2009 10:46 AM (in response to hasitharandika)yes but they have not provided the Bean class there??
if you can give me a sample code or the bean class creation it would be nice, from the morning onwards i'm trying this but still couldn't sort it out
ideas would greatly appriciate
<a4j:commandLink value="Edit"
reRender="#{item.userRoleName}">
<f:setPropertyActionListener value="#{item.userRoleName}" target="#{tableBean.countListener}"/>
</a4j:commandLink>
in my backing bean i have this listener method
public void countListener(ActionEvent event) {
System.out.println("\n"+"current Item:"+userRoleName);
setUserRoleName(getUserRoleName());
}
but when i click the link this method does not invoke???
regards,
Randika -
7. Re: how to retrieve richfaces datatable column values????
nbelaevski Oct 17, 2009 10:58 AM (in response to hasitharandika)Randika,
You can get livedemo sources here: http://jboss.com/index.html?module=bb&op=viewtopic&t=104575
Just thought that you can pass necessary value as method argument if you are using Seam or JBoss-EL - check: http://www.ilikespam.com/blog/el-function-parameters-with-jboss-el or Seam documentation. -
8. Re: how to retrieve richfaces datatable column values????
nbelaevski Oct 19, 2009 6:57 AM (in response to hasitharandika)"target" attribute should point to an expression to be updated, not action listener method - read TLD documentation for more.