JSF submit dataTable and openpopup window after? is this possible?
Is it possible to ju开发者_Go百科st submit a dataTable instead of the entire form and then open a popupwindow after the submit?
My dataTable has textboxes in it and the popup window is actually dependent on the data/values found in these textboxes. Since the user can change the values of the textboxes, I am required to get the latest values from the dataTables before the popup is opened. the popup is opened through a button found in each row of the datatable.
i am using JSF2. thanks.
When you invoke the click action, pass the id of the textarea in that row as a param then find that component in the tree and get its value. you can use that value in the popup window.
popup.xhtml:
<h:outputText value="#{backingBean.popupText}" />
in the controller:
public void myActionListener(ActionEvent e){
..........
String textAreaID = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(TEXTAREA_ID);
HtmlInputTextarea textArea = (HtmlInputTextarea)FinderUtil.findComponentInRoot(textAreaID);
String text = (String) textArea.getValue();
//this is the backing bean used in the popup window
backingBean.setPopupText(text);
...............
}
精彩评论