Good Morning Mansour
you will need to initialise your Ajax div tag with your own Placeholder
to quote the doc before asynchronously retrieving contents of href attribute
initialise your Div Tag with Placeholder data..
(in this example the Response from
href="http://www.weather.com/weather?zip=97239 will asynchornously populate
our Ajax Div 'weather' Tag )
<saf:div theme="ajax" id="weather"
href="http://www.weather.com/weather?zip=97239">
Placeholder...
</saf:div>
http://struts.apache.org/2.0.6/docs/ajax-div-template.html
You can also autopopulate the div tag based on any other control (we use
select) whos einteractions update a particular (listened) Topic e.g.
<saf:head theme="ajax" />
<script type="text/javascript">
function updateReports(id) {
var reportDiv= window['reportDivId'];
reportDiv.href = '/../reportListRemote.action?selectedId='+id;
reportDiv.bind();
}
dojo.event.topic.getTopic("updateReportsListTopic").subscribe(null,
"updateReports");
</script>/*dojo.event.topic.getTopic ties the 1st paramter of requested
topic to previously published topic of 'updateReportsListTopic'*//*The
subscribe 2nd param 'updateReports' indicates JS function to update when new
events are reported*/<form ... >
<saf:select .... onchange="javascript:
dojo.event.topic.publish("updateReportsListTopic", this.value); " />
<saf:div id="reportDivId" theme="ajax" href="/.../reportListRemote.action" >
Loading reports...
</saf:div>
</form>
HTH
M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed. If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy. Thank you.
----- Original Message -----
From: "Mansour" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, June 15, 2007 10:19 PM
Subject: Re: updating a DIV with ajax submit
I can see expected out put coming back. And when I view the page source
it's even there in the right place but not rendered on the browser!
On both FF and IE
Mansour wrote:
Seriously, no one can answer this one?
OK, the DIV is not updating at all now. Do i need to use JS to manually
set the content of the DIV ?
Shouldn't it update auto magically?
Mansour wrote:
I am able to submit, and I can see the results back. However, the
results are not inserted into the DIV and replacing the old contents.
It's inserted just before the old contents.
<div id="tasksDIV"><s:include value="tasks.jsp" /></div>
<s:submit type="image" src="/context/images/fdisk.gif"
href="%{ajaxSubmit}" theme="ajax" notifyTopics="/updateOrSave"
targets="tasksDIV" />
The new resulting page becomes like this
<div id="tasksDIV"> (The New Contents Here) <s:include value="tasks.jsp"
/></div>
Any idea?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]