Hi Igor,

I thought i'd spelled out this issue fairly clearly, but here goes again. 
All of my pages use a layout along these lines:

http://tapestry.apache.org/tapestry5/guide/layout.html

Inside this component I have a login form.  This login form works on all
pages, except for a specific page called 'Confirmation'.  I use this page
slightly differently to the others by injecting it using @InjectPage,
setting a couple of properties on it, and then returning it:

@InjectPage
private Confirmation confirmation;

Object onSuccessFromQuestionForm() {
       //processing
        confirmation.setType(ConfirmationType.SUCCESS);
       confirmation.setMessage(Messages.get("question-submit"));

       return confirmation;
 } 

For some reason, the login form does not work on the Confirmation page, the
onSuccessFromLoginForm method that resides within my layout is simply never
called.  My hunch is that this issue is something to do with a nuance of the
@InjectPage annotation that causes the page to behave differently, but I'm
really not sure.

I hope this is clearer.


Igor Drobiazko wrote:
> 
> Your explanation is unclear. This way you never get an answer. Please be
> more precise and post more of your code.
> 
> On Mon, Jan 4, 2010 at 11:07 AM, lebenski <be...@gamesys.co.uk> wrote:
> 
>>
>> I have a layout component that contains a login form:
>>
>> <t:form t:id="loginForm">
>>        <t:textfield t:id="loginUsernameField" t:value="memberName"
>> height="30"/>
>>        <t:passwordfield t:id="loginPasswordField" t:value="password" />
>>        <t:submit id="loginSubmit" value="message:login"/>
>> </t:form>
>>
>> Page Class:
>>
>> Object onSuccessFromLoginForm() {
>>        try{
>>            loggedInMember = loginManager.logUserIn(new Login(memberName,
>> password));
>>        } catch(LoginException e) {
>>            //Login Error Processing
>>        }
>>
>>        return Index.class;
>> }
>>
>> I also have a generic confirmation page which I use for page flows where
>> I
>> need to present some message to the user.  For example "Thanks for
>> submitting a question"
>>
>> SubmitQuestion.java
>>
>> @InjectPage
>> private Confirmation confirmation;
>>
>> Object onSuccessFromQuestionForm() {
>>        //processing
>>        confirmation.setType(ConfirmationType.SUCCESS);
>>        confirmation.setMessage(Messages.get("question-submit"));
>>
>>        return confirmation;
>> }
>>
>> The confirmation template itself is inside the layout:
>>
>> <t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
>>        ${type}<br/>
>>        ${message}
>> </t:layout>
>>
>> However, for some reason I don't seem to have access to the layout from
>> this
>> confirmation page.  If I try to use the login form, the Index page is
>> loaded
>> but the user is not logged in.  In fact as far as I can see (through
>> debugging), the onSuccessFromLoginForm() method in the Layout is never
>> called.
>>
>> I'm at a bit of a loss as to why this is happening, as this is working on
>> all other pages in my application.  Is there some specific nuance of
>> using
>> @InjectPage that could be causing this issue?
>> --
>> View this message in context:
>> http://old.nabble.com/-T5.0.18--%40InjectedPage-does-not-have-access-to-it%27s-own-layout-tp27010913p27010913.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
> 
> 
> -- 
> Best regards,
> 
> Igor Drobiazko
> http://tapestry5.de/blog
> 
> 

-- 
View this message in context: 
http://old.nabble.com/-T5.0.18--%40InjectedPage-does-not-have-access-to-it%27s-own-layout-tp27010913p27025941.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to