Two Laptop Bag*
The moose likes Struts and the fly likes Using Tiles and html:img tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Using Tiles and html:img tag" Watch "Using Tiles and html:img tag" New topic
Author

Using Tiles and html:img tag

Adrian Marrero
Greenhorn

Joined: Oct 23, 2007
Posts: 10
Hi,

I have a tiles layout with three tiles

----------------------
| | | |
| | | |
| 1 | 2 | 3 |
| | | |
----------------------

Tile 1 - is a static navigation page (never changes)
Tile 2 - is a dynamic page that gets its information from the action class and sets properties in the corresponding bean.

I would like to have an image link (html:img) that would pass a bean property to tile 3 to display there, while still being able to have the information originally on tile 2 display with the updated information on tile 3

Tile 3 (intended purpose) - Initially blank when html:img link is pressed information sent from link is displayed on this tile.

Is this at all possible? or does anyone have a suggestion on how to accomplish a similar goal? Thank you in advance for your assistance.
Chris Boldon
Ranch Hand

Joined: Aug 10, 2006
Posts: 190
Use AJAX
Adrian Marrero
Greenhorn

Joined: Oct 23, 2007
Posts: 10
Ok I learned how to use AJAX to generate information without reloading the entire page. But that information is in tile 2; how can I get the information that I have from tile 2 to be displayed in tile 3?
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Could you describe what you are trying to accomplish in more detail?

- Brent
Adrian Marrero
Greenhorn

Joined: Oct 23, 2007
Posts: 10
Sure,

I have a page called customize.jsp which is populated by a bean that I call DatabaseItn.

When the initial page of customize.jsp is populated, the information from the bean is present and so the page is populated with the information of the bean; this page/information is located in Tile 2. I have help icons throughout the page that I am displaying with html:img tag.

What I was able to try:

When a user clicks on the help icon, I use struts to process the command and display the information on Tile 3, but all the information from the bean that used to be in Tile 2 is not present anymore. This is because I only selected the property from the bean that referred to the help icon I wanted to thus all other bean information was lost.

What I would like to do is the following:

When a user clicks on the help icon, information is retrieved from the active bean on the page and displayed in Tile 3 while still maintaining all the information that was in the bean initially, so I can display it in Tile 2 with customize.jsp.

I was told to use AJAX, but I have not seen an example of AJAX that updates information to a different page. My understanding of AJAX is that it talks to the servlet and updates information on a page (lets say customize.jsp in Tile 2) without reloading the entire Tile Layout, but I do not know yet of a way to use AJAX to take the information from customize.jsp, talk to the servlet and update that information on the page for Tile 3.

I hope that I have explained myself enough. If I haven't, please let me know and I will try again.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Using Tiles and html:img tag