Thanks for all your help!
I tried changing the href of the div on button click but that doesn't
work. How I finally managed to do this was by passing a hidden form
field to action. The action only executes when the form field has a set
value. So on page load the Action doesn't get this value and the div jsp
doesn't get it and displays nothing.

What I was doing wrong was that my Form had a name parameter, the form
must have an id parameter to pass form fields. Also, my Action class
also behaves like a form bean, it needs to have a getter and setter for
the form fields.

As I said, new to Struts 2 and got all confused.

Thanks again,
Regards,
Sayali.
 
-----Original Message-----
From: Roger [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 29, 2008 7:56 AM
To: Struts Users Mailing List
Subject: Re: Struts2 : Calling AJAX function on button click(ONLY)

On Tuesday 28 October 2008 20:01:41 Kanade, Sayali wrote:
> Thanks for your reply, but not sure it answers my question.
>
> My question is: How can I prevent a div from refreshing its contents
on
> page load? The div should only be refreshed on button click.
>
> My problem is that, my div loads on page load. It also reloads on
submit
> button click, but it should ONLY load on submit click, not on page
load.
>
> The action that executes in my div has to be only executed after the
user
> selects a checkbox and clicks submit.
>
> Please help, I have browsed for this answer for hours!!!
>

You could tryusing a Javascript function to set your div to
"display:none" on 
page load and re-set it when you want to display it.

---------------------------------------------------------------------
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]

Reply via email to