add AjaxSubmitButton to the form embedded inside the modal window:

 AjaxSubmitButton submit = new AjaxSubmitButton("submitSearch",
                AdvancedSearchForm.this) {


            @Override
            protected void onSubmit(AjaxRequestTarget target, Form form) {
                ModalWindow.close(target);

            }
        };

Crag wrote:
> sorry.
>
> An opener modalwindow has a form,  when  the form onSubmit( ) , I want to 
> refresh
> parent window , and close current window, how to do ?
>
>
>
> "Crag" <[EMAIL PROTECTED]> ???? news:[EMAIL PROTECTED]
>   
>> thanks Nili.
>>
>>
>> but   it's not my meaning.
>>
>> An open modalwindow has a form, when the form had been submmitted( where 
>> form onSubmit( )  I will do something here), I want to refresh
>> parent window , and close current window, how to do ?
>>
>>
>>
>>
>> "Nili Adoram" <[EMAIL PROTECTED]> ???? 
>> news:[EMAIL PROTECTED]
>>     
>>> in your panel:
>>>
>>>
>>> final ModalWindow modal;
>>> add(modal = new ModalWindow("modalAdvancedSearch"));
>>> add(new AjaxLink("openModal") {
>>>
>>>            @Override
>>>            public void onClick(AjaxRequestTarget target) {
>>>
>>>                modal.show(target);
>>>
>>>            }
>>>        });
>>>
>>> modal.setCloseButtonCallback(new ModalWindow.CloseButtonCallback() {
>>>
>>>            public boolean onCloseButtonClicked(AjaxRequestTarget target) 
>>> {
>>>                return true;
>>>            }
>>>        });
>>>
>>>        modal.setWindowClosedCallback(new
>>> ModalWindow.WindowClosedCallback() {
>>>
>>>            public void onClose(AjaxRequestTarget target) {
>>>
>>>                setResponsePage();
>>>            }
>>>        });
>>> Crag wrote:
>>>       
>>>> An open modalwindow, when the form had been submmitted, I want to 
>>>> refresh
>>>> parent window , and close current window, how to do ?
>>>>
>>>> the simple code:
>>>>
>>>> <html>
>>>>  <head></head>
>>>>  <body>
>>>>   <form wicket:id="nodeForm">
>>>>    <table>
>>>>     <tr>
>>>>      <td>
>>>>       <input wicket:id="name" type="text" />
>>>>      </td>
>>>>     </tr>
>>>>     <tr>
>>>>      <td >
>>>>       <input wicket:id="edit" type="submit" value="Add/Update"
>>>> onclick="return confirm('Are you sure you want to edit?')" />
>>>>      </td>
>>>>     </tr>
>>>>    </table>
>>>>   </form>
>>>>  </body>
>>>> </html>
>>>>
>>>>
>>>> public class EditModal extends WebPage {
>>>>  private static final long serialVersionUID = 1L;
>>>>
>>>>  public Tree0EditModal(final ModalWindowPage modalWindowPage, IModel 
>>>> model)
>>>> {
>>>>
>>>>   final NodeForm form = new NodeForm("nodeForm", model);
>>>>
>>>>   Button btnEdit = new Button("edit") {
>>>>    protected void onSubmit( ) {
>>>>     System.out.println("submit...........");
>>>>         // now I want to refresh parent window(modalWindowPage), and 
>>>> close
>>>> current window(EditModal), how to do ?
>>>>         //ModalWindow.close(target);
>>>>    }
>>>>   };
>>>>
>>>>   form.add(btnEdit);
>>>>   TextField name = new TextField("name");
>>>>
>>>>   form.add(name);
>>>>
>>>>   add(form);
>>>>  }
>>>>
>>>>  class NodeForm extends Form {
>>>>   private static final long serialVersionUID = 1L;
>>>>
>>>>   public NodeForm(String id, IModel model) {
>>>>    super(id, model);
>>>>   }
>>>>  }
>>>> }
>>>>
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.net email is sponsored by DB2 Express
>>>> Download DB2 Express C - the FREE version of DB2 express and take
>>>> control of your XML. No limits. Just data. Click to get it now.
>>>> http://sourceforge.net/powerbar/db2/
>>>> _______________________________________________
>>>> Wicket-user mailing list
>>>> Wicket-user@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>>>
>>>>
>>>>         
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by DB2 Express
>>> Download DB2 Express C - the FREE version of DB2 express and take
>>> control of your XML. No limits. Just data. Click to get it now.
>>> http://sourceforge.net/powerbar/db2/
>>>       
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/ 
>>     
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>   

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to