Hi,

In my application, Home Page creates DPanel and Dpanel has the drop down
menu.   In the class DPanel at 'onchange' event, I want to do some action
in the class HomePage.java. How can that be possible?


*HomePage.java*    public HomePage(final PageParameters parameters)
    {
        super(parameters);

        final Panel dropDownPanel = new Dpanel("toReplace");

        dropDownPanel.setOutputMarkupId(true);
        add(dropDownPanel);
    }


*DPanel.java*    public Dpanel(String aId)
    {
        super(aId);
        form = new Form<Void>("form");
        form.setOutputMarkupId(true);

        // SelectMenu //
        final DropDownChoice<String> dropdown = new
DropDownChoice<String>("select", new Model<String>(), new
ListModel<String>(GENRES));
        dropdown.setRequired(true);
        dropdown.setOutputMarkupId(true);
        dropdown.add(new AjaxFormComponentUpdatingBehavior("change") {
            /**
             *
             */
            private static final long serialVersionUID =
-6744838136235652577L;

            protected void onUpdate(AjaxRequestTarget target) {
                System.out.println("Changed");

            }
        });
.
.
.
.

Quick Start here...
https://github.com/Sibgha360/dropdownexample.git,

Reply via email to