Re: contrib:Table queston

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: contrib:Table queston

Mind Bridge
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: contrib:Table queston

Mind Bridge
Here is a possibility:

<binding name="columns" expression=' "type, family" + showRemove ? ",
remove" : "" '/>

(not tested)


Tapestry Forum User wrote:

> Hi,
> This is how I define the table columns:
>
> <component id="table" type="contrib:Table">
> <binding name="source" expression="fileTypeItems"/>
> <static-binding name="columns" value="type, family, remove"/>
> </component>
>
> How do I modify the above?
>
>
>
> Sent using Mail2Forum (http://www.mail2forum.com) Read this topic
> online here: http://www.tapestryforums.com/viewtopic.php?p=2240#2240
>
>------------------------------------------------------------------------
>
>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: [hidden email]
For additional commands, e-mail: [hidden email]