[jboss-user] [JBoss Seam] - Enums - Useage
tony.herstell@gmail.com
do-not-reply at jboss.com
Thu May 24 21:02:42 EDT 2007
Given:
| <ice:menuItem id="bookingIndoorArenaMenuOption"
| value="#{messages.menu_item_book_indoor_arena}"
| action="#{availabilityController.showAvailability(Resource.instance.ResourceKind.INDOOR_ARENA)}">
| <s:conversationPropagation type="none" />
| </ice:menuItem>
|
| <ice:menuItem id="bookingMenageIntArenaOption"
| value="#{messages.menu_item_book_int_arena}"
| action="#{availabilityController.showAvailability('INT_ARENA')}">
| <s:conversationPropagation type="none" />
| </ice:menuItem>
|
You can see above what I would LIKE to do (pass an Enum to the Controller as a parameter) and you can see what I have to do (and then do some coversion in teh code).
Is there a way to do this in Seam?
| @SuppressWarnings("serial")
| @Entity // Defines this as an Entity that is a class mapped to the Datastore.
| @Name("resource") // Name used within SEAM for an instance of this class.
| public class Resource implements Serializable {
|
| public enum ResourceKind {
| INDOOR_ARENA ("resource_indoor_arena"),
| INT_ARENA ("resource_int_arena"),
| SJ_ARENA ("resource_sj_arena"),
| CONF_ROOM ("resource_conf_room"),
| CAFE ("resource_cafe");
| private final String inlLabel;
| ResourceKind(String inlLabel) {
| this.inlLabel = inlLabel;
| }
| public String getInlLabel() { return inlLabel; }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048526#4048526
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048526
More information about the jboss-user
mailing list