You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Perry Q Hertler <pe...@yahoo.com> on 2003/09/21 08:21:54 UTC

Override Validate or implement PageValidateListener?

An excerpt from the current javadocs concerning the
IPage.validate(IRequestCycle) method reads "Since 3.0,
it is easiest to not override this method, but to
implement the PageValidateListener interface instead."

Would someone explain why implementing
PaveValidateListener is now the preferred approach?

Thanks,
Perry

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


Re: Problem with a Stale link.

Posted by Mark Alcocer Flores <su...@yahoo.com>.
Thanks Darren, i will try that.

--- Darren Foltinek <da...@frontrange.ca> wrote:
> In most cases, a DirectLink is what you want,
> instead of an ActionLink.
> 
> I was getting "Stale Link" errors, and other bizarre
> behaviour before 
> replacing all my ActionLinks with DirectLinks - it
> was my first Tapestry 
> project, and I didn't understand the difference
> between the two types of 
> links.  Everything works nicely now.
> 
> Hope this helps,
> -- Darren
> 
> 
> >I have the following problem, I hope that you can
> help
> >me.
> >I have the following code:
> >
> ><td class='normalcell' align='center'>
> >  <font class="normal">
> >   <a jwcid="@ActionLink"
> >   listener="ognl: listeners.showAccountsSearch"
> >   class="normallink">
> >    Seleccionar
> >   </a>
> >  </font>
> ></td>
> >
> >public void showAccountsSearch(IRequestCycle cycle)
> {
> >  Protected page = (Protected)
> >cycle.getPage("AccountsSearch");
> >  page.setProperty("customer", ((CustomerData)
> >getProperty("currentCustomer")));
> >  page.validate(cycle);
> >  page.activate(cycle);
> >}
> >
> >with this direct link i am trying to call another
> >page. I have done ths many times in this way, but
> when
> >i click the link, I get the following error:
> >
> >   You have clicked on a stale link.
> >   Action id 2 does not match component
> >   CustomersSearch/$ActionLink$0.
> >   This is most likely the result of using your
> >   browser's back button, but can also be an
> >application
> >   error.
> >   You may continue by returning to the
> application's
> >
> >   home page.
> >
> >I have seen this error many times, and it usually
> >meant that i was sending some null value. I have
> done
> >several things to look for the error, but this time
> I
> >have check my code and it seems that no null values
> >have been sent and I dont see where the error is.
> Can
> >some one suggest me what can I do or where can I
> look
> >for the error.
> >
> >Thanks in advance,
> >Mark
> >
>
>---------------------------------------------------------------------
> >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
> 


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


Re: Problem with a Stale link.

Posted by Darren Foltinek <da...@frontrange.ca>.
In most cases, a DirectLink is what you want, instead of an ActionLink.

I was getting "Stale Link" errors, and other bizarre behaviour before 
replacing all my ActionLinks with DirectLinks - it was my first Tapestry 
project, and I didn't understand the difference between the two types of 
links.  Everything works nicely now.

Hope this helps,
-- Darren


>I have the following problem, I hope that you can help
>me.
>I have the following code:
>
><td class='normalcell' align='center'>
>  <font class="normal">
>   <a jwcid="@ActionLink"
>   listener="ognl: listeners.showAccountsSearch"
>   class="normallink">
>    Seleccionar
>   </a>
>  </font>
></td>
>
>public void showAccountsSearch(IRequestCycle cycle) {
>  Protected page = (Protected)
>cycle.getPage("AccountsSearch");
>  page.setProperty("customer", ((CustomerData)
>getProperty("currentCustomer")));
>  page.validate(cycle);
>  page.activate(cycle);
>}
>
>with this direct link i am trying to call another
>page. I have done ths many times in this way, but when
>i click the link, I get the following error:
>
>   You have clicked on a stale link.
>   Action id 2 does not match component
>   CustomersSearch/$ActionLink$0.
>   This is most likely the result of using your
>   browser's back button, but can also be an
>application
>   error.
>   You may continue by returning to the application's
>
>   home page.
>
>I have seen this error many times, and it usually
>meant that i was sending some null value. I have done
>several things to look for the error, but this time I
>have check my code and it seems that no null values
>have been sent and I dont see where the error is. Can
>some one suggest me what can I do or where can I look
>for the error.
>
>Thanks in advance,
>Mark
>
>---------------------------------------------------------------------
>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


