[richfaces-issues] [JBoss JIRA] Commented: (RF-6951) List shuttle causes "invalid value expression" error.

Wayne Bagguley (JIRA) jira-events at lists.jboss.org
Thu Jun 25 14:36:56 EDT 2009


    [ https://jira.jboss.org/jira/browse/RF-6951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12473817#action_12473817 ] 

Wayne Bagguley commented on RF-6951:
------------------------------------

I have figured out one possible cause of this problem and I can reproduce it.

I have a table with a list of available options, let's call it the AVAILABLE_OPTION table. I also have a USER table and each User can have zero or more AvailableOptions chosen as their 'default options'.

I am using Seam and Hibernate and have a query like this for the options:

"select o from AvailableOption o", populating the 'availableList' variable

and this query for getting the user :

"select u from User u where u.username = :usernameParam" populating the 'user' variable

In the listShuttle, I tie the 'sourceValue' to 'availableList' and targetValue to 'user.defaultOptionList' then you will get the 'component value has invalid expression' error. (For this error to occur, user.defaultOptionList must not be empty).

This occurs because the AvailableOption object(s) in the user.defaultOptionList is first created by hibernate with javassist and it appears that this doesn't correctly pass on calls to .equals (that's my guess anyway).

This even occurs if I set eager fetching of the related entities.

Hope this helps in some way.

> List shuttle causes "invalid value expression" error.
> -----------------------------------------------------
>
>                 Key: RF-6951
>                 URL: https://jira.jboss.org/jira/browse/RF-6951
>             Project: RichFaces
>          Issue Type: Bug
>          Components: component-input
>    Affects Versions: 3.3.0
>         Environment: Windows XP,Eclipse  3.4.1, Sun JDK1.5.
>            Reporter: aasia samreen
>            Assignee: Tsikhon Kuprevich
>            Priority: Critical
>
> I found this thread by search "invalidvalue expression". 
> Initially i was getting this exception for source list and after  implementing the workaround using object array,it was working for source list.
> And now iam getting the same exception for target list.
> I tried to use an object array for target list as well but was not able to initialize the array (i need to specify the size but in this case array size is dyamic.) 
> Please have a look at the code:
> <rich:listShuttle id="LineConfigs"
> 		sourceValue="#{bean.availableline}"
> 		targetValue="#{bean.selectedLine}" var="varaible"
> 		sourceListWidth="280" listsHeight="250" targetListWidth="280"		
> 		binding="#{bean.ShuttleList}"			
> 		converter="convertor">
> </rich:listShuttle>
>  public Object[] getAvailableLine() {
>         if (availableline== null) {
>             availableline = initialLineList.toArray();
>         }
>         return availableline ;
>     }
> public Object[] getSelectedLine() {
>         if selectedLine== null) {
> 	// how to initialize the array. as i dont have any control on the number of selected lines.?
>               }
>      return selectedLine;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list