[richfaces-issues] [JBoss JIRA] (RF-6026) PickList doesn't accept comma in string value of SelectItem

Stefan Risto (JIRA) jira-events at lists.jboss.org
Tue Mar 27 07:03:49 EDT 2012


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

Stefan Risto commented on RF-6026:
----------------------------------

The problem still exists in RF 4.2. I use a converter that produces a String containing a comma. But the java script code does not escape the comma in any way, so my converter fails, because it gets two selections where it expects one, e.g. "You,me" is the selected value, but the converter is caled with "You" and a second time with "me".


                
> PickList doesn't accept comma in string value of SelectItem
> -----------------------------------------------------------
>
>                 Key: RF-6026
>                 URL: https://issues.jboss.org/browse/RF-6026
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.3.0
>         Environment: WebLogic 10, JSF 1.2, RichFaces 3.3.0, Hibernate JPA, Facelets 1.1.14
>            Reporter: Andrzej Haczewski
>             Fix For: 3.Future
>
>
> When you use a List<SelectItem> where SelectItems are created like this:
> new SelectItem("SOME STRING,CONTAINING COMMA", "A nice string to show in list")
> as a PickList <h:selectItems>, and use List<String> as PickList value, then PickList doesn't validate when you add that item to target list.
> The reason is that UISelectMany is trying to validate values "SOME STRINGS" and "CONTAINING COMMA" with available items.
> The exact point is the UISelectMany.matchValue() method, which returns false on validation of that PickList.
> Sample code:
> --- BackingBean.java
> class BackingBean {
> private List<SelectItem> picklistItems;
> private List<String> result;
> public BackingBean() {
> picklistItems = new ArrayList<SelectItem>();
> picklistItems.add(new SelectItem("SAMPLE,EXAMPLE", "Sample example"));
> }
> // then comes getters and setters for picklistItems and result
> }
> --- PickList.xhtml
> <rich:pickList value="#{backingBean.result}">
> <h:selectItems value="#{backingBean.picklistItems}">
> </rich:pickList>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list