Hello,

Yes, it is dynamic.

Here is the complete code (html and java):

==My test bean==

public class TestBean implements Serializable{

        /**
         * 
         */
        private static final long serialVersionUID = 1L;
        
        
        private String name;
        private String code;
        private Integer id;
        public String getName() {
                return name;
        }
        public void setName(String name) {
                this.name = name;
        }
        public String getCode() {
                return code;
        }
        public void setCode(String code) {
                this.code = code;
        }
        public Integer getId() {
                return id;
        }
        public void setId(Integer id) {
                this.id = id;
        }

}

==HTML page==

<!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; >
<html xmlns="http://www.w3.org/1999/xhtml";
xmlns:wicket="http://wicket.apache.org/"; lang="en" xml:lang="en">
<body>
<wicket:extend>
        <form wicket:id="testForm">
                

                        

                                        Name:
                                        
                                        <input wicket:id="txtName" size="80"/>
                                
                        
                        

                                        
                                         <img src="images/lupa.gif" 
name="btnSave" /> <#>  
                                
                        
                

        </form>
</wicket:extend>
</body>
</html>

==JAVA code==
public class TestPage extends Page {

        private static final long serialVersionUID = 311508940740808005L;
        private static final Logger logger = 
LogManager.getLogger(TestPage.class);
        private ReturnObjectPage returnPage = null;

        public TestPage(IModel<TestBean> model, final ReturnObjectPage 
returnPage)
{
                super(model);
                this.returnPage = returnPage;

                add(new TestForm("testForm", model));

        }

        class TestForm extends Form<TestBean> {
                /**
                 * 
                 */
                private static final long serialVersionUID = 1L;

                public TestForm(String id, IModel<TestBean> model) {
                super(id, model);
                
                TextField<String> txtName = new TextField<String>("txtName", new
PropertyModel<String>(getDefaultModel(), "name"));
                add(txtName);
                
                AjaxLink<TestBean> testLink = new AjaxLink<TestBean>("testLink",
getModel())
                {
                        /**
                         * 
                         */
                        private static final long serialVersionUID = 1L;

                        @Override
                        public void onClick(AjaxRequestTarget target) {
                                        System.out.println("ajax in");
                                        System.out.println("test name= " + 
getModelObject().getName());
                        }

                };
                
                        add(testLink);
                }
                }
        

}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxLink-cannot-see-updated-model-values-tp4675743p4675746.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to