Hi,
How do you define the table columns?
If it is via the columns parameter, make the argument you pass conditional (via an OGNL expression, for example) -- include the last column only if the condition is true.
Tapestry Forum User wrote:
Hi,
I'm using a contrib:Table component. In that I'm displaying 3 columns, the first 2 columns must be displayed always and the last column is based on a condition. So, I have wrapped the last column around a conditional block, but whether the condition is satisfied or not the column's value gets displayed always.
If I move the conditional block out of that table, it works fine.
Have done the following:
<table class="fileType" jwcid="table">
<th>File Type</th>
<th>Family</th>
<span jwcid="[EMAIL PROTECTED]">
<span jwcid="[EMAIL PROTECTED]" value="ognl:components.table.tableRow.type" size="25"/>
</span>
<span jwcid="[EMAIL PROTECTED]">
<span jwcid="[EMAIL PROTECTED]" value="ognl:components.table.tableRow.family" size="50"/>
</span>
<span jwcid="@Conditional" condition="ognl:showRemove">
<span jwcid="[EMAIL PROTECTED]">
<input jwcid="removeFileType" type="submit" value="Remove File Type" />
</span>
</span>
</table>
In the component.. this is what I have done...
public void pageBeginRender(PageEvent event) { List list = getFileTypeItems(); if (list == null) { fileType.add(new FileType("", "" , "" )); setFileTypeItems(fileType); } if (fileType.size() <= 1) { setShowRemove(false); } else { setShowRemove(true); }
}
Please advice if I'm doing anything wrong.
Sent using Mail2Forum (http://www.mail2forum.com) Read this topic online here: http://www.tapestryforums.com/viewtopic.php?p=2237#2237
------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.6 - Release Date: 5/6/2005
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
