You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ken in Nashua <kc...@live.com> on 2013/05/22 18:11:19 UTC

JQuery tab widget - page in tab - setupRender not being called

Folks,

I rigged up the JQuery tab widget... works great. But I am optimizing the code for healthy growth.

Generally I dont like just honking lines and lines of code into my template. With my tab widget, it has many tabs... so alot of code is anticipated to fall into the template. I am trying to avoid confusing code growth by setting it up with a referential block which will result in the embedded rendering of the page associated with each tab.

So I have this for any given tab... 

HOME.TML
            <t:jquery.tabs t:listTabData="prop:ALevel" t:activePanelId="aLevelTabsIndex" >
                <t:block t:id="tab00">    
                    <h3>add INFORMATION description here</h3>
                    <hr/>            
                </t:block>                
                
                <t:block t:id="tab01">
                    <h3>ROSTERS please select a team</h3>
                    <hr/>        
                    <t:delegate to="rosterQueryPage.rosterQueryMainBlock" />
                    
                    <t:block t:id="rosterQueryMainBlock">
                    </t:block>                        
                </t:block>
...
you get the idea...

Now this all works... BUT...

    rosterQueryPage.setupRender() is never being called.

To make this work... I have to initialize all my page variables and collections inside one of my property methods.

            public SelectModel getTeamSelectModel()
            {
                beanType = Player.class;
                SelectModelFactory selectModelFactory = new SelectModelFactoryImpl(adapter, valueEncoderSource);
                teams = new ArrayList(TynamoUTIL.loadCollection(hibernatePersistenceService, Team.class));
                if ( collection == null ) {
                    team = (Team) teams.get(0);
                    collection = team.getPlayers();
                }        
                return selectModelFactory.create(teams, "displayableName");
            }

Might anyone know why rosterQueryPage.setupRender() is never being called ?

The fact that  rosterQueryPage.setupRender() is not getting invoked like ti is suppose to has opened up a new can of worms to deal with. There is no base class involved with the page.

I have rigged up my RosterQueryPage into this tab component but tapestry is behaving as though it isnt even part of the fold. And setupRender doesnt get invoked. Might the Block have something to do with this? Is there a fix to this ?

Any tips are much appreciated.

thanks
 		 	   		  

Re: JQuery tab widget - page in tab - setupRender not being called

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 22 May 2013 13:11:19 -0300, Ken in Nashua <kc...@live.com>  
wrote:

> Folks,
>     rosterQueryPage.setupRender() is never being called.

This is expected, as RosterQueryPage isn't the one being rendered (or so I  
guess, the question itself is quite spare on details and I'm assuming  
you're renderting the Home page). Am I right? I'm not good as a psychic  
(maybe just because I don't believe in that kind of stuff . . .)

-- 
Thiago H. de Paula Figueiredo

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


Re: JQuery tab widget - page in tab - setupRender not being called

Posted by Lance Java <la...@googlemail.com>.
> call the other pages setupRender() methods directly.

What you are doing sounds really dodgy to me and against the tapestry
principles. Why aren't you using a component?

Re: JQuery tab widget - page in tab - setupRender not being called

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 23 May 2013 00:03:02 -0300, Ken in Nashua <kc...@live.com>  
wrote:

> Thanks Thiago...
>
> yes I am rendering Home.tml
>
> But it is rigged up with a two level nesting of tabs housing at least 6+  
> pages each.
>
> What do I do ?

You're probably @InjectPage'ing the other pages already, so, in the Home  
setupRender(), call the other pages setupRender() methods directly.

-- 
Thiago H. de Paula Figueiredo

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


RE: JQuery tab widget - page in tab - setupRender not being called

Posted by Ken in Nashua <kc...@live.com>.
Thanks Thiago...

yes I am rendering Home.tml

But it is rigged up with a two level nesting of tabs housing at least 6+ pages each.

What do I do ? 

When the selectValueEncoder gets called from the tml for my query form... I actually do my setupRender code there... but it feel kinda crooked doing it like that.

Dmitry's suggestion to use blocks to compose all the pages by referential connecting worked. It does reduce code bloat.

Can I do anything to make it better ?

Thanks

Ken
 		 	   		  

RE: JQuery tab widget - page in tab - setupRender not being called

Posted by Ken in Nashua <kc...@live.com>.
setupRender gets invoked (ever since I added public modifier)... 
but not until I clock GO for a submit event

and even after that I lose context of the whole JQuery tab... and my page RosterQuery comes into Home.tml and blows away the whole context of the JQueryTab only showing the RosterQuery page.

Not sure how I can retain context of the JQuery tabs after a submit event.
 		 	   		  

RE: JQuery tab widget - page in tab - setupRender not being called

Posted by Ken in Nashua <kc...@live.com>.
I noticed that my setupRender didnt have public

    @SetupRender
    public void setupRender() {

But after adding public ... it made no difference.

Still cannot get setupRender to invoke.

Thanks for any tips.

Ken