Custom Component Related
Hi Experts,
I created a Custom Component which is having a Text Field and a Command Link. I called the created Custom Component in a JSP file having form as LookUp. It is like this..
<h:form id="LookUp">
<jcr:lookup /> // This is a Custom Component
The Component is created and working fine. But the thing is I want to add a UIForm containing a Command Link to the UIViewRoot in which Now the UIViewRoot contains two forms one is LookUp and the second one is the newly added UIForm.
For adding the UIForm the code i have written is
UIViewRoot view = context.getViewRoot();
UIForm form = new UIForm();
form.setId("hiddenForm");
HtmlCommandLink link1 = new HtmlCommandLink();
link1.setId("command");
link1.setAction(linkBinding);
form.getChildren().add(link1);
link1.setParent(form);
view.getChildren().add(form);
form.setParent(view);
form.encodeBegin(context);
link1.encodeBegin(context);
link1.encodeEnd(context);
form.encodeEnd(context);
Now I checked the View Source, in that UIForm is added but it is added inside LookUp form. But it is should be added outside LookUp form because both these forms are children to UIViewRoot.
Am i missing any thing in this. Please help me if any of the experts know about this.
Thanks,
Kalyan

