Component.urlFor( ILinkListener.INTERFACE ) + various url coding strategies 
produce errorneus behavior
------------------------------------------------------------------------------------------------------

                 Key: WICKET-2557
                 URL: https://issues.apache.org/jira/browse/WICKET-2557
             Project: Wicket
          Issue Type: Bug
            Reporter: Leszek Gawron


I've been trying to implement a DataTable containing clickable rows. I ended up 
with ClickableItem:

public class ClickableItem<T> extends OddEvenItem<T> implements ILinkListener {
        private ClickHandler<T> handler;

        public ClickableItem( String id, int index, IModel<T> model, final 
ClickHandler<T> handler ) {
                super( id, index, model );
                this.handler = handler;
                add( new AttributeAppender( "class", true, Model.of( 
"sq-clickable" ), " " ) );
                add( new AttributeModifier( "onclick", true, new 
AbstractReadOnlyModel<String>() {
                        @Override
                        public String getObject() {
                                return String.format(   
"window.location.href='%1$s';return false",
                                                                                
ClickableItem.this.urlFor( ILinkListener.INTERFACE ) );
                        }
                } ) );
        }

        @Override
        public void onLinkClicked() {
                handler.onClick( this );
        }
}

Turns out everything works fine as long as you use 
QueryStringUrlCodingStrategy, switching to other strategies, e.g. 
HybridUrlCodingStrategy causes the functionality to break.

Please find attached the test project that contains the description on how to 
reproduce the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to