You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alan Chandler <al...@chandlerfamily.org.uk> on 2005/09/11 08:02:52 UTC
Directlink listener not firing
I have a component with an embedded DirectLink in the template. The
component's java class has the listener. (These are both given lower down
this e-mail)
Debugging this application, I put a breakpoint on the doShowDetails method,
and try and see what happens.
I have the component embedded (as a first level component) in a list on the
home page, and clicking on the link it creates, causes the listener to fire
(I hit my breakpoint).
I also have the component embedded (several component levels down) inside the
Details page itself. When I click on the link that is created in this case,
the doShowDetails method never hits the breakpoint and the home page is
displayed.
Anyone any idea what I am doing wrong here - or indeed any tips on how to
debug .
The URLs created by the Direct Link both look similar, if slightly different
(I have friendly URLs set up with the .do extension as the state-less
extension for direct service)
URL from home page:-
<a href="/famtree/Home,$Surname.$DirectLink.do?sp=1"
class="surname">Chandler</a>
URL from details page:-
<a href="/famtree/Details,$FamilyList.$Children.$Child.$Surname.
$DirectLink.do?sp=3" class="surname">Chandler</a>
Template:-
<span jwcid="@DirectLink"
listener="listener:doShowDetails"
parameters="ognl:person.id"
class="surname"
><span jwcid="@Insert"
value="ognl:person.surname"
>Chandler</span></span>
Java class:-
package uk.org.chandlerfamily.tapestry.components;
import org.apache.tapestry.annotations.*;
import org.apache.tapestry.BaseComponent;
import org.apache.tapestry.IPage;
import uk.org.chandlerfamily.sqlmap.famtree.PersonSummary;
import uk.org.chandlerfamily.tapestry.famtree.Details;
@ComponentClass
public abstract class Surname extends BaseComponent {
@Parameter
public abstract PersonSummary getPerson();
@InjectPage("Details")
public abstract Details getDetailsPage();
public IPage doShowDetails(int personId) {
Details details = getDetailsPage();
details.setPersonId(personId);
return details;
}
}
There is NO component specification.
--
Alan Chandler
http://www.chandlerfamily.org.uk
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Directlink listener not firing
Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Sunday 11 September 2005 07:02, Alan Chandler wrote:
> I have a component with an embedded DirectLink in the template. The
> component's java class has the listener. (These are both given lower down
> this e-mail)
>
> Debugging this application, I put a breakpoint on the doShowDetails method,
> and try and see what happens.
>
> I have the component embedded (as a first level component) in a list on the
> home page, and clicking on the link it creates, causes the listener to fire
> (I hit my breakpoint).
>
> I also have the component embedded (several component levels down) inside
> the Details page itself. When I click on the link that is created in this
> case, the doShowDetails method never hits the breakpoint and the home page
> is displayed.
I have just managed to solve the issue. I also implement PageValidate - and
what was happening was that when the direct link is called from within the
page, this page validate routine is called twice. Unfortunately the check
that page validate does is on the validity of the parameter that should be
passed, and failed the check on the first call and threw a page exception to
the home page.
--
Alan Chandler
http://www.chandlerfamily.org.uk
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org