-
1. Re: listShuttleDemo - Property 'name' not found on type java
robertocarlos1 Jan 12, 2008 1:04 AM (in response to lukums2008)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 Jan 14, 2008 9:43 AM (in response to 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
robertocarlos1 Jan 14, 2008 11:57 AM (in response to lukums2008)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 Jan 14, 2008 12:06 PM (in response to 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
robertocarlos1 Jan 14, 2008 12:54 PM (in response to lukums2008)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 thispublic 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 Jan 14, 2008 1:13 PM (in response to 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 thispublic 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
robertocarlos1 Jan 14, 2008 1:29 PM (in response to lukums2008)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 Jan 14, 2008 2:45 PM (in response to 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
robertocarlos1 Jan 14, 2008 2:57 PM (in response to lukums2008)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 Jan 14, 2008 2:59 PM (in response to 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 Jan 14, 2008 3:02 PM (in response to 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
robertocarlos1 Jan 14, 2008 4:32 PM (in response to lukums2008)i use 4.2.1 GA
-
13. Re: listShuttleDemo - Property 'name' not found on type java
lukums2008 Jan 15, 2008 9:51 AM (in response to 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