I have a page contains a form and other form nested in a dialog. I need to pass parameter to dialog when button clicked in the main form
<h:form>
<p:dataTable var="form" value="#{myBean.formList}">
<p:commandButton id="selectProduct"
update="selectProductForm" oncomplete="selectProductDlg.show()"
image="ui-icon-" >
<f:param name="formId" value="#{form.id}" />
</p:commandButton>
</p:dataTable>
</h:form>
<p:dialog>
...<h:form>
<p:commandButton action="#{myBean.setSelected}"
update="main_form"
oncomplete="if(#{myBean.errorText == 'SUCCESS'}){ selectProductDlg.hide();}"
value="Sec">
</p:commandButton>
i can not see formId in myBean with code:
if (form == null) {
HttpServletRequest req = (HttpServletRequest) FacesContext
.getCurrentInstance().getExternalContext().getRequest();
if(req.getParameter("formId") != null) {
formId = Long.valueOf(req.getParameter("formId"));
}
if (formId != null && !"".equals(formId)) {
form = formService.findById(formId);
}
}
where am i wrong thanks