AjaxPagingNavigation change style

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

AjaxPagingNavigation change style

Ivoneta
Hello everyone.

I need to change the wicket navigator style. I read in previous posts the solution to this so  I created my own subclass AjaxPagingNavigatorModified:

public class AjaxPagingNavigatorModified extends AjaxPagingNavigator{

    public AjaxPagingNavigatorModified(String id, DataView<?> dataView){
        super(id,dataView);
    }
}

And then I created my own markup AjaxPagingNavigatorModified.html

<html xmlns:wicket>
<body>

  <wicket:panel>
        <wicket:message key="First"/> <wicket:message key="Previous" />
   
                  5
   

    <wicket:message key="next"/> <wicket:message key="LastPage"/> 
  </wicket:panel>
</body>
</html>

I placed both of them in the same directory, but it doesn't work. The wicket navigator has the default style.

What I missing? What's wrong?

Can anyone help me?
Pleaseeeeee
Reply | Threaded
Open this post in threaded view
|

Re: AjaxPagingNavigation change style

Ivoneta
ohh I see the problem. I used a markup for AjaxPagingNavigator, but it doesn't have one. The markup is for PagingNavigator.
I need to use AjaxPagingNavigator, so I implemented my own class MyAjaxPagingNavigator - copying exactly the same AjaxPagingNavigator code - and then I create a subclass from PagingNavigator, and create the markup.  MyAjaxPagingNavigator extends from my own PagingNavigator subclass. But I have a problem my own class doesn't work...If I clicked to next page, the entire page is refresh,   I don't understand why?

Is there another solution to change the AjaxPagingNavigation Style?
Reply | Threaded
Open this post in threaded view
|

Re: AjaxPagingNavigation change style

Fernando Wermus-3
Ivonetta,
    If you wanna change the styles, you can also add an id attribute to
AjaxPaginavigator and use style css in the way:

#myPageN

{
   your style
}

in this way you would not have to overwrite the markup. It is easier.


On Wed, Jul 21, 2010 at 5:50 PM, Ivoneta <[hidden email]> wrote:

>
> ohh I see the problem. I used a markup for AjaxPagingNavigator, but it
> doesn't have one. The markup is for PagingNavigator.
> I need to use AjaxPagingNavigator, so I implemented my own class
> MyAjaxPagingNavigator - copying exactly the same AjaxPagingNavigator code -
> and then I create a subclass from PagingNavigator, and create the markup.
> MyAjaxPagingNavigator extends from my own PagingNavigator subclass. But I
> have a problem my own class doesn't work...If I clicked to next page, the
> entire page is refresh,   I don't understand why?
>
> Is there another solution to change the AjaxPagingNavigation Style?
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/AjaxPagingNavigation-change-style-tp2297188p2297746.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Fernando Wermus.

www.linkedin.com/in/fernandowermus
Reply | Threaded
Open this post in threaded view
|

Re: AjaxPagingNavigation change style

blauerberg
In reply to this post by Ivoneta
Ivoneta,

> MyAjaxPagingNavigator extends from my own PagingNavigator subclass.
> But I have a problem my own class doesn't work...If I clicked to next page, the entire page is refresh,

because AjaxPagingNavigationBehavior call onAjaxEvent() only if Navigator class is AjaxPagingNavigator.class.
I add 'onclick' behavior as below, it seems work fine.

--------
@Override
protected Link<?> newPagingNavigationIncrementLink(String id, IPageable pageable, int increment) {
    AjaxPagingNavigationIncrementLink link = new AjaxPagingNavigationIncrementLink(id, pageable, increment);
    link.add(new MyAjaxBehavior(link, pageable, "onclick") {
        @Override
        protected void onEvent(AjaxRequestTarget target) {
            ....
            navigator.onAjaxEvent(target);
        }
    });
    return link;
}