[JBoss Seam] - Correct Syntax for enum lookup in messages
by awhitford
For an edit page, I have an enum. My code looks something like:
| <s:selectItems value="#{myEnumTypes}"
| var="enumType" label="#{messages[enumType]}"
| hideNoSelectionLabel="true" noSelectionLabel="Please select..."/>
|
My problem is that I am not seeing any label text... I may have a bug in my build process, but I figured that it is worth asking...
Consider a ficticious enum declaration:
| package com.mycompany.foo;
|
| public enum enumType
| {
| E_ABC,
| E_PQR,
| E_XYZ;
|
| @Override
| public String toString ()
| {
| return name().substring(2);
| }
| }
|
Note that I am overriding toString because this enum is saved as a string to the database, and the "E_" prefix is redundant.
For messages_en.properties, what should the entries be?
Ironically, I have tried several permutations, and nothing seems to work, hence I am considering that I may have a build problem. But it would help to have a case like this documented since most of the examples are simply constants, like "#{messages.someMessageText}".
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016190#4016190
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016190
19Â years, 2Â months
[JBoss Seam] - Can conversation override session?
by lightbulb432
I'm trying to override a session-scoped component with a conversational-scoped component for the duration of the conversation (i.e. Within the conversation the conversational-scoped component is injected when @In refers to the shared component name. Then when the conversation ends that same @In would get the session-scoped component.)
I have outjected something from pages.xml using the following code. I have a session-scoped component under the name "shared", and this takes a conversational-scoped component "existing" and puts it under a conversational scope under the name "shared".
Now there are both a session- and conversational-scoped component with a name "exists", but the problem is that in the debug screen they have the same values when they shouldn't. Does putting scope="CONVERSATION" outject it only into the conversation, or into both the conversation and session? (I want the former behavior.) They are the same class of entity.
<page view-id="/mypage.xhtml">
| <navigation from-action="#{mybean.action}">
| <out name="shared" value="#{existing}" scope="CONVERSATION" />
| <redirect view-id="/toredirect.xhtml" />
| </navigation>
| </page>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016177#4016177
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016177
19Â years, 2Â months