incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Renzo Tomaselli <renzo.tomase...@tecnotp.it>
Subject [Trinidad] NavigationPanelRenderer bug
Date Wed, 17 Jan 2007 08:54:08 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="+1">Hi, I was wondering why this fragment renders well all
its MenuModel tabs:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr:navigationPane
hint="tabs" value="#{tabBean.tabData}"
var="tab"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;f:facet name="nodeStamp"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &lt;tr:commandNavigationItem text="#{tab.label}"
action="#{tab.action}"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;/f:facet&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;tr:commandNavigationItem/&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr:navigationPane&gt;<br>
<br>
while this renders nothing:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr:navigationPane
hint="tabs" value="#{tabBean.tabData}"
var="tab"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;f:facet name="nodeStamp"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &lt;tr:commandNavigationItem text="#{tab.label}"
action="#{tab.action}"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;/f:facet&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr:navigationPane&gt;<br>
<br>
The problem is located in NavigationPanelRenderer.encodeAll() method,
which skips rendering if there are no children. However tabs can be
defined either by children or by stamping, so that having at least one
dummy child like in my example is enough to trigger rendering
(rendering actually occurs by stamping, they are mutually exclusive).<br>
I think that the test:<br>
<br>
&nbsp;&nbsp;&nbsp; if (renderedItemCount &gt; 0)<br>
<br>
should be something like:<br>
<br>
&nbsp;&nbsp;&nbsp; int renderedRowCount = (</font><font size="+1">(UIXHierarchy)component).getRowCount();</font><br>
<font size="+1">&nbsp;&nbsp;&nbsp; if (renderedItemCount &gt; 0 || </font><font
 size="+1">renderedRowCount </font><font size="+1">&gt; 0)<br>
<br>
Btw, I'm using a simple one-level MenuModel for this. It works, exept
for method getAction on items which is never called. GetLabel is
called, though.<br>
<br>
-- Renzo<br>
<br>
<br>
<br>
</font>
</body>
</html>

Mime
View raw message