You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Sami Dalouche (JIRA)" <ji...@apache.org> on 2007/02/12 23:16:16 UTC

[jira] Created: (WW-1738) Inconsistency between s:combobox and s:select behaviour.

Inconsistency between s:combobox and s:select behaviour.
--------------------------------------------------------

                 Key: WW-1738
                 URL: https://issues.apache.org/struts/browse/WW-1738
             Project: Struts 2
          Issue Type: Improvement
    Affects Versions: 2.0.5
            Reporter: Sami Dalouche


Let's take the example of a simple SexType enumeration {MALE, FEMALE}, that is used in conjunction with the EnumTypeConverter.

so, the action contains a pair of get/set for SexType ., as well as a getter for sexTraitTypes which returns a list of Key Value Pairs<SexType, String>, (the String is the label)

<s:select
		list="sexTraitTypes" 
		label="%{getText('profile.label.sex')}"
		name="sexTrait"
		listKey="key" 
		listValue="value" 
		emptyOption="true" />	
does NOT preselect anything whereas


<s:combobox
		list="sexTraitTypes" 
		label="%{getText('profile.label.sex')}"
		name="sexTrait"
		listKey="key" 
		listValue="value" 
		emptyOption="true" />

will automatically preselect the value given by getSexTrait();

Ok, so now, if we use :
<s:select
		list="sexTraitTypes" 
		label="%{getText('profile.label.sex')}"
		name="sexTrait"
                value="sexTrait"
		listKey="key" 
		listValue="value" 
		emptyOption="true" />	

Then, it's no better. And actually, the only way to achieve auto-preselection is :
<s:select
		list="sexTraitTypes" 
		label="%{getText('profile.label.sex')}"
		name="sexTrait"
                value="sexTrait.toString()"
		listKey="key" 
		listValue="value" 
		emptyOption="true" />	

So, I'm not sure if the need for toString() in the value is a bug by itself, but in any case, the fact that s:select is inconsistent with s:combobox would probably benefit of some improvement.....

Regards,
Sami Dalouche

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1738) Inconsistency between s:combobox and s:select behaviour.

Posted by "Philip Luppens (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40111 ] 

Philip Luppens commented on WW-1738:
------------------------------------

The select tag value is a known problem (WW-1711). The combobox hasn't received much attention afaik (at least not in WW, where I encountered quite some problems with it before closing the issue). I can only assume the S2 version suffers from the same defects.

> Inconsistency between s:combobox and s:select behaviour.
> --------------------------------------------------------
>
>                 Key: WW-1738
>                 URL: https://issues.apache.org/struts/browse/WW-1738
>             Project: Struts 2
>          Issue Type: Improvement
>    Affects Versions: 2.0.5
>            Reporter: Sami Dalouche
>
> Let's take the example of a simple SexType enumeration {MALE, FEMALE}, that is used in conjunction with the EnumTypeConverter.
> so, the action contains a pair of get/set for SexType ., as well as a getter for sexTraitTypes which returns a list of Key Value Pairs<SexType, String>, (the String is the label)
> <s:select
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />	
> does NOT preselect anything whereas
> <s:combobox
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />
> will automatically preselect the value given by getSexTrait();
> Ok, so now, if we use :
> <s:select
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
>                 value="sexTrait"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />	
> Then, it's no better. And actually, the only way to achieve auto-preselection is :
> <s:select
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
>                 value="sexTrait.toString()"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />	
> So, I'm not sure if the need for toString() in the value is a bug by itself, but in any case, the fact that s:select is inconsistent with s:combobox would probably benefit of some improvement.....
> Regards,
> Sami Dalouche

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WW-1738) Inconsistency between s:combobox and s:select behaviour.

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Husted resolved WW-1738.
----------------------------

    Resolution: Fixed

AFAICT, resolved by WW-1711. 


