You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mind Bridge <mi...@yahoo.com> on 2005/05/09 17:47:14 UTC

Re: contrib:Table queston

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="typeColumnValue@Block">
> <span jwcid="editableType@TextField" 
> value="ognl:components.table.tableRow.type" size="25"/>
> </span>
> <span jwcid="familyColumnValue@Block">
> <span jwcid="editablefamily@TextField" 
> value="ognl:components.table.tableRow.family" size="50"/>
> </span>
> <span jwcid="@Conditional" condition="ognl:showRemove">
> <span jwcid="removeColumnValue@Block">
> <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: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org