I know a lot of people here hate frames, but sometimes they're useful so
I'll give you another option.

I'll sometimes create a Submit component with style="display:none;" so the
user can't see it.  Then you can use javascript to get a handle to the
button and call it's click() function.  I've got a webapp with the
navigation in an iframe.  When a user does something that requires changes
in the navigation, I make a javascript call to postback from there.

Alternatively, here's some javascript I have lying around to force a page to
the top window:

function CheckNesting() {
        var prevParent = window
        var parentWin = parent
        while (parentWin != null && parentWin != prevParent) {
                // use host for comparison because homepage is accessible
from multiple hrefs
                if (parentWin.location.host == window.location.host) {
                        parentWin.location.href = window.location.href //
refresh parent
                        return
                }
                prevParent = parentWin
                parentWin = parentWin.parent
        }
}

It'll still let your page be nested in some other site's frames, but not in
any frames on your own site (remove location.host comparison to change this
behavior).

-Steve

-----Original Message-----
From: Alin Simionoiu [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 31, 2006 6:19 PM
To: Tapestry users
Subject: Page structure best practices

Hi folks,

I'm trying to build a small website that will exercise some business  
logic. I looked around for some framework that will help me build the  
pages fast.
I choose Tapestry mainly because I can use the existing HTML pages as  
templates, really cool thing.

The first thing that I did was buying "Enjoy Web Development with  
Tapestry" read the thing and start cranking the code.
After two days of cranking I end up having the first problem,  
although I will have to say is more like a "what's the best practices  
for this".

My pages will have a header, a left side navigation panel and the  
main page. The left navigation panel controls what page i'm  
displaying, I say standard stuff.
My question is: how to I build the page Tapestry way?. I try at first  
to use frames. The navigation panel has a logout link and boom first  
problem. When I click on Logout I could not figure out how to go to  
main page and not just refresh the frame. Seems that only the left  
frame is loaded with the main page.
Checking the mailing list archive I read that people are recommending  
to move away from frames. Ok let's move away from frames. And do what?
I was thinking about some sort of include, I will put the left panel  
in a separate template and include it on all the other templates that  
needs it (like php smarty include). Again check the mailing list, and  
nope there's no include. There's RenderBlock but  I'm not sure it is  
what i need and really don't want to repeat the same html block in  
all the pages, yak

How do people solve this kind of problem?. what's the recommended  
way?. It seems to me that I would need to put the navigation panel in  
a component. Is this the right way, component?.
Do I inject the panel html page into the main page using Block/ 
RenderBlock?



Cheers,
Alin


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to