You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by st...@wachovia.com on 2005/02/15 23:54:55 UTC

Re: page, component - ordering of events confusion [correction]

I meant to say that the flag is set in the formSubmit(IRequestCycle cycle) 
 method.




steven.libonati@wachovia.com 
02/15/2005 05:51 PM

Please respond to
"Tapestry users" <ta...@jakarta.apache.org>


To
Tapestry users <ta...@jakarta.apache.org>
cc

Subject
page, component - ordering of events confusion






I have a page that allows a user to enter a range of dates. On that page I 

have a component which is essentially a wrapper around a table component. 
The component accepts two parameters, the start date and the end date. I 
have a @Conditional on the page around the component. The boolean for the 
conditional is set to true *after* the date validation takes place.

The problem I'm having is that pageBeginRender() is being called on the 
component *before* I can set the flag in pageBeginRender() of the page. 
So, I'm getting null pointer exceptions because pageBeginRender() in the 
component is calling a data access method with null dates.

I thought that the components' pageBeginRender() method would only be 
called after the conditional is set to true.

Does this problem make sense to anyone. Can someone explain why this is 
happening? How do I fix it?

Thanks. 

 
ForwardSourceID:NT00003D5A 

Re: page, component - ordering of events confusion

Posted by st...@wachovia.com.
Well, inside my component's pageBeginRender method, I was able to do the 
following:

boolean getList = 
((Boolean)event.getPage().getProperty("showTable")).booleanValue();
if (getList) {
        // do the db query
}

This kinda fixed the problem, but raises another question: 

<property-specification name="showTable" type="boolean"/>
the showTable property is from the page that contains the component, not 
the components page, so how can the component access it this way?

Thanks.





steven.libonati@wachovia.com 
02/15/2005 05:54 PM

Please respond to
"Tapestry users" <ta...@jakarta.apache.org>


To
"Tapestry users" <ta...@jakarta.apache.org>
cc

Subject
Re: page, component - ordering of events confusion [correction]






I meant to say that the flag is set in the formSubmit(IRequestCycle cycle) 

 method.




steven.libonati@wachovia.com 
02/15/2005 05:51 PM

Please respond to
"Tapestry users" <ta...@jakarta.apache.org>


To
Tapestry users <ta...@jakarta.apache.org>
cc

Subject
page, component - ordering of events confusion






I have a page that allows a user to enter a range of dates. On that page I 


have a component which is essentially a wrapper around a table component. 
The component accepts two parameters, the start date and the end date. I 
have a @Conditional on the page around the component. The boolean for the 
conditional is set to true *after* the date validation takes place.

The problem I'm having is that pageBeginRender() is being called on the 
component *before* I can set the flag in pageBeginRender() of the page. 
So, I'm getting null pointer exceptions because pageBeginRender() in the 
component is calling a data access method with null dates.

I thought that the components' pageBeginRender() method would only be 
called after the conditional is set to true.

Does this problem make sense to anyone. Can someone explain why this is 
happening? How do I fix it?

Thanks. 

 
ForwardSourceID:NT00003D5A 

ForwardSourceID:NT00003D62