1 Reply Latest reply on Jan 18, 2011 10:31 AM by lvdberg

    passing parameters in seam

    franckoliver

      hi,


      I'm trying to build a tree dynamically and need to pass a componentID to my bean in order to retreive its childs and expand the tree. Does Anybody know, how to pass parameters from jsf view to a bean in seam? or any suggestions are welcome


      Here is what i've done


      <h:form>
                      <rich:tree styleClass="mytree" style="width:300px" value="#{transport.data}" var="item" nodeFace="#{item.type}" switchType="ajax" ajaxSubmitSelection="true">
                              <rich:treeNode type="container" icon="/img/container-yellow.png" changeExpandListener="#{transport.processExpansion(nodeExpandedEvent)}">
                                      <h:commandLink value="#{item.name}"/>
                                              <f:param name="containerID" value="#{item.id}"/>
                              </rich:treeNode>
                              <rich:treeNode type="pallet" icon="/img/icon_pallet.jpg" >
                                      <h:commandLink value="#{item.name}" />
                                              <f:param name="palletID" value="#{item.id}"/>
                              </rich:treeNode>
                              <rich:treeNode id="nodId" type="product" icon="/img/icon_paket.gif">
                                      <h:commandLink value="#{item.name}" />
                      </rich:treeNode>
                      <h:outputText value="#{item.id}"/>
                      </rich:tree>
              </h:form>
      </ui:define>





      public void containerExpand() {
                      FacesContext fc = FacesContext.getCurrentInstance();
                      Map<String,String> params = fc.getExternalContext().getRequestParameterMap();
                              Container container = new Container(Long.valueOf(params.get("containerID")));           
                              Pallet pallet = getPalletByName("Pallet 1", container); 
              }
      


      thank you for helping me : )