Hello
I'm trying to add hidden input to page dynamically.
The code is executed in the actionListener, wich is fired from link:
<h:commandLink id="editBuilding" action="editBuilding" onclick="openPopup(window,'editBuildingWnd','../',120)" target="editBuildingWnd" actionListener="#{buildingBean.selectObject}">
public void selectObject(ActionEvent event){ UIComponent body = FacesContext.getCurrentInstance().getViewRoot().findComponent("bodyTD"); HtmlInputHidden id = new HtmlInputHidden(); id.setRendered(true); id.setId("objID"); ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{buildingBean.objId}"); id.setValueBinding("objId",vb); body.getChildren().add(id); }
<f:view> <h:form id="popupForm" enctype="multipart/form-data" style="margin:0px; padding:0px" > <t:htmlTag value="td" id="bodyTD" forceId="true" > ... </t:htmlTag> </h:form>