You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jason Suplizio <su...@gmail.com> on 2005/11/23 01:18:10 UTC
Persistent Page property
On 11/22/05, Jason Suplizio <su...@gmail.com> wrote:
>
> Greetings,
> I have a page that creates a table using this component...
>
> <component id="eachEntry" type="For">
> <binding name="source" value="detailPagesColumns"/> //returns a
> List
> <binding name="element" value="literal:tr"/>
> <binding name="value" value="navRow"/>
> </component>
>
> html:
> <tr jwcid="eachEntry">
> <td><input jwcid="deleteNavColumn" image="ognl:
> components.globalImagesAssets.assets.deleteAction" alt="Delete Inner
> Table"/> </td>
> <td><span jwcid="sortField"></span></td>
> <td><span jwcid="columnTitle"></span></td>
> <td><span jwcid="originalTitle"></span></td>
> <td><span jwcid="alignSelect"></span></td>
> </tr>
>
> java:
> public List getDetailPagesColumns(){
> if (this.layoutNavColumns == null){
> this.buildDetailPagesColumns();
> }
> return this.layoutNavColumns;
> }
>
> Rendered in the above component is an image that deletes the
> corresponding row in the table:
>
> page:
> <component id="deleteNavColumn" type="ImageSubmit">
> <binding name="listener" value="listener:doDeleteNavColumn"/>
> <binding name="parameters" value="navRow"/>
> </component>
>
> java:
> public void doDeleteNavColumn(ClientReportNavColumn row){
> this.getDetailPagesColumns().remove(row);
> }
>
> When a user clicks on the button (deleteNavColumn) and invokes
> doDeleteNavColumn, its removed from the list, HOWEVER, I get an exception
> (below). If I right- click and go back, refresh the page, I show the entry
> has been deleted from the list. The idea is that the page gets refreshed
> and the item is removed from the list.
>
> I have a feeling I need to make this list a persistent property (using JDK
> 1.4.2 & Tapestry 4.0.10b) but I'm not certain if this will 1) fix my
> problem 2) how to create the property 3) initialize it 4) reference it in
> other components in the page spec file.
>
> Please help!!
> Jason
>
>