Search code examples
javaapachewicketdropdownchoice

DropDownChoice wicket get value


so I have my DropDownChoice in Wicket:

final DropDownChoice drop_down_status = new DropDownChoice<String>("status", new PropertyModel<String>(this,"selected_status"), STATUS_LIST);

     form.add(drop_down_status);

How to get the selected value? I have to get it after another button is pressed and prepare sql statement from it.

drop_down_status.getRawInput() and drop_down_status.getInput() return null ( at least in my case).

cheers


Solution

  • Wicket updates "selected_status" value "on the fly".

    new PropertyModel<String>(this,"selected_status")
    

    so its enough to get value from Model value :)