[richfaces-issues] [JBoss JIRA] Commented: (RF-7034) Missing selected items in pickList

Nick Belaevski (JIRA) jira-events at lists.jboss.org
Thu May 7 14:05:47 EDT 2009


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

Nick Belaevski commented on RF-7034:
------------------------------------

Well, I've changed the code:

    private List<SelectItem> roleNames = new ArrayList<SelectItem>(); 
    private List<String> selRoleNames = new ArrayList<String>(); 

    {
	    String[] ss = {"1", "2", "3", "4"};
    	for (String s : ss) { 
	        roleNames.add(new SelectItem(s, "Item " + s)); 
	    } 
	
	    ss = new String[]{"2"};
    	for (String s : ss) { 
	        selRoleNames.add(s); 
	    } 
    } 
    
    public List<SelectItem> getRoleNames() {
		return roleNames;
	}
    
    public void setRoleNames(List<SelectItem> roleNames) {
		this.roleNames = roleNames;
	}
    
    public List<String> getSelRoleNames() {
		return selRoleNames;
	}
    
    public void setSelRoleNames(List<String> selRoleNames) {
		this.selRoleNames = selRoleNames;
	}
    
Now there are 4 items.

1. Selected "3", clicked "Copy", then submit
2. Right list contains both "2" and "3" items

Tried to use another combinations, but still no luck

Can you please check my code?

> Missing selected items in pickList
> ----------------------------------
>
>                 Key: RF-7034
>                 URL: https://jira.jboss.org/jira/browse/RF-7034
>             Project: RichFaces
>          Issue Type: Bug
>    Affects Versions: 3.3.1
>         Environment: JDK 1.5.0_11
> JBoss AS 4.2.3.GA
> Seam 2.1.1.GA
> JSF 1.2_09-b01-BETA1
> JSF-Facelets 1.1.15.B1
> Richfaces 3.3.1.CR2
>            Reporter: Rainer Flicker
>            Assignee: Tsikhon Kuprevich
>
> If a pickList reads selected items from a variable in a backing bean, initial values in the list of selected items are missing
> after a submit. (Works with 3.3.0.GA)
> --- xhtml snippet ---
>   <rich:pickList value="#{userDetailsManager.selRoleNames}"
>     sourceListWidth="200px"  targetListWidth="200px">
>     <f:selectItems value="#{userDetailsManager.roleNames}" />
>   </rich:pickList>
> ----
> --- userDetailsManager snippet ---
>     private List<SelectItem> roleNames = new ArrayList<SelectItem>();
>     private List<String> selRoleNames = new ArrayList<String>();
>     for (Role role : roles) {
>         roleNames.add(new SelectItem(""+role.getId(), role.getName()));
>     }
>     for (Role role : user.getRoles()) {
>         selRoleNames.add("" + role.getId());
>     }
> ----

-- 
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