[ http://mc4j.org/jira/browse/STS-221?page=comments#action_10365 ] 

Tim Fennell commented on STS-221:
---------------------------------

Unless I mis-understand you, this is not a bug.  Given that a select can have 
it's value populated from many places (the value="" attribute, the http request 
and the ActionBean) Stripes must make some choices about the order in which it 
examines each of these things.  By default, Stripes chooses to look at the 
request first (i.e. it takes precedence over value=""), the ActionBean second, 
and value="" stuff on pages third.

Take a look at  "Input Tag Population and Repopulation" in the following 
document:
  http://stripes.mc4j.org/confluence/display/stripes/Tag+Library+Doc

I believe what you really want is a custom PopulationStrategy that looks for 
values in the inverted order of value="", ActionBean then request, or something 
like that.

> stripes:select tag has an error on making option item selected when is used 
> with collection. It is unable to make selection
> ---------------------------------------------------------------------------------------------------------------------------
>
>          Key: STS-221
>          URL: http://mc4j.org/jira/browse/STS-221
>      Project: Stripes
>         Type: Bug

>   Components: Tag Library
>     Versions: Release 1.3.2
>  Environment: Mac OSX, Java 5, Stripes 1.3.2
>     Reporter: Remis B
>     Assignee: Tim Fennell
>     Priority: Blocker

>
> Code snipet below does not work, value attribute from select tag is ignored 
> on option tag.
>  <stripes:select name="currency" id="fldCurrencyCode" 
> value="${accountSettings.currencyCode}">
>      <stripes:options-collection collection="${utilAction.currencies}" 
> value="currencyCode" label="symbol"/>
>  </stripes:select>
> I'm not very sure have I done it correctly but it works for me. Below is 
> updated code for InputSelectTag.isOptionSelected() method.
> public boolean isOptionSelected(Object optionValue, boolean selectedOnPage) 
> throws StripesJspException {
>     if (this.value != null) {
>             return isItemSelected(optionValue, this.value);
>     } else if (this.selectedValueOrValues != null) {
>             return isItemSelected(optionValue, this.selectedValueOrValues);
>     } else {
>             return selectedOnPage;
>     }
> }

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



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to