Why is setupComponent called twice?

View: New views
7 Messages — Rating Filter:   Alert me  

Why is setupComponent called twice?

by oakstair :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

I have a layout component in which I have a method ...

@SetupRender
void setupComponent() {
    ...
}

For some reason this method is called twice for each page request.

Can anyone explain why?

Thanks in advance!
/Gunnar Eketrapp

Re: Why is setupComponent called twice?

by cordenier christophe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I already encounter this kind of problems using Firebug (which make a second
call to obtain JS of the current page)

Regards
Christophe.

2009/10/30 Gunnar Eketrapp <gunnar.eketrapp@...>

> Hi!
>
> I have a layout component in which I have a method ...
>
> @SetupRender
> void setupComponent() {
>    ...
> }
>
> For some reason this method is called twice for each page request.
>
> Can anyone explain why?
>
> Thanks in advance!
> /Gunnar Eketrapp
>

Re: Why is setupComponent called twice?

by oakstair :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

I uninstalled both Firebug and Web Developer but the method is still called
twice.

Must be some other issue ...

/Gunnar



2009/10/30 cordenier christophe <christophe.cordenier@...>

> Hi
>
> I already encounter this kind of problems using Firebug (which make a
> second
> call to obtain JS of the current page)
>
> Regards
> Christophe.
>
> 2009/10/30 Gunnar Eketrapp <gunnar.eketrapp@...>
>
> > Hi!
> >
> > I have a layout component in which I have a method ...
> >
> > @SetupRender
> > void setupComponent() {
> >    ...
> > }
> >
> > For some reason this method is called twice for each page request.
> >
> > Can anyone explain why?
> >
> > Thanks in advance!
> > /Gunnar Eketrapp
> >
>



--
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo

Re: Why is setupComponent called twice?

by cordenier christophe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well i cannot reproduce on 5.1.0.5.

Can you give more details on how you use/declare your layout component ?
If it contains other @AfterRender... annotations ?

Christophe

2009/10/30 Gunnar Eketrapp <gunnar.eketrapp@...>

> Hi!
>
> I uninstalled both Firebug and Web Developer but the method is still called
> twice.
>
> Must be some other issue ...
>
> /Gunnar
>
>
>
> 2009/10/30 cordenier christophe <christophe.cordenier@...>
>
> > Hi
> >
> > I already encounter this kind of problems using Firebug (which make a
> > second
> > call to obtain JS of the current page)
> >
> > Regards
> > Christophe.
> >
> > 2009/10/30 Gunnar Eketrapp <gunnar.eketrapp@...>
> >
> > > Hi!
> > >
> > > I have a layout component in which I have a method ...
> > >
> > > @SetupRender
> > > void setupComponent() {
> > >    ...
> > > }
> > >
> > > For some reason this method is called twice for each page request.
> > >
> > > Can anyone explain why?
> > >
> > > Thanks in advance!
> > > /Gunnar Eketrapp
> > >
> >
>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>

Re: Why is setupComponent called twice?

by oakstair :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

I found a very strange thing ...

I have and Index page that just redirects to another page ...

public class Index  {

    @InjectPage
    private com.tellpoker.pages.AboutUs about;

    public Object onActivate() {

        return about;
    }
}

... which was an attempt to change the default start page.

By some reason the about page gets fetched afer each page request ... but
not displayed.

So I have been living with this for some weeks without realising it.

When I removed my Index page everything was fine except for that I have no
default page. (a directory listing instead ...)

/Gunnar


2009/10/30 cordenier christophe <christophe.cordenier@...>

> Well i cannot reproduce on 5.1.0.5.
>
> Can you give more details on how you use/declare your layout component ?
> If it contains other @AfterRender... annotations ?
>
> Christophe
>
> 2009/10/30 Gunnar Eketrapp <gunnar.eketrapp@...>
>
> > Hi!
> >
> > I uninstalled both Firebug and Web Developer but the method is still
> called
> > twice.
> >
> > Must be some other issue ...
> >
> > /Gunnar
> >
> >
> >
> > 2009/10/30 cordenier christophe <christophe.cordenier@...>
> >
> > > Hi
> > >
> > > I already encounter this kind of problems using Firebug (which make a
> > > second
> > > call to obtain JS of the current page)
> > >
> > > Regards
> > > Christophe.
> > >
> > > 2009/10/30 Gunnar Eketrapp <gunnar.eketrapp@...>
> > >
> > > > Hi!
> > > >
> > > > I have a layout component in which I have a method ...
> > > >
> > > > @SetupRender
> > > > void setupComponent() {
> > > >    ...
> > > > }
> > > >
> > > > For some reason this method is called twice for each page request.
> > > >
> > > > Can anyone explain why?
> > > >
> > > > Thanks in advance!
> > > > /Gunnar Eketrapp
> > > >
> > >
> >
> >
> >
> > --
> > [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> > Allévägen 2A, 132 42 Saltsjö-Boo
> >
>



--
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo

Component only invokes javascript correctly from BeginRender

by Jonathan O'Connor-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I have a strange problem. One of my colleagues found a javascript
library ajaxtabs from DynamicDrive.com, and he created a small component
wrapping its usage. His code makes use of @BeginRender to generate the
html. The last part of this generated html is a little script that
invokes the ajax tabs javascript.

I wanted to change the BeginRender code into MyTabs.tml instead.
Naturally, everything looks fine, and the generated html looks the same
as that explicitly written by the BeginRender method, but the java
script does not work properly. I suspect that it is throwing an
exception while running.

I also tried setting the javascript to run on DOMLoaded(), but that does
not work at all, from BeginRender, or .tml.

Is there any reason why it should work correctly with BeginRender
method, but not a .tml file?

Ciao,
Jonathan O'Connor

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Component only invokes javascript correctly from BeginRender

by Thiago H. de Paula Figueiredo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Em Mon, 02 Nov 2009 13:02:31 -0200, Jonathan O'Connor  
<ninkibah@...> escreveu:

> Hi,

Hi!

> I wanted to change the BeginRender code into MyTabs.tml instead.
> Naturally, everything looks fine, and the generated html looks the same  
> as that explicitly written by the BeginRender method, but the java  
> script does not work properly. I suspect that it is throwing an  
> exception while running.

@BeginRender methods are only invoked when the whole page is requested,  
not when a partial render (AJAX) is done. Anyway, putting that code in the  
component makes it more reusable.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...