problem with caching of pages in iframe(intersting problem)

Hi All,

I am facing an interesting problem in my project. I have a page which includes jspf and Iframe. The jspf has two links 慶onfiguration?and 慏etails?br>

The jspf (leftBar.jspf ) links are given below:

<f:subview id="leftBar">

<ui:hyperlink binding="#leftBar.configureLInk}"id="configureHyperlink"styleClass="menulink" target="centerFrame" text="Config" url="Config.jsp"/>

<ui:hyperlink binding="#leftBar.detailslLInk}"id="detailsHyperlink"styleClass="menulink" target="centerFrame" text="Details" url="Details.jsp"/>

</f:subview>

The page is as below:

<ui:body binding="#{test.body1}" id="body1" style="-rave-layout: grid" >

<ui:form binding="#{test.form1}" id="form1">

<div style="background-color:black;height: 430px; left: 0px; top: 124px; position:absolute; width: 150px" styleClass="lightGrayBg">

<jsp:directive.include file="/leftBar.jspf"/>

</div>

<divid="mydiv" style="background-color: yellow; left: 150; top: 124px;height: 430px; position: absolute">

<iframe height="431" name="centerFrame" width="853" src="default.jsp"id="myiframe" >Test...test..</iframe>

</div></ui:form></ui:body>

The 慍onfiguration?page consists of the text boxes where the user inputs the data. It consists of two textfield say name and the Telephone number.It also consists of two buttons to SAVE and CANCEL.

When the user enters the data and clicks on SAVE, The data is inserted into the database.

The problem arises when I click on the CANCEL button.

When the user clicks on the Configuration link the page displays the information entered by the user, getting it from the database.

Name: Myname

Tel No : 123456

When he changes the data in the textboxes

Name: YourName

Tel No: 98765

and clicks on the CANCEL button, it goes to the page (say default.jsp) given in the action of the button with out saving the data in the database. But when the user clicks on the 慍onfiguration?link once again he sees the data that the user has changed (not saved in the database).

Name: YourName

Tel No: 98765

When we look at the log messages that I have coded in the Prerender function to give the textbox values (getNameTextFiled.getText(), getTelnotextField.getText()) we can see the data is from the database (Myname, 123456), but in the UI we can see the changed data (not saved in the database). When I log out (end the session) and login again the correct data (Myname, 123456) is shown from the database. I am not able to figure out the cause for it. I tired in many ways to solve it but I and not able to do so.

Can anyone help me out to solve the issue?

[2813 byte] By [shannua] at [2007-11-27 3:59:15]
# 1
Could be a problem with refresh.You could try setting the textField to 'null' in the Prerender .Also, check using virtual forms for your app.. http://developers.sun.com/jscreator/reference/techart/2/virtual_forms.html
Rradhikaa at 2007-7-12 9:03:46 > top of Java-index,Development Tools,Java Tools...
# 2

Hi,

finally i got answer with the modifications

[u]in test page[/u]

Instead of this

<div id="mydiv" style="background-color: yellow; left: 150; top: 124px;height: 430px; position: absolute">

<iframe height="431" name="centerFrame" width="853" src="default.jsp" id="myiframe" >Test...test..</iframe>

</div></ui:form></ui:body>

put this

[b]

<div id="mydiv" style="background-color: yellow; left: 150; top: 124px;height: 430px; position: absolute">

<ui: iframe height="431" name="centerFrame" width="853" id="iframe1" url="default.jsp" id="myiframe" >Test...test..</ui:iframe>

</div>

[/b]

and in left bar.jspf

instead of this

The jspf (leftBar.jspf ) links are given below:

<f:subview id="leftBar">

<ui:hyperlink binding="#leftBar.configureLInk}"id="configureHyperlink" styleClass="menulink" target="centerFrame" text="Config" url="Config.jsp"/>

<ui:hyperlink binding="#leftBar.detailslLInk}"id="detailsHyperlink" styleClass="menulink" target="centerFrame" text="Details" url="Details.jsp"/>

</f:subview>

remove urls and targets

<ui:hyperlink binding="#leftBar.configureLInk}"id="configureHyperlink" styleClass="menulink" text="Config" onClick="configClick() " />

<ui:hyperlink binding="#leftBar.detailslLInk}"id="detailsHyperlink" styleClass="menulink" text="Details" onClick="detailClick()"/>

java script

function configClick(){

document.getElementById("form1:iframe1").src="config.jsp";

return false;

}

function detailClick(){

document.getElementById("form1:iframe1").src="detail.jsp";

return false;

}

so like this you can avoid page caching in iframe

with regards

ss

shannua at 2007-7-12 9:03:46 > top of Java-index,Development Tools,Java Tools...