This content has been marked as final.
Show 9 replies
-
1. Re: facesMessages and t:panelNavigation2
cayo Jul 17, 2006 3:54 PM (in response to cayo)"cayo" wrote:
Hello,
first thanks for the great work on seam, it's a pleasure to work with it. Unfortunately I've had two little problems in the last weeks.
The first one concerns the use of facesMessages after the successful injection into a bean. I'm turning the showDetails param to true in my jsf-message component and every time I use the facesMessages.addFromResourceBundle("xyz") the message is shown twice (the summary and the details are exactly the same). Icouldn't get it work to get the message only once. If I put al literal in the message instead of the resourceBundle-key it works fine.
My second problem appears while using the t:panelNavigation2 component. It doesn't holds the state after a klick on it. So the activated menuItem doesn't show in fat letters or e.g. the dynamically opened menu is always again closed (as initialized). Is this probably a problem with the states in the phases of a faces request?
Sorry for my bad english, I'm looking forward for some help. Thx!! -
2. Re: facesMessages and t:panelNavigation2
cayo Jul 17, 2006 3:56 PM (in response to cayo)bad mistake ... the described errors make me tired! Sorry for that!
-
3. Re: facesMessages and t:panelNavigation2
gavin.king Jul 17, 2006 4:12 PM (in response to cayo)We can't help you if you don't show code.
-
4. Re: facesMessages and t:panelNavigation2
cayo Jul 17, 2006 4:21 PM (in response to cayo)Ok, I will post some code tomorrow. Now I'm at home and can't get it. I thought/hopped it cold be a known issue.
-
5. Re: facesMessages and t:panelNavigation2
cayo Jul 18, 2006 2:30 AM (in response to cayo)First the thing with the messages:
<t:div styleClass="messageBlock">
<h:messages layout="list" globalOnly="false" errorClass="error" showDetail="true" />
</t:div>
above the declaration which is inserted in a facelets template like this:
<ui:insert name="messages">
<div id="status">
<ui:include src="messagefooter.xhtml" />
</div>
</ui:insert>
and used in the source like this:
@In(create=true)
private transient FacesMessages facesMessages;
...
facesMessages.addFromResourceBundle("msg.info.6");
or
facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_WARN, "msg.warn.2");
The message "msg..." is found in the resourceBundle which is declared in the seam.properties and displayed twice in one row on the screen.
If I don't use a message from the bundle it works correct. -
6. Re: facesMessages and t:panelNavigation2
cayo Jul 18, 2006 2:46 AM (in response to cayo)And the problem with rendering the navigation:
the code from the facelets template:
<ui:insert name="navigation">
<div id="subnavigation_outer" class="navigationform_outer">
<div id="subnavigation" class="navigationform">
<ui:include src="navigationmenu.xhtml" />
</div>
</div>
</ui:insert>
the inserted navigationmenu.xhtml
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<div class="section">
<h:form id="navForm">
<t:panelNavigation2 id="nav01" layout="list" itemClass="mypage" activeItemClass="selected" openItemClass="selected" >
<t:commandNavigation2 id="listing" value="#{messages['nav_0']}" >
<t:commandNavigation2 id="listingStandard" value="1" action="#{productform.processAction}">
<t:outputText value="#{messages['nav_0_1']}" />
</t:commandNavigation2>
<t:commandNavigation2 id="listingNonfood" value="4" action="#{productform.processAction}">
<t:outputText value="#{messages['nav_0_2']}" />
</t:commandNavigation2>
<t:commandNavigation2 id="listingRqm" value="3" action="#{productform.processAction}">
<t:outputText value="#{messages['nav_0_3']}" />
</t:commandNavigation2>
<t:commandNavigation2 id="listingRol" value="5" action="#{productform.processAction}">
<t:outputText value="#{messages['nav_0_4']}" />
</t:commandNavigation2>
<t:commandNavigation2 id="listingTest" value="2" action="#{productform.processAction}">
<t:outputText value="#{messages['nav_0_5']}" />
</t:commandNavigation2>
<t:commandNavigation2 id="listingAktion" action="null" value="#{messages['nav_0_6']}" >
<t:commandNavigation2 id="listingAktionNonfood" value="7" action="#{productform.processAction}">
<t:outputText value="#{messages['nav_0_6_1']}" />
</t:commandNavigation2>
<t:commandNavigation2 id="listingDrogerie" value="6" action="#{productform.processAction}">
<t:outputText value="#{messages['nav_0_6_2']}" />
</t:commandNavigation2>
</t:commandNavigation2>
<t:commandNavigation2 id="listingDezentral" value="8" action="#{productform.processAction}">
<t:outputText value="#{messages['nav_0_7']}" />
</t:commandNavigation2>
</t:commandNavigation2>
<t:commandNavigation2 id="arbeitsliste" action="worklist" actionListener="#{worklist.processAction}" >
<t:outputText value="#{messages['nav_1']}" />
</t:commandNavigation2>
<t:commandNavigation2 id="prozesse" value="#{messages['nav_2']}" >
<t:commandNavigation2 id="prozessTemplates" actionListener="#{templatelist.processAction}">
<t:outputText value="#{messages['nav_2_1']}" />
</t:commandNavigation2>
<t:commandNavigation2 id="prozessInstanzen" actionListener="#{instancelist.processAction}">
<t:outputText value="#{messages['nav_2_2']}" />
</t:commandNavigation2>
</t:commandNavigation2>
<t:commandNavigation2 id="logoff" action="#{worklist.logoff}" >
<t:outputText value="#{messages['nav_4']}" />
</t:commandNavigation2>
</t:panelNavigation2>
</h:form>
</div>
</div>
the web.xml is configured correctly, every t:-component is use works fine including the navigation. It only initializes after ervery rendering and doesn't hold the state. -
7. Re: facesMessages and t:panelNavigation2
gavin.king Jul 18, 2006 7:57 AM (in response to cayo)"cayo" wrote:
First the thing with the messages:
<t:div styleClass="messageBlock">
<h:messages layout="list" globalOnly="false" errorClass="error" showDetail="true" />
</t:div>
Aren't you supposed to use:<h:messages layout="list" globalOnly="false" errorClass="error" showDetail="true" showSummary="false"/>
? -
8. Re: facesMessages and t:panelNavigation2
gavin.king Jul 18, 2006 7:59 AM (in response to cayo)As for the second question, I have absolutely no idea, I don't use tomahawk stuff.
Neither of these questions seem to be related to Seam. -
9. Re: facesMessages and t:panelNavigation2
cayo Jul 18, 2006 8:31 AM (in response to cayo)"showSummary=false" that's it!
So the Seam method for sending a FacesMessage behaves slightly different to the original one from the MyFaces implementation. There it's the summary that is set by default.