Reputation: 71
I am working with JSF 1.2 where in I am using rich:dataTable to display list of user details. User info on each row can be editable thru commandLink. Once we click on the command link it will pop up a modal panel with the current value of the user & we can click a edit button on the modal panel to make necessary changes & save the data to database.
The issue I am facing is when ever I click on the edit command link for 2nd row of the datatable, the pop up panel is displaying the user information of 1st row.
Thru command link, I am setting up the currently selected user row value by calling an action method in backing bean & capturing the selected user information as follow
<a4j:commandLink value = "Edit" onclick="#{rich:component('UserPopUp')}.show()"
action="#{ocrUserBean.captureCurrentUser()}"/>
public void captureCurrentUser(){
FacesContext context = FacesContext.getCurrentInstance();
currentUser = (User) context.getExternalContext().getRequestMap().get("ocrUser");
}
I my modal panel i am displaying the currentUser.getFirstName in an input text.
Upvotes: 0
Views: 291