This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
how to bind value attribute inside another component binding attribute
s manchika
Greenhorn
Joined: Jan 21, 2004
Posts: 5
posted
0
I have HtmlPanelGroup which is created using binding attribute. This PanelGroup has many JSF elements like inputText, SelectOneMenu etc.. I am generating the Panelgroup successfully with all the elements.
My question is can I bind a dataObject to the value attribute for the elements under the PanelGroup. If so how will I do this.
For Ex: I am creating a text field inside the panelGroup as follows
HtmlPanelGroup panelGroup = new HtmlPanelGroup();
HtmlInputText inputText = new HtmlInputText();
inputText.setId("someIdVal");
inputText.setValue("someValue");
panelGroup.getChildren().add(inputText )
I am trying to do something like this
HtmlInputText inputText = new HtmlInputText();
inputText.setId("someIdVal");
inputText.setValue("#{someBeanObj.variableName}");
so that when user enters some value in inputTextField , the value gets stored under the mentioned variable.
You can do this, but you have to bind an EL context to the dynamically-created HtmlInputText value property. It won't just take an EL expression, unfortunately.
I've done this, and it's a real pain. I use this method to help me out:
Usage is as follows:
"g0" is the container control for my dynamic fields. In your case, it would be the PanelGroup.
Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: how to bind value attribute inside another component binding attribute