0 Replies Latest reply on May 26, 2008 10:52 AM by Bruno Gillioli

    Dynamic ListShuttle - Help

    Bruno Gillioli Newbie

      Hi! I'm trying to do a Dynamic ListShuttle as the following code:

      listShuttle = (HtmlListShuttle)application.createComponent(HtmlListShuttle.COMPONENT_TYPE);
      listShuttle.setId("listShuttle_" + id);
       listShuttle.setListsHeight("200");
       listShuttle.setSourceListWidth("300");
       listShuttle.setTargetListWidth("300");
       listShuttle.setSourceCaptionLabel(sourceCaptionLabel);
       listShuttle.setTargetCaptionLabel(targetCaptionLabel);
       listShuttle.setSourceValue(listHierarchy);
       listShuttle.setTargetSelection(targetCollection);
       listShuttle.setVar("item");
      
      HtmlColumn columnLeft = (HtmlColumn)application.createComponent(HtmlColumn.COMPONENT_TYPE);
       columnLeft.setWidth("200");
       columnLeft.setStyle("font-family: Verdana; font-size: 10px; font-weight: bold; font-style: normal");
      
       HtmlOutputLabel labelHeaderLeft = new HtmlOutputLabel();
      
       labelHeaderLeft = (HtmlOutputLabel)application.createComponent(HtmlOutputLabel.COMPONENT_TYPE);
       labelHeaderLeft.setValue(headerLeftLabel);
       labelHeaderLeft.setStyle("font-family: Verdana; font-size: 10px; font-weight: bold; font-style: normal");
      
       columnLeft.setHeader(labelHeaderLeft);
      
       HtmlOutputLabel outputLabelLeft = (HtmlOutputLabel)application.createComponent(HtmlOutputLabel.COMPONENT_TYPE);
       ValueBinding createValueBinding = application.createValueBinding("#{item.name}");
       outputLabelLeft.setValueBinding("value", createValueBinding);
      
       columnLeft.getChildren().add(outputLabelLeft);
      
       listShuttle.getChildren().add(columnLeft);
      
      


      When I click in a submit button, my action can't get the values from my target list. The targetSelection is always null. How can I do this? If someone could help me.. Thanks a lot!!!