Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

clicking Ajax SubmitLink button called submit method twice

$
0
0
Hello everyone,

submit method called more than one time trigering two modalWindows to open
at the same time.

See snippet below. If I put the just only modal.show(target) in the
onsubmit method and others in Page constuctor, the problem still persist.

I am using version 6.16.

What am I doing wrong here? I will appreciate better way of doing this.

AjaxSubmitLink addButton = new AjaxSubmitLink("addButton") {
@Override
public void onSubmit(AjaxRequestTarget target, Form form) {
// your stuff
if (target != null) {
Object obj= new Object();
Object Panel panel = new
ObjectPanel(modalWindow.getContentId(), object);
modalWindow.setContent(panel);
modalWindow.setTitle("New Object");
//modalWindow.setEnabled(true);
//modalWindow.showUnloadConfirmation(true);

modalWindow.show(target);
System.out.println("\n\nI am called
1111111111111111111111111111111" + target.getLastFocusedElementId());

};

Form form = new Form("form");

form.add(modalWindow);
form.add(addButton);

Thank you.

Ajayi S . Yinka
+2348022684477

Viewing all articles
Browse latest Browse all 5648

Trending Articles