aspose file tools*
The moose likes Struts and the fly likes Tiles problem - forward to other page but all frame lost Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Tiles problem - forward to other page but all frame lost " Watch "Tiles problem - forward to other page but all frame lost " New topic
Author

Tiles problem - forward to other page but all frame lost

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 438
hi, good day,

i having a problem in tiles forward, this is my definition of tiles as follow:



description
-----------
the layout is start with header, and menu at bottom left and body at bottom right as show in mainlayoutwithmenu.jsp


this is my mainlayoutwithmenu.jsp



below is my struts config


and body page test.jsp show as follow :


my problem is when i click on body page , which have a button to forward to another page named as page2(testing purpose), then it give me the
whole page2 content but all the frame no more display , the expected result is when i click on the button which go another page , the menu, header,
should remain but only change the result in body.jsp which return page2.jsp , how cold i do this ?

many thanks for guidance
[ August 31, 2006: Message edited by: Nakata kokuyo ]
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
The problem is with your forward. You should not forward to a jsp file. Instead you should forward to a tiles definition. I would define my tiles something like this:


Then change your forward to use "Test2" instead of "/pages/test2.jsp".

- Brent
Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 438
brent, thank for correction, is that means if i have 100 different pages to go, then i must have 100 definitions ?

it look quite troublesome ..

let say if i have a navigation menu at bottom left just right beside body page, and this navigation menu look like this after i click on topheader

- link 1
- item 1 for link1
- item 2 for link1
- link 2
- link 3

while user have just click on "item1 for link1", it suppose look like open tree which displaying "item1 for link1" and "item2 for link2", when i forward to another definition, the navigation menu will be display in close tree(no display for item1 and item2 for link1), in this case, how i solved the problem ?

2. is it possible i can pass parameters while forwarding to another definition ?

3. if i have 10 modules, and each module have 10 pages, will you keep all these definition in single tile-def.xml ?

thanks again for enlighten me
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Yea, I guess 100 pages = 100 definitions. I am not sure about your tree issue. The navigation tree that I have used (some inexpensive commercial product named COOLjsTreePRO) uses cookies to remember its state. I am not sure about #3...I have never used modules.

- Brent
Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 438
hi, brent , i thinking of use dynamic menu as mentioned in this link where the menu(tree) generated based on db ,

http://demo.raibledesigns.com/struts-menu/dynamicMenu.jsp

can i know how you pass cookie from tiles ?
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
I am not sure. A designer picked the navigation tree named COOLjsTree (http://javascript.cooldev.com/scripts/cooltree/). It supports saving the tree state in cookies, but I am not exactly sure how it does so.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tiles problem - forward to other page but all frame lost