개발햄비

[wicket] wicket button javascript 転送の例 본문

개발/wicket

[wicket] wicket button javascript 転送の例

개발햄 2019. 2. 16. 17:12



<form wicket:id="form">
<input type="submit" value="non wicket submit button" />
<input wicket:id="button1" type="submit" value="default wicket button" />

</form>


    // Add a form with an onSubmit implementation that sets a message
    Form form = new Form("form") {
        protected void onSubmit() {
            info("Form.onSubmit executed");
        }

    };


AjaxButton testBtn=new AjaxButton("button1") {
        protected void onSubmit(AjaxRequestTarget target, Form form) {

//ターゲットからjavaScriptを投げます。

              target.appendJavaScript("alert('update complete!');");
     
         
        }
 
    };
form.add(testBtn);


    

  add(form);



'개발 > wicket' 카테고리의 다른 글

[wicket] radioGroup 例  (0) 2019.03.19
[wicket] wicket button 例  (0) 2019.02.16
[wicket]wicket ラジオ、radio使い方、例  (0) 2019.01.27