[ 
http://www.stripesframework.org/jira/browse/STS-300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11502#action_11502
 ] 

Tim Fennell commented on STS-300:
---------------------------------

Agreed.  I think this is too much for one tag.  Really the ActionBean should 
just present the reduced collection to the page I think.

> Filtering for options-enumeration/options-collection
> ----------------------------------------------------
>
>                 Key: STS-300
>                 URL: http://www.stripesframework.org/jira/browse/STS-300
>             Project: Stripes
>          Issue Type: New Feature
>          Components: Tag Library
>    Affects Versions: Release 1.4.1
>            Reporter: Andy
>
> Currently the options-enumeration and options-collection tags render all 
> values in the enum or collection.
> They will be more useful if filtering criteria can be specified when not all 
> values should be rendered.
> package xxx.enums;
> public enum MyNumber { ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN;
> public boolean getIsPrime() { return this==TWO || this==THREE || this==FIVE 
> || this==SEVEN; }
> public boolean getIsEven() { return (ordinal() % 2) == 1; }
> }
> <stripes:options-enumeration enum="xxx.enums.MyNumber"/>
> (renders all seven options)
> <stripes:options-enumeration enum="xxx.enums.MyNumber" where="isPrime"/>
> (renders only TWO, THREE, FIVE, SEVEN)
> <stripes:options-enumeration enum="xxx.enums.MyNumber" where="isEven"/>
> (renders only TWO, FOUR, SIX)
> If the proposed where= attribute supports some kind of expression language 
> (EL?), it will be much more flexible:
> <stripes:options-enumeration enum="xxx.enums.MyNumber" where="isPrime && 
> !isEven"/>
> (renders only THREE, FIVE, SEVEN)
> For symmetry, the options-collection tag should likewise take a where= 
> attribute.
> A typical use would be, where="theCurrentUserCanSeeThisOption" :)

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

        

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to