4 Replies Latest reply on May 8, 2009 7:16 AM by nbelaevski

    usingSuggestObjects=

    dcernahoschi

      Caused by: javax.faces.FacesException: Error in conversion Java Object to JavaScript
      at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:146)
      at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:86)
      at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:141)
      ... 52 more
      Caused by: javax.faces.FacesException: Error in conversion Java Object to JavaScript
      at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:146)
      at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:141)
      ... 54 more
      Caused by: java.lang.NoSuchMethodException: Property 'handler' has no getter method
      at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1127)
      at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)
      at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
      at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)
      at org.ajax4jsf.javascript.ScriptUtils.toScript(ScriptUtils.java:141)
      ... 55 more

      The code is the following:

      
      <rich:suggestionbox for="clientName" suggestionAction="#{invoicing.filterClientsByName}" usingSuggestObjects="true"
       onobjectchange="test(suggestion)" var="client" minChars="3" width="227">
       <a:support event="onselect" ajaxSingle="true" immediate="true" process="clientName"
       action="#{invoicing.processClient}" reRender="clientForm" focus="next">
       <f:setPropertyActionListener value="#{client}" target="#{invoicing.client}" />
       </a:support>
       <h:column><h:outputText value="#{client.clientName}"/> </h:column>
      </rich:suggestionbox>
      


        • 1. Re: usingSuggestObjects=
          nbelaevski

          Hello,

          Looks much like: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=154930. Do suggested objects contain enums? What is your RF version?

          • 2. Re: usingSuggestObjects=
            dcernahoschi

            I'm using RF 3.3.0 GA but I've also tried the 3.3.1CR2 with the same problem.

            No enums on my suggested object.

            @Entity
            @Table(name = "client")
            public class Client implements Serializable {
            
             private static final long serialVersionUID = -503591052962224706L;
            
             private Long id;
            
             private String cui;
             private String clientName;
             private String regCode;
            
             private String notes;
            
             private Integer activeInd;
            
             private Company company;
            
             private Set<Contact> contacts = new HashSet<Contact> ();
             private Set<Invoice> invoices = new HashSet<Invoice> ();
             private Set<ClientVisibility> clientVisibilities = new HashSet<ClientVisibility> ();
             private Set<ClientData> clientDatas = new HashSet<ClientData> ();
            ...
            }
            


            • 3. Re: usingSuggestObjects=
              dcernahoschi

              It seems to me that the ScriptUtils.toScript method is not able to process composed objects.
              Because after removing all the composed objects and collections from the suggestion object the error disappeared.
              Is there a way to specify which fields need translated to script and rest to be ignored?

              • 4. Re: usingSuggestObjects=
                nbelaevski

                Hello,

                No, it's not possible to specify which part of object graph to process using some settings. The only way is creating specialized class containing only the data that has to be processed.