Prevent an 'iframe' in a JSF page to refresh when a button is clicked

Prevent an 'iframe' in a JSF page to refresh when a button is clicked

I have a JSF Page. On this page I have an

1)Iframe that ponts to another JSF page that contains a JSF tree(all sun studio components)

2)A button named 'ADD'

3)A listbox

When I select a node in the tree it gets stored in the session and when I click the ADD button the selected value is populated into the listbox.

Building the tree is a very costly(time consuming) operation. So whenever I click the ADD button it's action event in the backing bean runs and populates the listbox with the selected value.

The problem whenever the I click the ADD button a postback happens and so the whole page is reloaded including the iframe and the tree with in the firame. How can I prevent the tree in the iframe refreshing each time I click the ADD button.

Any workarounds/ help greatly appreciated.

Thanks.

[932 byte] By [RollaTomasi] at [2007-11-26 9:12:44]
# 1
Still not found an answer.....any ideas?
RollaTomasi at 2007-7-6 23:34:36 > top of Java-index,Development Tools,Java Tools...
# 2
Hi!Have You seen this tutorial? http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/vir tual_form.htmlMaybe it will be helpful for You.Thanks,Roman.
Grif at 2007-7-6 23:34:36 > top of Java-index,Development Tools,Java Tools...
# 3

I do't think Virtual forms solve this problem as clicking anything(firing action events) on the main page would force the page and all the componets to refresh and the as the ui:iframe points to another JSF page on which the tree is; that page is also being refreshed .

I also have added logic in the init method of the second page inwhich the tree is tocheck for postbacks. But I observed that :

A postback on the main page is not a post back to the second page

Thanks for your reply.

RollaTomasi at 2007-7-6 23:34:36 > top of Java-index,Development Tools,Java Tools...
# 4

changing the 'state_saving_method' property in the web.xml to server and this solves this issue but I have so many forms and whenever I click to open a new form they popup with the previously submitted values as their state is stored on the server and this is not a desirable.

So I have put the state back to client state.

Any other ideas?

RollaTomasi at 2007-7-6 23:34:36 > top of Java-index,Development Tools,Java Tools...