Re: drop down problem
thanks martin it worked On Sat, Mar 27, 2010 at 3:24 PM, Martin Makundi wrote: > ajax link does not submit form.. use submitlink or ajaxbutton > > ** > Martin > > 2010/3/27 chinedu efoagui : >> Hello all, >> I have this dropdown that shows up a list of employee see code below >> >> >> public EmployeeDropDownChoice(String id,IModel model,IModel model2){ >> >> super(id,model,model2); >> final ChoiceRenderer renderer = new ChoiceRenderer("fullname", "id"); >> >> setChoiceRenderer(renderer); >> List emps=Collections.EMPTY_LIST; >> try { >> emps = dao.getPersonnelrecordsEmployeeList(); >> } catch (GenericBusinessException ex) { >> >> Logger.getLogger(EmployeeDropDownChoice.class.getName()).log(Level.SEVERE, >> null, ex); >> } >> setChoices(emps); >> } >> >> >> 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?? >> >> 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); >> >> >> - >> 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 > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: drop down problem
ajax link does not submit form.. use submitlink or ajaxbutton ** Martin 2010/3/27 chinedu efoagui : > Hello all, > I have this dropdown that shows up a list of employee see code below > > > public EmployeeDropDownChoice(String id,IModel model,IModel model2){ > > super(id,model,model2); > final ChoiceRenderer renderer = new ChoiceRenderer("fullname", "id"); > > setChoiceRenderer(renderer); > List emps=Collections.EMPTY_LIST; > try { > emps = dao.getPersonnelrecordsEmployeeList(); > } catch (GenericBusinessException ex) { > > Logger.getLogger(EmployeeDropDownChoice.class.getName()).log(Level.SEVERE, > null, ex); > } > setChoices(emps); > } > > > 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?? > > 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); > > > - > 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
drop down problem
Hello all, I have this dropdown that shows up a list of employee see code below public EmployeeDropDownChoice(String id,IModel model,IModel model2){ super(id,model,model2); final ChoiceRenderer renderer = new ChoiceRenderer("fullname", "id"); setChoiceRenderer(renderer); List emps=Collections.EMPTY_LIST; try { emps = dao.getPersonnelrecordsEmployeeList(); } catch (GenericBusinessException ex) { Logger.getLogger(EmployeeDropDownChoice.class.getName()).log(Level.SEVERE, null, ex); } setChoices(emps); } 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?? 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); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org