1 Reply Latest reply on Jul 13, 2009 2:45 PM by Pavel Nereknu

    action param

    Pavel Nereknu Newbie

      Hello, i have enother newbie question :-))

       <a4j:form>
       <rich:tree id="catTree" switchType="client">
       <rich:recursiveTreeNodesAdaptor var="item"
       roots="#{categoryBean.rootCategories}" nodes="#{item.subCategories}">
       <rich:treeNode>
       <h:outputText value="#{item.name}" />
       </rich:treeNode>
       <rich:treeNodesAdaptor nodes="#{item}">
       <rich:treeNode>
       <a4j:form>
       <a4j:commandLink actionListener="#{categoryBean.clicked}" value="Pridat kategorii"
       id="link" onclick="Richfaces.showModalPanel('panel');">
       <a4j:actionparam name="parentId" value="#{item.id}" />
       </a4j:commandLink>
       </a4j:form>
       </rich:treeNode>
       </rich:treeNodesAdaptor>
       </rich:recursiveTreeNodesAdaptor>
       </rich:tree>
       </a4j:form>
      
       public void clicked(ActionEvent e){
       @SuppressWarnings("unused")
       Long parentId = Long.valueOf(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get( "parentId" ).toString());
      
       }
      


      the problem is, that FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get( "parentId" ) is NULL...it seems to me, that JSF binds the valuen at the time of the request, not at the time of the rendering (when item exists)...

      thanks...

      Pavel