ajax link does not submit form..  use submitlink or ajaxbutton

**
Martin

2010/3/27 chinedu efoagui <chinedub...@gmail.com>:
> Hello all,
>  I have this dropdown that shows up a list of employee see code below
>
> <code>
>  public EmployeeDropDownChoice(String id,IModel model,IModel model2){
>
>        super(id,model,model2);
>        final ChoiceRenderer renderer  = new ChoiceRenderer("fullname", "id");
>
>        setChoiceRenderer(renderer);
>        List<PersonnelrecordsEmployee> emps=Collections.EMPTY_LIST;
>        try {
>            emps = dao.getPersonnelrecordsEmployeeList();
>        } catch (GenericBusinessException ex) {
>            
> Logger.getLogger(EmployeeDropDownChoice.class.getName()).log(Level.SEVERE,
> null, ex);
>        }
>        setChoices(emps);
>    }
> </code>
>
> Now in the panel/form when i call it since the form uses a
> CompoundPropertyModel I declare the dropdown like this
>  final EmployeeDropDownChoice forwardofficer=new
> EmployeeDropDownChoice("forwardofficer",new Model(),new Model(""));
>      to avoid compoundpropertymodel issues is the EmployeeDropdown is
> not a member of the backing object of the form.
> NOw this is the problem
>
> when i try to get the defaultmodelobject from the Employeedropdown it
> give me null.
> How do i retrieve the selected choice from the Employeedropdown??
> <code>
>  final AjaxFallbackLink forwardbutton=new AjaxFallbackLink("forwardbutton") {
>                   �...@override
>                public void onClick(AjaxRequestTarget art) {
>
>                   final LeaveappEmpleaveApprovalOfficers
> leaveappOfficerss=new LeaveappEmpleaveApprovalOfficers();
>                    leaveappOfficerss.setEmpleaveIdLeaveappEmpleave(selected);
>                    //PersonnelrecordsEmployee
> zaemployeee=(PersonnelrecordsEmployee)forwardofficer.getDefaultModelObject();
>                    //System.out.println("personnel
> id:"+zaemployeee.getFullname() );
>                    System.out.println("personnel
> id:"+forwardofficer.getDefaultModelObject());
>                    try {
>
> dao.addLeaveappEmpleaveApprovalOfficers(leaveappOfficerss);
>                       </code>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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

Reply via email to