Hi, first of all, thanks for all your post and ideas, i'm grateful for your
support.

i decided to solve my problem this way

in the view: 
  <h:panelGrid binding="#{managedBean.panelGrid}" /> 

the managed bean:
public HtmlPanelGrid getPanelGrid ()
{
      HtmlPanelGrid grid = new HtmlPanelGrid ();
      ....

      for (Actions action : actions) {
      
            if (action.getType () == ActionTypes.COMMAND_LINK) {
                    HtmlCommandLink link = new HtmlCommandLink ();
                    link.setId (action.getId ());
                    link.setTitle (action.getTitle ());
 
                    HtmlOutputText text = new HtmlOutputText ();
                    text.setValue (MessagesUtil.getMessage ("actions",
action.getTitle (), null));
        
                    link.getChildren ().add (text);
        
                    MethodBinding method = FacesContext.getCurrentInstance
().getApplication ().
                                    createMethodBinding (action.getValue (),
null);
                    link.setAction (method);
                    grid.getChildren ().add (link);
            }
      }
      return grid;
}

but the commandLink doesn't work, and i have no idea of what is happening.

if i put a commandLink into the panelGrid manually, then the commandLink
works fine.

<h:panelGrid id="id" binding="#{managedBean.panelGrid}">
       <h:commandLink id = "asd"  action="#{managedBean.action}">
            <h:outputText value="action name" />
       </h:commandLink>
</h:panelGrid>

Thanks
-- 
View this message in context: 
http://www.nabble.com/Newbie-question%3A-How-to-generate-a-jsf-component-dynamically-tf2743954.html#a7677123
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to