Hello,

We have markup which displays "currently visited"(disabled) links in a
special way.
By default, if you use <wicket:link>, autolinks for current page will look
like:
<span><em>Current Page</em></span>

I need to make them look like:
<a class="selected">Current Page</a>

This is just a design rule (application-wide), enforced by our CSS.

So as I understand from reading sources for AutoLinkResolver, the way Wicket
disables links is:
1. "a" is converted to "span"
2. "href" and "onclick" attributes removed.

I need to:
1. Leave "a" intact.
2. Remove "href" and "onclick".
3. Add class="selected".

Unfortunately, I don't see any ways of doing that, because these links are
AutolinkBookmarkablePageLinks, this class is final and cannot be extended
(and it seems to be tricky to customize AutolinkResolver as well....)

For now, I've decided to go on without <wicket:link> and added my own link
class which extends BookmarkablePageLink and overrides "disableLink".
However, I don't really like it and it looks messy: you have to bind all of
them to wicket:id and should not forget to add them to the page. It would be
much easier to use <wicket:link>.

Particularly, how about adding some feature to customize/extend
AutolinkBookmarkablePageLinks, on application level?

Regards,
Sergey.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to