> Inconsistency between s:combobox and s:select behaviour.
> --------------------------------------------------------
>
>                 Key: WW-1738
>                 URL: https://issues.apache.org/struts/browse/WW-1738
>             Project: Struts 2
>          Issue Type: Improvement
>    Affects Versions: 2.0.5
>            Reporter: Sami Dalouche
>             Fix For: 2.0.6
>
>
> Let's take the example of a simple SexType enumeration {MALE, FEMALE}, that is used in conjunction with the EnumTypeConverter.
> so, the action contains a pair of get/set for SexType ., as well as a getter for sexTraitTypes which returns a list of Key Value Pairs<SexType, String>, (the String is the label)
> <s:select
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />	
> does NOT preselect anything whereas
> <s:combobox
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />
> will automatically preselect the value given by getSexTrait();
> Ok, so now, if we use :
> <s:select
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
>                 value="sexTrait"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />	
> Then, it's no better. And actually, the only way to achieve auto-preselection is :
> <s:select
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
>                 value="sexTrait.toString()"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />	
> So, I'm not sure if the need for toString() in the value is a bug by itself, but in any case, the fact that s:select is inconsistent with s:combobox would probably benefit of some improvement.....
> Regards,
> Sami Dalouche

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-1738) Inconsistency between s:combobox and s:select behaviour.

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Husted updated WW-1738:
---------------------------

    Fix Version/s: 2.0.6

> Inconsistency between s:combobox and s:select behaviour.
> --------------------------------------------------------
>
>                 Key: WW-1738
>                 URL: https://issues.apache.org/struts/browse/WW-1738
>             Project: Struts 2
>          Issue Type: Improvement
>    Affects Versions: 2.0.5
>            Reporter: Sami Dalouche
>             Fix For: 2.0.6
>
>
> Let's take the example of a simple SexType enumeration {MALE, FEMALE}, that is used in conjunction with the EnumTypeConverter.
> so, the action contains a pair of get/set for SexType ., as well as a getter for sexTraitTypes which returns a list of Key Value Pairs<SexType, String>, (the String is the label)
> <s:select
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />	
> does NOT preselect anything whereas
> <s:combobox
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />
> will automatically preselect the value given by getSexTrait();
> Ok, so now, if we use :
> <s:select
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
>                 value="sexTrait"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />	
> Then, it's no better. And actually, the only way to achieve auto-preselection is :
> <s:select
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
>                 value="sexTrait.toString()"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />	
> So, I'm not sure if the need for toString() in the value is a bug by itself, but in any case, the fact that s:select is inconsistent with s:combobox would probably benefit of some improvement.....
> Regards,
> Sami Dalouche

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-1738) Inconsistency between s:combobox and s:select behaviour.

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40124 ] 

Ted Husted commented on WW-1738:
--------------------------------

Thanks for the report. Based on your comment, I deleted the first screenshot. 


> Inconsistency between s:combobox and s:select behaviour.
> --------------------------------------------------------
>
>                 Key: WW-1738
>                 URL: https://issues.apache.org/struts/browse/WW-1738
>             Project: Struts 2
>          Issue Type: Improvement
>    Affects Versions: 2.0.5
>            Reporter: Sami Dalouche
>
> Let's take the example of a simple SexType enumeration {MALE, FEMALE}, that is used in conjunction with the EnumTypeConverter.
> so, the action contains a pair of get/set for SexType ., as well as a getter for sexTraitTypes which returns a list of Key Value Pairs<SexType, String>, (the String is the label)
> <s:select
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />	
> does NOT preselect anything whereas
> <s:combobox
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />
> will automatically preselect the value given by getSexTrait();
> Ok, so now, if we use :
> <s:select
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
>                 value="sexTrait"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />	
> Then, it's no better. And actually, the only way to achieve auto-preselection is :
> <s:select
> 		list="sexTraitTypes" 
> 		label="%{getText('profile.label.sex')}"
> 		name="sexTrait"
>                 value="sexTrait.toString()"
> 		listKey="key" 
> 		listValue="value" 
> 		emptyOption="true" />	
> So, I'm not sure if the need for toString() in the value is a bug by itself, but in any case, the fact that s:select is inconsistent with s:combobox would probably benefit of some improvement.....
> Regards,
> Sami Dalouche

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.