• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setAction Problem HtmlCommandButton

 
Andy Egli
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I get really bored. I tried to add an Action to a dynamic built HtmlPanelGrid. But the action method never gets called. Please help me!

mySite.xhtml:

<ice:form styleClass="defineCharacteristic" partialSubmit="false">
<ice:panelGrid binding="#{myBean.panel}"/>
</ice:form>

myBean:

private HtmlPanelGrid panelGrid;
private HtmlCommandButton button;

public void createPanel(){
panelGrid = new HtmlPanelGrid();
HtmlInputText input = new HtmlInputText();
input.setId("in")
panelGrid.getChildren().add(input);
button = new HtmlCommandButton();
button.setValue("Submit it!");
MethodBinding mb = FacesContext.getCurrentInstance().getApplication() .createMethodBinding("#{myBean.send}", new Class[0]);
button.setAction(mb);
panelGrid.getChildren().add(button);
}

public void send(){
**Method never called**
}

public void setPanel(HtmlPanelGrid _panelGrid){
panelGrid=_panelGrid;
}

public HtmlPanelGrid getPanel(){
return panelGrid;
}

Regards Andy
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change backing bean scope from request to session.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Call the createPanel() method in getPanel().


[ December 01, 2006: Message edited by: Bauke Scholtz ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic