Tôi có một trang chứa biểu mẫu và biểu mẫu khác được lồng trong một hộp thoại. tôi cần phải vượt qua tham số để thoại khi nút bấm theo hình thức chínhTruyền tham số vào hộp thoại trong cùng một trang
<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>
tôi không thể nhìn thấy formId trong myBean với mã:
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);
}
}
đang ở đâu tôi sai cảm ơn
cảm ơn rất nhiều, tôi đã từng nghĩ tôi không thể vượt qua tham số cho phương thức hành động, bây giờ tôi thay đổi nội dung mã của tôi và nó làm việc – merveotesi
Bạn đang chào đón. – BalusC