Problem with a Stale link.

Posted by Mark Alcocer Flores <su...@yahoo.com>.
My Dear Tapestry Users,

I have the following problem, I hope that you can help
me.
I have the following code:

<td class='normalcell' align='center'>
 <font class="normal">
  <a jwcid="@ActionLink" 
  listener="ognl: listeners.showAccountsSearch" 
  class="normallink">
   Seleccionar
  </a>
 </font>
</td>

public void showAccountsSearch(IRequestCycle cycle) {
 Protected page = (Protected)
cycle.getPage("AccountsSearch");
 page.setProperty("customer", ((CustomerData)
getProperty("currentCustomer")));
 page.validate(cycle);
 page.activate(cycle);
}

with this direct link i am trying to call another
page. I have done ths many times in this way, but when
i click the link, I get the following error:

  You have clicked on a stale link.
  Action id 2 does not match component 
  CustomersSearch/$ActionLink$0.
  This is most likely the result of using your     
  browser's back button, but can also be an
application  
  error.
  You may continue by returning to the application's  
 
  home page.

I have seen this error many times, and it usually
meant that i was sending some null value. I have done
several things to look for the error, but this time I
have check my code and it seems that no null values
have been sent and I dont see where the error is. Can
some one suggest me what can I do or where can I look
for the error.

Thanks in advance,
Mark

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


Re: Override Validate or implement PageValidateListener?

Posted by Jim Frederic <ji...@isogen.com>.
Overriding .validate() can only be done on the page.
Any component can implement IPageValidateListener (even more than one 
per page), so this way you can have reusable, combinable 
component-specific validation logic.

-Jim

Vince Marco wrote:

> Well, could you at least indicate if there is any difference in 
> behavior between the 2 approaches. Overriding the method seems to be 
> working fine for me.  Is one way deprecated or are both methods valid?
>
> Can you indicate where Tapestry is going with this?  Is this direction 
> to indicate that implementing an interface is the general means of 
> adding behavior to objects in Tapestry?
>
> I know a lot of this is going to be in the book....but my projects 
> can't wait for the book.
>
> Thanks,
>
> Vince
>
> On Sunday, September 21, 2003, at 07:14  am, Howard M. Lewis Ship wrote:
>
>> You're seeing the evolution of the framework, that's all. We come up 
>> with new ideas, we implement
>> them, but we try to not completely break backwards compatibility.
>>
>>
>
>
> ---------------------------------------------------------------------
> 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


Re: Override Validate or implement PageValidateListener?

Posted by Vince Marco <vm...@mac.com>.
Well, could you at least indicate if there is any difference in 
behavior between the 2 approaches. Overriding the method seems to be 
working fine for me.  Is one way deprecated or are both methods valid?

Can you indicate where Tapestry is going with this?  Is this direction 
to indicate that implementing an interface is the general means of 
adding behavior to objects in Tapestry?

I know a lot of this is going to be in the book....but my projects 
can't wait for the book.

Thanks,

Vince

On Sunday, September 21, 2003, at 07:14  am, Howard M. Lewis Ship wrote:

> You're seeing the evolution of the framework, that's all. We come up 
> with new ideas, we implement
> them, but we try to not completely break backwards compatibility.
>
>


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


RE: Override Validate or implement PageValidateListener?

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
You're seeing the evolution of the framework, that's all. We come up with new ideas, we implement
them, but we try to not completely break backwards compatibility.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Perry Q Hertler [mailto:perry_hertler@yahoo.com] 
> Sent: Sunday, September 21, 2003 2:22 AM
> To: tapestry-user@jakarta.apache.org
> Subject: Override Validate or implement PageValidateListener?
> 
> 
> An excerpt from the current javadocs concerning the
> IPage.validate(IRequestCycle) method reads "Since 3.0,
> it is easiest to not override this method, but to
> implement the PageValidateListener interface instead."
> 
> Would someone explain why implementing
> PaveValidateListener is now the preferred approach?
> 
> Thanks,
> Perry
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design 
> software http://sitebuilder.yahoo.com
> 
> ---------------------------------------------------------------------
> 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