2 Replies Latest reply on Jan 12, 2010 1:11 PM by boy18nj

    Converter concatenation?

    boy18nj

      i am using listshuttle to displace brand and description.

       

      Inside my entity-

          @Override
      public String toString(){
          return codeBrand +":"+ codeDesc;
      }

       

      My converter-

      @Name("airlineConverter")
      @BypassInterceptors
      @Scope(ScopeType.PAGE)
      @Converter(forClass=CodeBrands.class)
      public class AirlinesConverter
              implements javax.faces.convert.Converter{

       

          public Object getAsObject(FacesContext context, UIComponent component,
                  String value) {
              String[] words = value.split(":");
              String codeBrand = words[0];
              String codeDesc = words[1];
              CodeBrands airline = new CodeBrands(codeBrand, codeDesc);
              return airline;
          }

       

          public String getAsString(FacesContext arg0, UIComponent arg1, Object value) {
              return value.toString();
          }
      }

       

       

      If you notice here, I am separation codeBrand and codeDesc using colons. But it is possible the DB desc already has colons, then the listshuttle

      won't show brand and desc properly.?

      So can you suggest me workaround for this scenario, where descriotion can contain any special character?