0

how to reset paging in grid

asked 2013-08-16 10:57:00 +0800

ezywinter729 gravatar image ezywinter729
11 1

i m having grid problem on paging unable reset back to first page during i on search with passing parameter research again. But when using listbox setSelectedItem it can reset back to first page. any solution how to reset paging in grid. i m using MVVM. below is my code.

@Command
@NotifyChange("allItems")
public void search(@BindingParam("data")Purpose selectedItem){

    Search srch = new Search();
    srch.setSearchBy(SearchBy);
    srch.setSearchValue(keyword==null?"":keyword);
    allItems = new ListModelList<Itm>(new itmModel().listPurpose(srch)); 
    allItems.addToSelection(allItems.get(0));
}
delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-08-19 04:27:33 +0800

cor3000 gravatar image cor3000
6280 2 7

you can bind the "activePage" attribute of your <grid>

<grid model="@bind(vm.allItems)" activePage="@bind(vm.activePage)" ... >

and in you search method reset to 0 together with using @NotifyChange

@Command
@NotifyChange({"allItems", "activePage"})
public void search(@BindingParam("data")Purpose selectedItem){
    ...
    activePage = 0;

}

link publish delete flag offensive edit

Comments

Thank You cor3000. problem solved.

ezywinter729 ( 2013-08-19 06:24:47 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-08-16 10:57:00 +0800

Seen: 28 times

Last updated: Aug 19 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More