• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dynamic data on page

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there guys,

This topic heading looks just like others in this forum, I've read them and implmented the proposed solutions but something is still not working.

Here's what I have.

jsf page.....
...
<h:panelGroup id="parameterPanel" binding="#{reportBean.parameterPanel}"/>
...
<h:commandButton value="Request Report" id="requestReportButton" action="#{reportBean.requestReport}"/>
...

backing bean
...
public UIPanel getParameterPanel() {
return parameterPanel;
}
public void setParameterPanel(UIPanel parameterPanel) {
this.parameterPanel = parameterPanel;
}
...
private void loadParameters() {
HtmlOutputText table = new HtmlOutputText();
table.setValue("<table>");
table.setEscape(false);
parameterPanel.getChildren().add(table);

for (Parameter parameter : parameters) {
if (!parameter.isVisible()) {
continue;
}

table = new HtmlOutputText();
table.setValue("<tr><td valign='top'>");
table.setEscape(false);
parameterPanel.getChildren().add(table);

// add the label/////////////////////////////
HtmlOutputText label = new HtmlOutputText();
label.setValue(parameter.getLabel() + (parameter.isRequired() ? " * " : ""));
parameterPanel.getChildren().add(label);

table = new HtmlOutputText();
table.setValue("</td><td>  </td><td valign='top'>");
table.setEscape(false);
parameterPanel.getChildren().add(table);

// add the parameter control/////////////////////////////
parameterPanel.getChildren().add(parameter.getControl());

table = new HtmlOutputText();
table.setValue("</td><td>  </td><td valign='top'>");
table.setEscape(false);
parameterPanel.getChildren().add(table);

// add the blurp/////////////////////////////
HtmlOutputText blurp = new HtmlOutputText();
blurp.setValue(parameter.getBlurp());
blurp.setStyle("font-size:small;font-style:italic");
parameterPanel.getChildren().add(blurp);

table = new HtmlOutputText();
table.setValue("</td></tr>");
table.setEscape(false);
parameterPanel.getChildren().add(table);
}

table = new HtmlOutputText();
table.setValue("</table>");
table.setEscape(false);
parameterPanel.getChildren().add(table);

}

All the get control does is check the parameter attributes and decide whether to make the type an html input, radio button drop down box etc...

All works well when loading the page, but after I have filled values in to the input fields the setter for the panel never gets called.

When I click on the requestReport button the framework doesn't ever call the setParameterPanel method.

Like the binding isn't working after the first time.

Please help, let me know if you need any more info.

thanks
Darryl
 
darryl nortje
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I solved this.

The problem was that the
<h:panelGroup id="parameterPanel" binding="#{reportBean.parameterPanel}"/>

was inside a <f:verbatim tag. This meant that the binding went for a ball.

sorry if I wasted someone's time by not posting the full source code. I did leave out the <f:verbatim tag in my original post.

Anyway. Don't put any elements you want to have bound to the backing bean inside a verbatim tag.

cheers
Darryl
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


One you have created the table in the backing bean, supose you want to access the values of the table iterating over the table.

How will this be done??

thanks
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic