0 Replies Latest reply on Jul 31, 2007 11:10 AM by Konstantin Kauz

    strange beheviar

    Konstantin Kauz Novice

       

      <a4j:region renderRegionOnly="true">
       <h:outputText value="System " rendered="#{not empty navi.systemList}"/>
       <h:selectOneMenu id="sel_system" value="#{navi.system}" rendered="#{not empty navi.systemList}">
       <s:selectItems value="#{navi.getSystemList()}" var="systemitem" label="#{systemitem.label}"/>
       <f:converter converterId="sysConverter" />
       <a4j:support event="onchange" reRender="ticket" />
       </h:selectOneMenu>
       </a4j:region>


      If i use selectonemenu with converter i need two clicks to get right result,

      whitout selectonemenu with datatable does work.

      here is my converter:

      @Name("sysConverter")
      @BypassInterceptors
      @Converter
      public class SystemConverter implements javax.faces.convert.Converter{
      
       private List<SystemItem> items;
      
       public Object getAsObject(FacesContext facesContext, UIComponent uIComponent, String value) {
       List<SystemItem> sitems = (List) Component.getInstance("systemList");
       Integer sId = new Integer(value);
       if ( sitems ==null || sitems.size() == 0 ) return null;
      
       for (SystemItem item:sitems){
       if ( item.getId() == sId.intValue() ) return item;
       }
       return null;
       }
      
       public String getAsString(FacesContext facesContext, UIComponent uIComponent, Object object) {
       SystemItem back = (SystemItem) object;
       return back.getId() + "";
       }
      
      }