On Fri, Nov 11, 2011 at 4:41 PM, wholalotta <[email protected]> wrote:
> Ok I am overriding the both methods but still cannot update the
> userCriteria..It always contains the
> the value that I selected first..
>
> new PropertyModel(criteria, "userCriteria")
>
>
> The whole code is as following;
>
> public class ListQuestionsPage extends AdminBasePage {
>
>    @SpringBean
>    UserDao dataDao;
>
>        private HashMap<String, String> criteriaMap= new HashMap<String, 
> String>();
>        Criteria criteria = new Criteria();
>
>        public ListUsersPage() {
>
>                final LoadableDetachableModel data= new 
> LoadableDetachableModel() {
>            @Override
>            protected Object load() {
>                List<Data> dataArrayList =  dataDao.findAll();
>                return dataArrayList;
>            }
>        };
>
>        final WebMarkupContainer listContainer = new
> WebMarkupContainer("listContainer");
>        add(listContainer);
>
>        List userFilter=new ArrayList();
>        userFilter.add("user1");
>        userFilter.add("user2");
>
>        add(new DropDownChoice("selectByUser", new PropertyModel(criteria,
> "userCriteria"),userFilter) {
>                @Override
>                protected boolean wantOnSelectionChangedNotifications() {
>                        return true;
>                }
>
>                @Override
>                protected void onSelectionChanged(Object newSelection) {
>                        criteriaMap.put("user",criteria.getUserCriteria());

You should use the new value here ^^


>                }
>
>        });
>
>        PageableListView userList = new PageableListView("userList",data
> ,10) {
>
>                        @Override
>                        protected void populateItem(final ListItem item) {
>                                final User user = (User) item.getModelObject();
>                                item.add(new Label("id", 
> Long.toString(user.getId())));
>                                item.add(new Label("user", 
> user.getUser().getUsername()));
>                                item.add(new Label("details", 
> user.getDetails()));
>                        }
>                };
>        listContainer.add(userList);
>        add(new PagingNavigator("navigator",questionList));
>        }
> }
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-model-is-not-updated-when-wantOnSelectionChangedNotifications-is-overriden-tp4031368p4031523.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

Reply via email to