Petr Piškula
Petr Piškula

Reputation: 23

How to hide / delete label on Paging Navigator in Wicket

I'm new in wicket and I'm trying to create basic eshop, but I have a problem with pop-up label on Paging Navigator like "Go to page 2"...

enter image description here

I tried to remove or hide it, ussing: title="" or script

$('a["title"]').on('mouseenter', function(e){
     e.preventDefault();
});

but both solutions didn't work very well.

I'm ussing CustomPagingNavigator.java

public class CustomPagingNavigator extends PagingNavigator {

   private static final long serialVersionUID = 1L;

   public CustomPagingNavigator(final String id, final IPageable pageable) {
       this(id, pageable, null);    
   }

   public CustomPagingNavigator(final String id, final IPageable pageable, final IPagingLabelProvider labelProvider) {
       super(id,pageable,labelProvider);
   }
}

and CustomPagingNavigator.html

<html xmlns:wicket>
<body>
    <wicket:panel>
        <!-- First link -->
        <a id="first" wicket:id="first">
            <img id="arrow" src="left_arrow.png">
        </a>
            <!-- Previous Link -->
            <a id="previous" wicket:id="prev">
            </a>

                <span id="navigation" title="" wicket:id="navigation">
                    <a wicket:id="pageLink" href="#">
                        <span wicket:id="pageNumber">5</span>
                    </a>
                </span>

            <!-- Next Link -->
            <a id="next" wicket:id="next">
            </a>

        <!-- Last Link -->
        <a id="last" wicket:id="last">
            <img id="arrow" src="right_arrow.png">
        </a>
    </wicket:panel>
</body>

Should anyone have a simple solution of this problem?

Upvotes: 2

Views: 188

Answers (2)

svenmeier
svenmeier

Reputation: 5681

Easiest solution is to put an empty mapping into one of your string resource files:

PagingNavigation.page=

Upvotes: 1

Andrea Del Bene
Andrea Del Bene

Reputation: 2511

have you tried to override the two methods that create the links removing attribute "title"? :

public class CustomPagingNavigator extends PagingNavigator {

    public CustomPagingNavigator(String id, IPageable pageable) {
        super(id, pageable);
    }

    public CustomPagingNavigator(String id, IPageable pageable,
            IPagingLabelProvider labelProvider) {
        super(id, pageable, labelProvider);
    }

    @Override
    protected AbstractLink newPagingNavigationIncrementLink(String id, IPageable pageable,
            int increment) {
        AbstractLink link = super.newPagingNavigationIncrementLink(id, pageable, increment);
        link.add(AttributeModifier.remove("title"));

        return link;
    }

    @Override
    protected AbstractLink newPagingNavigationLink(String id, IPageable pageable, int pageNumber) {
        AbstractLink link = super.newPagingNavigationLink(id, pageable, pageNumber);
        link.add(AttributeModifier.remove("title"));

        return link;
    }
}

Upvotes: 1

Related Questions