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

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

This does work.  You're being extremely rude here.  Perhaps when submitting 
bugs you might work under the assumptions that:
  - the author of the framework knows more about it than you do (shocking I 
know)
  - the person responding to you is not a glib asshole looking for the quickest 
way to get rid of you

Acting like this is simply not a good way to ask for help when I'm providing 
this help for free and with no obligation.

Take a look at the Bugzooky application that ships with Stripes.  The 
AddEditBug.jsp page works in two modes.  One is adding a bug - in which case 
the user navigates directly to the JSP and there is no ActionBean  present.  In 
this case the following works like a charm:
                        <stripes:select name="bug.priority" value="Medium">
                            <stripes:options-enumeration 
enum="net.sourceforge.stripes.examples.bugzooky.biz.Priority"/>
                        </stripes:select>

You can also change this to the following and it'll still work:
                        <stripes:select name="bug.priority" 
value="<%=Priority.High%>">
                            <stripes:options-enumeration 
enum="net.sourceforge.stripes.examples.bugzooky.biz.Priority"/>
                        </stripes:select>

This is exactly how it ships.  If you want to see it working with an 
options-collection (instead of an enum) you can edit the bug.owner.id drop-down 
and see it work too:
                        <stripes:select name="bug.owner.id" value="${3}">
                            <stripes:options-collection 
collection="${personManager.allPeople}"
                                                        label="username" 
value="id"/>
                        </stripes:select>

Now, when you click the edit link next to any of the bugs on the bug list, it 
submits to an ActionBean that pre-loads the Bug, and the values stored in the 
Bug/ActionBean *override* the values specified on the JSP.  This is how it is 
intended to work.  

So, there's your working example.  You can make your check out to Tim 
Fennell..... 

> 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