-
1. Re: 4.1.0 M1 rich:orderingList Validation error
lsqfjbn Aug 26, 2011 3:01 AM (in response to lsqfjbn)I would really appericiate if someone could show me a sample on how to use the new ordering list in 4.1.0 M1
-
2. Re: 4.1.0 M1 rich:orderingList Validation error
iabughosh Aug 26, 2011 7:35 AM (in response to lsqfjbn)Hi Ji,
ex:
<rich:orderingList value="#{user.values}">
<f:selectItem itemLabel="Item 1"
itemValue="1"/>
<f:selectItem itemLabel="Item 2"
itemValue="2"/>
</rich:orderingList>
where user.values is a List<String> ,
regards.
-
3. Re: 4.1.0 M1 rich:orderingList Validation error
bleathem Aug 27, 2011 1:50 AM (in response to lsqfjbn)Hi Benniu Ji,
With the orderingList, you need to provide a converter if your list objects are not simple Strings..
-
4. Re: 4.1.0 M1 rich:orderingList Validation error
lsqfjbn Aug 31, 2011 3:04 AM (in response to bleathem)Yes, I did use a converter but it didn't work.
Actually, I'm doing almost the same as it is in the sample in github.
-
5. Re: 4.1.0 M1 rich:orderingList Validation error
lsqfjbn Aug 31, 2011 3:07 AM (in response to iabughosh)Hi, Ibrahim
You solution works, but the problem is when I rerender the ordering list after changing the order, it will show both the values and the selectItems lables
Like:
2
Item 2
1
Item 1
3
Item 3
4
Item 4
-
6. Re: 4.1.0 M1 rich:orderingList Validation error
iabughosh Sep 4, 2011 9:40 AM (in response to lsqfjbn)please post your .xhtml & bean code.
-
7. Re: 4.1.0 M1 rich:orderingList Validation error
ilya_shaikovsky Sep 5, 2011 3:13 PM (in response to lsqfjbn)if you seeing "j_idt30:list: Validation Error: Value is not valid" - that definitelly means that the value still can't be succesfully converted.
In order to do clean test of your data and converter correctness and confirm that it's not (or it is) a component issue - change ordering list to any JSF selectMany* components and try to submit some selection using the same model.
-
8. Re: 4.1.0 M1 rich:orderingList Validation error
lsqfjbn Sep 8, 2011 3:27 AM (in response to ilya_shaikovsky)Thanks. Finally, I made it work.
<rich:orderingList id="tc_orderList" value="#{executionSetManager.sortedExecutionCases}" columnVar="item" maxListHeight="500" listWidth="700">
<f:selectItems value="#{executionSetManager.executionCases}" />
<f:converter converterId="ExecutionCaseConverter" />
<rich:column>
<f:facet name="header">Id</f:facet>
<h:outputText value="#{item.exId}" />
</rich:column>
<rich:column>
<f:facet name="header">Test Case Name</f:facet>
<h:outputText value="#{item.tcName}" />
</rich:column>
<rich:column>
<f:facet name="header">Test Script Name</f:facet>
<h:outputText value="#{item.tsName}" rendered="#{item.tsName != null}"/>
<h:outputText style="color: Red" value="Script Not Found" rendered="#{item.tsName eq null}"/>
</rich:column>
</rich:orderingList>
The strange thing is that, if the value of tcName contains a comma, the getAsObject method will got the wrong string.
For example, if the name is "test case 1, no test data", the getAsObject will be called twice. First one is for string 'test case 1' and seconde one is for 'no test data'. I can't understand why it will devided into 2 string if there is a comma in the string. The expect result is that getAsOjbec will receive the string 'test case 1, no test data'.
-
9. Re: 4.1.0 M1 rich:orderingList Validation error
bleathem Sep 8, 2011 3:58 AM (in response to lsqfjbn)Glad to hear you got it working! What you noticed w.r.t. commas in the value, is becuase the list of selected values is submitted from the browser to! the server as a comma seperated list. This comma separated list is then exploded and the converter run on each piece.
At the time of writing the component, we figured no one would use a comma in the value portion of a converter - I guess you proved us wrong. If you feel we should use a different character, or allow for the character used to be configured, please file a jira requesting that.
-
10. Re: 4.1.0 M1 rich:orderingList Validation error
lsqfjbn Sep 9, 2011 11:57 AM (in response to bleathem)Ok, I understand why that happened. Thanks for you info, Brian!
From my side, I have a walk around. I replaced commna with another symble and change it back after it was converted. I have to do this because I can't gerentee that the user will not use a comma in the string.
Rather than hanlding it myself, I think this could be done in your component. I think the better solution is to encode the selected values and decode it before convert. After the encode, no comma or other special character should exist in the values.