Re: alphabetical paging navigator

2010-10-01 Thread Igor Vaynberg
it wouldnt be worth overriding one, you are better off creating one
from scratch.

listview and paging navigator are decoupled, so you can use your own
impl to page the listview without problems.

-igor

On Thu, Sep 30, 2010 at 10:21 PM, elesi jsar...@gmail.com wrote:

 is it possible to override the PagingNavigator and give it the letters A-Z as
 links? and add filtering behavior so that it only shows ListView items that
 starts with/matches the active letter link?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/alphabetical-paging-navigator-tp2837010p2837010.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



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



Re: alphabetical paging navigator

2010-10-01 Thread elesi

can you give an idea on how to do that?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/alphabetical-paging-navigator-tp2837010p2853331.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



Re: alphabetical paging navigator

2010-10-01 Thread Mathias Nilsson

This can be implemented in a better way. See source code for navigation in
wicket. But here is a simple example

// Create a panel 

import java.util.LinkedList;
import java.util.List;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;

public abstract class AlphabeticalPanel extends Panel{
private static final long serialVersionUID = 1L;

public AlphabeticalPanel(String id) {
super(id);

IModelListString alphabeticalModel = new
LoadableDetachableModelListString(){
private static final long serialVersionUID = 1L;

@Override
protected ListString load() {
ListString alphabet = new 
LinkedListString();
char letter;
for(letter = 'A'; letter = 'Z'; letter++) {
alphabet.add(  + letter );
}
return alphabet;
}

};

ListViewString alphabeticalView = new ListViewString(
alphabeticalView,alphabeticalModel ){
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItemString item) {
final String character = item.getModelObject();
AjaxLinkVoid link = new AjaxLinkVoid( 
link ){
private static final long 
serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget 
target) {

onCharacterClicked(character,target);
}
};

link.add( new Label( character , character ));
item.add( link );
}

};

add( alphabeticalView );
}

public abstract void onCharacterClicked( String character,
AjaxRequestTarget target );

}


// Add the panel to a page

add( new AlphabeticalPanel( panel ){
private static final long serialVersionUID = 1L;

@Override
public void onCharacterClicked(String 
character,AjaxRequestTarget target)
{
// Here you get the char. Get the data from 
database and add another
view with the data

}
});
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/alphabetical-paging-navigator-tp2837010p2859832.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



alphabetical paging navigator

2010-09-30 Thread elesi

is it possible to override the PagingNavigator and give it the letters A-Z as
links? and add filtering behavior so that it only shows ListView items that
starts with/matches the active letter link?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/alphabetical-paging-navigator-tp2837010p2837010.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