You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "F. Da Costa" <da...@xs4all.nl> on 2004/03/24 14:41:57 UTC

Re: Howto set a value through binding & should a disrupted render not throw an error? (solved but q still open)

F. Da Costa wrote:

> Hi,
> 
> This question concerns setting a value via the use of a binding.
> Treetable is a .jwc component that is used in the .page ImplTreeTable.
> Retrieving values goes fine so i know the 'route' works.
> 
> As i am trying to change the value of the binding the renderprocess 
> suddenly stops. No output of any kind is produced, error or whatever.
> 
> Within TreeTable it does enter the setIsInit.. method and thanit just 
> stops rendering and comes back to the screen. As if everything is fine.
> It does not however get to the next statement being 
> super.pageEndRender(event);.
> 
> What i'm trying to achieve is setting the initialized bit in the Visit 
> through the ImplTreeTable.
> I'm aware of the fact that there are more ways to skin this cat but I 
> happened to start on this one.
>
I worked around the issue by moving the setting part into the ImplTreeTable 
.page component.
This still leaves the key question as it was/ is.

> Obviously i'm doing something wrong but there are no exceptions to put 
> me onto the right way of doing this.
> 
> Does anybody have any suggestions as to how i *could* do this?
> 
> TIA
> Fermin DCG
> 
> 
> 
> *TreeTable*
> ..jwc:
> ....
> <parameter name="treeTableInitialized" type="boolean" required="yes" 
> direction="custom">
>  <description>
>  Indicates whether the user has already seen the page and it is thus 
> previously initialized
>  </description>
> </parameter>
> ....
> 
> TreeTable.java:
> ....
> public void pageBeginRender(PageEvent event) {
> }
> public void pageEndRender(PageEvent event) {
>  setIsInitialized(true);
>  super.pageEndRender(event);
> }
> 
> public boolean isInitialized() { // Works fine
>  return ((Boolean) 
> getBinding("treeTableInitialized").getObject()).booleanValue();
> }
> public void setIsInitialized(boolean initialized) { *Does not work*
>  getBinding("treeTableInitialized").setBoolean(initialized);
> }
> ....
> 
> 
> 
> *ImplTreeTable*
> ..page:
> <component id="treeTable" type="TreeTable">
>  <binding name="treeTableInitialized" expression="initialized" />
> ....
> 
> ImplTreetable.java:
> ....
> public boolean isInitialized() {
>  return ((Visit) getEngine().getVisit()).isInitialized(this.getPageName());
> }
> public void setIsInitialized(boolean initialized) {
>  Visit v = (Visit) getEngine().getVisit();
>  if (v!=null && initialized) v.setIsInitialized(this.getPageName());
> }
> ....
> 
> 
> 
> Visit.java:
>   public boolean isInitialized(String pageName) {
>       return _initializedPages.contains(pageName);
>   }
>   public void setIsInitialized(String pageName) {
>       _initializedPages.add(pageName);
>   }
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org