-
1. Re: ListShuttle Problem
nbelaevski Jan 29, 2009 6:29 PM (in response to archanarrao)Hi,
What does "Test1" stand for? Please post full page code. -
2. Re: ListShuttle Problem
archanarrao Jan 29, 2009 10:46 PM (in response to archanarrao)Right now I am getting this message "Property not writable on type java.util.List javax.el.PropertyNotFoundException:"
Here is part of my xhtml page where I have defined Listshuttle
<rich:listShuttle id="hostNameListId"
binding="#{ExampleList.hostNameShuttleList}"
converter="#{ExampleList.convert}"
sourceValue="#{ExampleList..sourceHostNameList}"
targetValue="#{ExampleList..targetHostNameList}"
var="items">
<rich:column>
<h:outputText value="#{items.hostName}"></h:outputText>
</rich:column>
</rich:listShuttle>
<a4j:commandButton value="OK"
reRender="modifyqueueform"
binding="#{ExampleList.okButton}"
action="#{ExampleList.reModifyHostNameList}">
</a4j:commandButton>
where sourceHostNameList and targetHostNameList are list of HostName object.
class HostName {
private String hostName;
}
In the ExampleList bean's construcor I am Instantiating HostName object with Test1 as host name and adding it to sourcelist. In the same way I am creating one more HostName object with Test2 as host name and adding it to the targetlist.
list is coming up with the proper host names in the source and target list box. when I click the ok button thats when it throws the exception -
3. Re: ListShuttle Problem
archanarrao Jan 29, 2009 10:57 PM (in response to archanarrao)Sorry for the previous post. I forgot to mark the code with code tags.
Right now I am getting this message "Property not writable on type java.util.List javax.el.PropertyNotFoundException:"
Here is part of my xhtml page where I have defined Listshuttle<td align="left"> <rich:listShuttle id="hostNameListId" binding="#{ExampleList.hostNameShuttleList}" converter="#{ExampleList.convert}" sourceValue="#{ExampleList..sourceHostNameList}" targetValue="#{ExampleList..targetHostNameList}" var="items"> <rich:column> <h:outputText value="#{items.hostName}"></h:outputText> </rich:column> </rich:listShuttle> <a4j:commandButton value="OK" reRender="modifyqueueform" binding="#{ExampleList.okButton}" action="#{ExampleList.reModifyHostNameList}"> </a4j:commandButton> </td> where sourceHostNameList and targetHostNameList are list of HostName object. class HostName { private String hostName; }
In the ExampleList bean's construcor I am Instantiating HostName object with Test1 as host name and adding it to sourcelist. In the same way I am creating one more HostName object with Test2 as host name and adding it to the targetlist.
list is coming up with the proper host names in the source and target list box. when I click the ok button thats when it throws the exception -
4. Re: ListShuttle Problem
nbelaevski Jan 30, 2009 6:57 AM (in response to archanarrao)I see there are two dots here:
#{ExampleList..sourceHostNameList}, #{ExampleList..targetHostNameList}
Can this be the reason? -
5. Re: ListShuttle Problem
ilya_shaikovsky Jan 30, 2009 7:01 AM (in response to archanarrao)also except the converter you should override equals and hasCode inside your objects properly
-
6. Re: ListShuttle Problem
archanarrao Jan 30, 2009 10:50 AM (in response to archanarrao)Hi,
Thank you for your response. The two dots in the code was a copy and paste problem. I have correctly written in my code. I have also overridden eqals and hasCode methods for HostName object. The problem I am currently facing is when I click ok button before it comes to the action method it is throwing the following exception.
sourceId=modifyqueueform:hostNameListId[severity=(ERROR 2), summary=(javax.el.PropertyNotFoundException: /pages/ExampleList.xhtml @289,18 sourceValue="#{ExampleList.sourceHostNameList}": Property 'sourceHostNameList' not writable on type java.util.List), detail=(javax.el.PropertyNotFoundException: /pages/ExampleList.xhtml @289,18 sourceValue="#{PitcherQueues.sourceHostNameList}": Property 'sourceHostNameList' not writable on type java.util.List)]
sourceId=modifyqueueform:hostNameListId[severity=(ERROR 2), summary=(javax.el.PropertyNotFoundException: /pages/ExampleList.xhtml @289,18 targetValue="#{ExampleList.targetHostNameList}": Property 'targetHostNameList' not writable on type java.util.List), detail=(javax.el.PropertyNotFoundException: /pages/ExampleList.xhtml @289,18 targetValue="#{ExampleList.targetHostNameList}": Property 'targetHostNameList' not writable on type java.util.List)] -
7. Re: ListShuttle Problem
ilya_shaikovsky Jan 30, 2009 11:05 AM (in response to archanarrao)show java code also then.
-
8. Re: ListShuttle Problem
archanarrao Jan 30, 2009 11:11 AM (in response to archanarrao)Hi,
My code is working. The problem was in my bean object. In the methods sourceHostNameList() and targetHostNameList() instead of passing List object i was passing ArrayList object.