Help

Controls

PermLinkWikiLink

Built with Seam

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.

Forum: Seam Users Forum ListTopic List
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.

 

Marcell Manfrin Barbacena
Tribunal Superior Eleitoral
+55 (61) 3316-3645
mbarbacena a tse.gov.br
barbacena a gmail.com
Brazil - Brasília

7 Replies:
26. Mar 2008, 09:48 CET | Link

you first need to understand what c:if really does. this may help c:foreach-vs-ui:repeat-in-facelets

Rating:  * *
26. Mar 2008, 21:03 CET | Link

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
Tribunal Superior Eleitoral
+55 (61) 3316-3645
mbarbacena a tse.gov.br
barbacena a gmail.com
Brazil - Brasília

27. Mar 2008, 09:57 CET | Link

upps - sorry, I was wrong here

yes, c:if should work in this case

29. Mar 2008, 12:51 CET | Link

Probably this

 

Read about how to report a bug.

Rating:  * * *
29. Mar 2008, 14:30 CET | Link

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
Tribunal Superior Eleitoral
+55 (61) 3316-3645
mbarbacena a tse.gov.br
barbacena a gmail.com
Brazil - Brasília

29. Mar 2008, 14:39 CET | Link

I think it is the same issue.

 

Read about how to report a bug.

Rating:  * * * * *
29. Mar 2008, 14:55 CET | Link

Tnx. Voted and now wathing :).

 

Marcell Manfrin Barbacena
Tribunal Superior Eleitoral
+55 (61) 3316-3645
mbarbacena a tse.gov.br
barbacena a gmail.com
Brazil - Brasília