Hi,

you'll need some javascript to do this.

your link (alink) will have to call some JS function which will check
for changed inputs and if there is such input just call
event.preventDefault() to prevent the request to the LinkPage.class

On Wed, 2008-09-03 at 11:40 -0700, liza6218 wrote:
> Hi,
> 
> I'm trying to figure out the following, any help will be apreciated.
> 
> I have a form with 3 TextFields , a DropDownChoice and  a save button , 
> and a BookmarkablePageLink in the page.  
> 
> I need to add a javascript confirm window to the Link whenever any input
> changed without save (submit).
> and remove the confirm window when the change is saved.
> 
> 
> public aPage() {
>         form = new Form("form");
> 
>       DropDownChoicequestion questions = new DropDownChoice("question", ...);
>         form.add(questions);
> 
>       TextField answer1 = new RequiredTextField("answer1");
>       TextField answer2 = new RequiredTextField("answer2");
>       TextField answer3 = new RequiredTextField("answer3");
> 
>       form.add(answer1);
>       form.add(answer2);
>       form.add(answer3);
> 
>       form.add(new Button("save") {
>             @Override
>             public void onSubmit() {
>                saveChanges();
>                //remove the confirm window
>           }
>        }
> 
>         add(form);
>       
>       BookmarkablePageLink alink = new BookmarkablePageLink("alink",
> LinkPage.class));
>       add(alink);
> }
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to