13 Replies Latest reply on Jan 15, 2008 9:51 AM by lukums2008

    listShuttleDemo - Property 'name' not found on type java.lan

    lukums2008

      Hi,

      I am trying to run one of example for listShuttle(from JBoss demo) but getting an error

      16:51:03,031 WARN [lifecycle] executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@145d135) threw exception
      javax.faces.FacesException: org.apache.jasper.el.JspPropertyNotFoundException: /jsf/listShuttle.jsp(43,30) '#{item.name}' Property 'name' not found on type
      java.lang.String
      at javax.faces.component.UIOutput.getValue(UIOutput.java:176)
      at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:189)
      at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)

      UI works fine. It shows columns, I am able to move lines from one panel to another but once I click on "Server Action" link it throws exception to server.log file.


      Thanks
      Akhmad

        • 1. Re: listShuttleDemo - Property 'name' not found on type java

          what are you putting in the control's datamodel?
          Are you using arraylist like datamodels?

          the problem seem like you are adding String objects to the DataModel.

          if you are putting String objects in you arraylist, you only need to do that:

          <h:outputText value="#{item}"></h:outputText>.
          


          • 2. Re: listShuttleDemo - Property 'name' not found on type java
            lukums2008

             

            "robertocarlos@gmail.com" wrote:
            what are you putting in the control's datamodel?
            Are you using arraylist like datamodels?

            the problem seem like you are adding String objects to the DataModel.

            if you are putting String objects in you arraylist, you only need to do that:

            <h:outputText value="#{item}"></h:outputText>.
            


            I use arraylist
            .....
            public ListShuttleOptionItem(String name, int price) {
            super();
            this.name = name;
            this.price = price;
            }
            ....

            front-end
            .....

            <rich:listShuttle id="listShuttle" var="item"
            sourceValue="#{listShuttleDemoBean.source}"
            targetValue="#{listShuttleDemoBean.target}"
            orderControlsVisible="#{listShuttleDemoBean.orderControlsVisible}"
            fastOrderControlsVisible="#{listShuttleDemoBean.fastOrderControlsVisible}"
            moveControlsVisible="#{listShuttleDemoBean.moveControlsVisible}"
            fastMoveControlsVisible="#{listShuttleDemoBean.fastMoveControlsVisible}"

            sourceSelection="#{listShuttleDemoBean.sourceSelection}"
            targetSelection="#{listShuttleDemoBean.targetSelection}"


            <rich:column width="200px"><h:outputText value="#{item.name}" /></rich:column>
            <rich:column width="200px"><h:outputText value="#{item.price}" /></rich:column>
            <rich:column width="200px">
            <f:facet name="header">
            <h:outputText value="Action Links" />
            </f:facet>
            <h:commandLink value="Action" action="#{item.action}" />

            <h:outputText binding="#{listShuttleDemoRequestBean.eventsBouncer}" />
            </rich:column>
            </rich:listShuttle>
            ...


            • 3. Re: listShuttleDemo - Property 'name' not found on type java

              Can you put some code where the source and target property are filled and some code where you define these properties?

              • 4. Re: listShuttleDemo - Property 'name' not found on type java
                lukums2008

                 

                "robertocarlos@gmail.com" wrote:
                Can you put some code where the source and target property are filled and some code where you define these properties?


                Here is part of bean class

                public class ListShuttleDemoBean {

                private Collection sourceSelection;
                private Collection targetSelection;
                ...
                private ListShuttleOptionItem[] source;

                private ListShuttleOptionItem[] target;

                ...

                public ListShuttleDemoBean() {
                super();

                source = new ListShuttleOptionItem[3];
                for (int i = 0; i < source.length; i++) {
                source = new ListShuttleOptionItem("Source " + i, i);
                }

                target = new ListShuttleOptionItem[5];
                for (int i = 0; i < target.length; i++) {
                target
                = new ListShuttleOptionItem("Target " + i, i);
                }

                for (int i = 0; i < numbers.length; i++) {
                numbers = new Random().nextInt(256);
                }
                }
                .....
                .....

                Here is face xml file

                ....
                ....
                <managed-bean>
                <managed-bean-name>listShuttleOptionItem</managed-bean-name>
                <managed-bean-class>ListShuttleOptionItem</managed-bean-class>
                <managed-bean-scope>request</managed-bean-scope>
                <managed-property>
                <property-name>name</property-name>
                <property-class>java.lang.String</property-class>
                <null-value/>
                </managed-property>
                <managed-property>
                <property-name>price</property-name>
                <property-class>java.lang.Integer</property-class>
                <null-value/>
                </managed-property>
                </managed-bean>
                .....
                .....

                The thing is it works showing list and I can move item from one side to another side but I cannot do any server operations


                • 5. Re: listShuttleDemo - Property 'name' not found on type java

                  First at all you have something wrong in the code
                  you are asigning the ListShuttleOptionItem instance to an array variable (Probably was a mistake when you write the post)

                  Sencondly i dont know if in your case is necesary register the ListShuttleOptionItem in the faces config, but i think is not necesary if you are only use through the item variable; but the ListShuttleDemoBean is necesary, show me the part in the faces config where you are defining the ListShuttleDemoBean and show the code for the get methods of the properties source and target





                  If item is an instance of ListShuttleOptionItem, action must be a method in ListShuttleOptionItem defined like this
                   public String action(){
                   ....
                   }
                  


                  what do you have in the line 43 of your JSP?
                  What are you doing in the action method?

                  • 6. Re: listShuttleDemo - Property 'name' not found on type java
                    lukums2008

                     

                    "robertocarlos@gmail.com" wrote:
                    First at all you have something wrong in the code
                    you are asigning the ListShuttleOptionItem instance to an array variable (Probably was a mistake when you write the post)

                    Sencondly i dont know if in your case is necesary register the ListShuttleOptionItem in the faces config, but i think is not necesary if you are only use through the item variable; but the ListShuttleDemoBean is necesary, show me the part in the faces config where you are defining the ListShuttleDemoBean and show the code for the get methods of the properties source and target





                    If item is an instance of ListShuttleOptionItem, action must be a method in ListShuttleOptionItem defined like this
                     public String action(){
                     ....
                     }
                    


                    what do you have in the line 43 of your JSP?
                    What are you doing in the action method?



                    Ok,

                    This is all what I have for this list box in faces xml
                    ...
                    <managed-bean>
                    <managed-bean-name>listShuttleDemoBean</managed-bean-name>
                    <managed-bean-class>ListShuttleDemoBean</managed-bean-class>
                    <managed-bean-scope>session</managed-bean-scope>
                    </managed-bean>
                    <managed-bean>
                    <managed-bean-name>listShuttleDemoRequestBean</managed-bean-name>
                    <managed-bean-class>ListShuttleDemoRequestBean</managed-bean-class>
                    <managed-bean-scope>request</managed-bean-scope>
                    </managed-bean>
                    <managed-bean>
                    <managed-bean-name>listShuttleOptionItem</managed-bean-name>
                    <managed-bean-class>ListShuttleOptionItem</managed-bean-class>
                    <managed-bean-scope>request</managed-bean-scope>
                    <managed-property>
                    <property-name>name</property-name>
                    <property-class>java.lang.String</property-class>
                    <null-value/>
                    </managed-property>
                    <managed-property>
                    <property-name>price</property-name>
                    <property-class>java.lang.Integer</property-class>
                    <null-value/>
                    </managed-property>
                    </managed-bean>
                    ...

                    in line 43 I have

                    .....<rich:column><h:outputText value="#{item.name}" /></rich:column>

                    Action method is empty, like you said
                    public String action() {
                    System.out.println("**************** ListShuttleOptionItem.action() ");
                    return "test";
                    }

                    Here is link to demo
                    http://livedemo.exadel.com/richfaces-demo/richfaces/listShuttle.jsf?c=listShuttle

                    And I got sources from Jboss open sources, as I remember from thier website.

                    I can send sources of bean and jsp page if you would like.

                    Thanks

                    • 7. Re: listShuttleDemo - Property 'name' not found on type java

                      are you modify the example? because i have the example if you didnt modify the example i can try reproduce the error.

                      • 8. Re: listShuttleDemo - Property 'name' not found on type java
                        lukums2008

                         

                        "robertocarlos@gmail.com" wrote:
                        are you modify the example? because i have the example if you didnt modify the example i can try reproduce the error.


                        No I did not.
                        I do not have face xml file from demo example but I think there is nothing more then I have in my face xml file. Everything else is same




                        • 9. Re: listShuttleDemo - Property 'name' not found on type java

                          I create a war with the files on the example and all work fine. Can i send the example?

                          • 10. Re: listShuttleDemo - Property 'name' not found on type java
                            lukums2008

                             

                            "robertocarlos@gmail.com" wrote:
                            I create a war with the files on the example and all work fine. Can i send the example?


                            Yes, please
                            I will compare them. I have no idea why it errors. :)
                            my email is akhmad.amirov@syniverse.com

                            thanks


                            • 11. Re: listShuttleDemo - Property 'name' not found on type java
                              lukums2008

                               

                              "robertocarlos@gmail.com" wrote:
                              I create a war with the files on the example and all work fine. Can i send the example?


                              What JBoss version do you use?
                              I use 4.2.2

                              • 12. Re: listShuttleDemo - Property 'name' not found on type java

                                i use 4.2.1 GA

                                • 13. Re: listShuttleDemo - Property 'name' not found on type java
                                  lukums2008

                                   

                                  "robertocarlos@gmail.com" wrote:
                                  i use 4.2.1 GA


                                  nope, it does not work.
                                  I use Richfaces 3.1.3.

                                  I will continue playing around. Probably problem with libs.

                                  Thanks for help