PagingNavigator inside repeater

2013-10-04 Thread Francisco Saez
Hi all,

I have a list of elements wich a sub-list of elements for each of them.
For example:
* Category 1
   - Element 1.1
   - Element 1.2
*Category 2
   - Element 2.1
   - Elemnt 2.2

I have no problmes when I try to paginate the root list of elements (in the 
example, categories). But when I try to paginate each sub-list I have some 
problems. Links appear with correct page number, but nothing happen when I 
click they.

I've tried with PaginNavigator and also with AjaxPagingNavigartor (with a 
WebMarkupContainer). Here is the code:

div wicket:id=categories
div wicket:id=cat_titleCategory title/div

div wicket:id=container
table
tbody
   tr wicket:id=achievements
 tdspan wicket:id=nameTest Name/span/td
   /tr
/tbody
/table

div wicket:id=navigator/div
/div
/div

div wicket:id=navigator0/div

-

final HashMapLong, ListAchievement achievementsMap = 
projectLogic.getAchievements();

PageableListViewCategory categoriesListView = new 
PageableListViewCategory(categories, projectLogic.getCategories(), 5) {

@Override
protected void populateItem(ListItemCategory item) {
final Category category = (Category) item.getModelObject();

//title
item.add(new Label(cat_title, category.getDescription()));

WebMarkupContainer wmc = new WebMarkupContainer(container);
item.add(wmc);

//achievements list
PageableListViewAchievement achievementsListView = new 
PageableListViewAchievement(achievements, 
achievementsMap.get(category.getId()), 5) {

@Override
protected void populateItem(ListItemAchievement item) {
final Achievement achievement = (Achievement) 
item.getModelObject();

Label l = new Label(name, achievement.getDescription());
item.add(l);

}
};
wmc.add(achievementsListView);

//navigator
PagingNavigator pn = new AjaxPagingNavigator(navigator, 
achievementsListView);
wmc.add(pn);
}
};
add(categoriesListView);

add(new PagingNavigator(navigator0, categoriesListView));

-

Any idea of what is happening?? 

Thanks in advance and regards.
   
  

Re: PagingNavigator inside repeater

2013-10-04 Thread Martin Grigorov
Hi,


On Fri, Oct 4, 2013 at 1:05 PM, Francisco Saez fras...@hotmail.com wrote:

 Hi all,

 I have a list of elements wich a sub-list of elements for each of them.
 For example:
 * Category 1
- Element 1.1
- Element 1.2
 *Category 2
- Element 2.1
- Elemnt 2.2

 I have no problmes when I try to paginate the root list of elements (in
 the example, categories). But when I try to paginate each sub-list I have
 some problems. Links appear with correct page number, but nothing happen
 when I click they.

 I've tried with PaginNavigator and also with AjaxPagingNavigartor (with a
 WebMarkupContainer). Here is the code:

 div wicket:id=categories
 div wicket:id=cat_titleCategory title/div

 div wicket:id=container
 table
 tbody
tr wicket:id=achievements
  tdspan wicket:id=nameTest Name/span/td
/tr
 /tbody
 /table

 div wicket:id=navigator/div
 /div
 /div

 div wicket:id=navigator0/div

 -

 final HashMapLong, ListAchievement achievementsMap =
 projectLogic.getAchievements();

 PageableListViewCategory categoriesListView = new
 PageableListViewCategory(categories, projectLogic.getCategories(), 5) {

 @Override
 protected void populateItem(ListItemCategory item) {
 final Category category = (Category) item.getModelObject();

 //title
 item.add(new Label(cat_title, category.getDescription()));

 WebMarkupContainer wmc = new WebMarkupContainer(container);
 item.add(wmc);

 //achievements list
 PageableListViewAchievement achievementsListView = new
 PageableListViewAchievement(achievements,
 achievementsMap.get(category.getId()), 5) {

 @Override
 protected void populateItem(ListItemAchievement item) {
 final Achievement achievement = (Achievement)
 item.getModelObject();

 Label l = new Label(name, achievement.getDescription());
 item.add(l);

 }
 };
 wmc.add(achievementsListView);

 //navigator
 PagingNavigator pn = new AjaxPagingNavigator(navigator,
 achievementsListView);


See 
org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator#onAjaxEvent
Repeaters cannot be updated with Ajax and that's why their parent is
repainted.
Just add: wmc.setOutputMarkupId(true)


 wmc.add(pn);
 }
 };
 add(categoriesListView);

 add(new PagingNavigator(navigator0, categoriesListView));

 -

 Any idea of what is happening??

 Thanks in advance and regards.




Re: PagingNavigator inside repeater

2013-10-04 Thread frasese
Tested and working...

Thanks a lot



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PagingNavigator-inside-repeater-tp4661701p4661703.html
Sent from the Users forum mailing list archive at Nabble.com.

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