This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Learn Java with Math: Using Fun Projects and Games and have Ron Dai on-line!
See this thread for details.
Win a copy of Learn Java with Math: Using Fun Projects and Games this week in the Beginning Java forum!

Niall

Greenhorn
+ Follow
since Mar 22, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Niall

Hi,

I desperately need help with a problem I'm having using struts tiles. I have a menu with seven options in a file called 'menu.jsp'. This menu appears on the side of every page throughout my application. However, I now want to be able to change the colour of the text for whatever option is currently selected. I've tried using 'onclick' to change the colour of the text for the selected option but because the original colours are defined in 'menu.jsp', once the page reloads the original menu tile is displayed again (ie with no colour changes). I am trying to avoid writing a seperate menu tile for each menu option selected but can't see any other way round this problem. Am I trying to do the impossible?

Any help is appreciated. I'd like to know if anyone else has found a way around this.
13 years ago
Glad you got it sorted. Now, if only someone could help me!!

Anyone?
13 years ago
I don't think the forwards in your struts-config.xml should be forwarding to jsp pages - this defeats the purpose of using tiles. They should be forwarding to defined tiles and these tiles use your jsp pages, or in some cases they may forward to other actions in your struts-config.xml, eg.

<action...
....
.... />
<forward name="success" path="/login.do" />
</action>
13 years ago
I'm quite new to struts too but I think you're misunderstanding the purpose of the struts-config.xml and tiles-defs.xml files. Is that excerpt from your tiles-definitions file? All that stuff should be in your struts-config file. An excerpt from my struts-config.xml:



Then 'product.detail' is defined in tiles-deinfitions.xml as being an extension of the main layout, except with differing title and content value:



I've built my struts application up this way, by using my struts-config file to forward to various tiles depending on what has been selected, then defining these tiles as being extensions of one overall layout but with different jsp pages populating their content area. Hope this helps - it sounds like you need to read a bit more about struts tiles: courses.coreservlets.com/Course-Materials/pdf/struts/10-Struts-Tiles.pdf

Now, can anybody help me with my problem? (see first post in thread)
13 years ago
Hi,

I'm using tiles and have a menu tile with 7 options. I want to change the color of the text for whatever option has currently been selected. I'm trying to do this using 'onclick' to call a stylesheet format called 'optionOn', but have been unable to get this code to work:



I'm trying to avoid writing a separate verison of the tile for each option selected, which is the only alternative I can think of. Can anyone make any suggestions?

Any help appreciated.
[ March 27, 2006: Message edited by: Niall Mc Gurk ]
13 years ago
Hi there,

I have a menu bar which is displayed in a tile. This menu is fixed and displayed across all pages on the site. Now, I want to add a dot to the background to indicate which option has been selected. I've tried this code without success:



There are 7 of these colums with similar code. I'm trying to avoid writing a separate menu bar for each menu option clicked and I'm hoping that this can be done using 'onclick' (i've had t use 0nclick in the example to get round the problem of posting html code) to place an image behind a clicked option. Can anyone make any suggestions?

Any help appreciated.
Thanks.

[ March 22, 2006: Message edited by: Niall Mc Gurk ]
[ March 22, 2006: Message edited by: Niall Mc Gurk ]
13 years ago