0 Replies Latest reply on Feb 20, 2007 6:39 AM by face4web

    Localselector in repeater

    face4web

      Hi,

      In most samples on the internet people uses the selectonemenu to select a local. But we want to select a locale using an arraylist of strings.

      Action:

      public ArrayList<String> getLanguages(){
       ArrayList<String> items = new ArrayList<String>();
       for(SelectItem s : LocaleSelector.instance().getSupportedLocales())
       items.add((String) s.getValue());
      
       return items;
       }
      
       public void setLanguage(ActionEvent ae){
       UIComponent tmpComponent = ae.getComponent();
       LocaleSelector.instance().selectLanguage(tmpComponent.getId());
       }
      
      


      xHtml:
      <ui:repeat value="#{languagesAction.languages}" var="language">
       <s:link value="#{language}" actionListener="#{languagesAction.setLanguage}" />
       </ui:repeat>


      We can't set an ID dynamically (valuebinding 'problem'), using the f:param didn't work.

      Who can help us?

      Kind Regards