You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 9 Members of 4090 |
| Forum: Seam Users |
25. Mar 2008, 22:18 CET | Link |
Hi,
I've got the following facelet:
<s:decorate id="#{name}">
<c:if test="#{empty noSelectionLabel}">
<c:set var="noSelectionLabel" value="----" />
</c:if>
<c:if test="#{defautSelectItems and items.size eq 1}">
<c:set var="noSelectionLabel" value="" />
</c:if>
<h:selectOneMenu ... >
<s:selectItems ... noSelectionLabel="#{noSelectionLabel}" />
</h:selectOneMenu>
</s:decorate>
The expected behavior of this is when #{items} has only one value and #{defautSelectItems} is true, the #{noSelectionItem} shouldn't show. But what happens is that because the 1st render has no items it show the #{noSelectionLabel} as ----, but when I reRender the selectOneMenu with only 1 item, it keeps showing the noSelectionLabel but it shouldn't show it because the #{noSelectionLabel} is empty.
Do I need to add something at s:selectItems to get this behaviour?
Ty.
7 Replies: | |||
|---|---|---|---|
you first need to understand what c:if really does. this may help c:foreach-vs-ui:repeat-in-facelets |
|||
Hi Martin, The problem is nt that. I changed my code to:
<s:decorate id="#{name}">
<c:if test="#{empty noSelectionLabel}">
<c:set var="noSelectionLabel" value="----" />
</c:if>
<c:if test="#{defautSelectItems and items.size eq 1}">
<c:set var="noSelectionLabel" value="" />
</c:if>
Label: #{noSelectionLabel}
<h:selectOneMenu ... >
<s:selectItems ... noSelectionLabel="#{noSelectionLabel}" />
</h:selectOneMenu>
</s:decorate>
End after the reRender, the displey of noSelectionLabel changes to the value I expect but inside the selectOneMenu it doesn't. I think it is a cache problem. Any ideia?
Marcell Manfrin Barbacena |
|||
I thought so (and even point to the João Paulo) but the jira issue is about the hideNoSelectionLabel functionality which is to hide after a option is selected. Should I raise another issue or add a comment at this pointing this problem? Is there a work around already? ps.: We discussed here and we think the problem is the same as the issue points: caching.
Marcell Manfrin Barbacena |
|||
Tnx. Voted and now wathing :).
Marcell Manfrin Barbacena |
Marcell Manfrin Barbacena
Tribunal Superior Eleitoral
+55 (61) 3316-3645
mbarbacena a tse.gov.br
barbacena a gmail.com
Brazil - Brasília