You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by ha...@dds.nl on 2013/08/26 12:33:07 UTC

ajaxlink in ListItem not working

Wicket users,

I got an AjaxLink in a ListItem, but there is no response when  
clicking. This is the markup code

<ul>
   <li wicket:id="colors">
     <a wicket:id="selectLink"><wicket:container  
wicket:id="color">#ffffff</wicket:container></a>
   </li>
</ul>

Java code

   ListView<String> colorView = new ListView<String>("kleuren", getKleuren()) {

          @Override
          protected void populateItem(ListItem item) {
              String color = (String) item.getModelObject();
                 AjaxLink selectColor = new AjaxLink("selectLink",  
Model.of(Color)) {
                     @Override
                     public void onClick(AjaxRequestTarget target) {
                         logger.debug("click color");
                     }
                 };

                 Label kleurLabel = new Label("kleur", kleur);
                 selectKleur.add(kleurLabel);
                 item.add(selectKleur);

             }
         };

         add(colorView);

I can see javascript generated for the links in the items, but somehow  
this is not triggered.

javascript code:

...
(function(){Wicket.Ajax.ajax({"u":"./customizer?1-1.IBehaviorListener.0-customizerForm-stijlPanel-colorSelectiePanel-colorSelectie-submitColor","e":"click","c":"submitColor25"});})();.....

Anybody has an idea or experience with ajaxlinks in listitems? How to  
debug this?



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


Re: ajaxlink in ListItem not working

Posted by ha...@dds.nl.
Mateusz,

In my case it turned out that it was a CSS issue. The link had no body  
to click on. The click was on the listitem. When i add the attribute  
"style='display:block'"

<li wicket:id="kleuren"><a wicket:id="selectLink"  
style="display:block"><wicket:container...

to the link then the link could finally receive the click. Maybe this  
applies also in your case.
Good luck!

Regards,
Haiko
Mateusz Mieszkowski <mm...@objectivity.co.uk> schreef:

> Hi,
>
> I have similar problem. What's more, my code worked fine before  
> migration to 6.10.0 (worked on 5.10.0).
> Now, when I click the link, nothing happens.
>
> I haven't got time to investigate this in more detail but just  
> letting you know that this may not be something obvious.
>
> Cheers,
> Mateusz
>
> -----Original Message-----
> From: haiko@dds.nl [mailto:haiko@dds.nl]
> Sent: Monday, August 26, 2013 2:05 PM
> To: users@wicket.apache.org
> Subject: Re: ajaxlink in ListItem not working
>
> Sven,
>
> No, I forgot to change the names in the code. The names in the  
> markup and java code are the same.
>
> Sven Meier <sv...@meiers.net> schreef:
>
>
>>>
>>> Wicket users,
>>>
>>> I got an AjaxLink in a ListItem, but there is no response when
>>> clicking. This is the markup code
>>>
>>> <ul>
>>>  <li wicket:id="colors">
>>>    <a wicket:id="selectLink"><wicket:container
>>> wicket:id="color">#ffffff</wicket:container></a>
>>>  </li>
>>> </ul>
>>>
>>> Java code
>>>
>>>  ListView<String> colorView = new ListView<String>("kleuren",
>>> getKleuren()) {
>>>
>>>         @Override
>>>         protected void populateItem(ListItem item) {
>>>             String color = (String) item.getModelObject();
>>>                AjaxLink selectColor = new AjaxLink("selectLink",
>>> Model.of(Color)) {
>>>                    @Override
>>>                    public void onClick(AjaxRequestTarget target) {
>>>                        logger.debug("click color");
>>>                    }
>>>                };
>>>
>>>                Label kleurLabel = new Label("kleur", kleur);
>>>                selectKleur.add(kleurLabel);
>>>                item.add(selectKleur);
>>>
>>>            }
>>>        };
>>>
>>>        add(colorView);
>>>
>>> I can see javascript generated for the links in the items, but
>>> somehow this is not triggered.
>>>
>>> javascript code:
>>>
>>> ...
>>> (function(){Wicket.Ajax.ajax({"u":"./customizer?1-1.IBehaviorListener
>>> .0-customizerForm-stijlPanel-colorSelectiePanel-colorSelectie-submitColor","e":"click","c":"submitColor25"});})();..... Anybody has an idea or experience with ajaxlinks in listitems? How to debug  
>>> this?
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org




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


Re: ajaxlink in ListItem not working

Posted by Sven Meier <sv...@meiers.net>.
A quickstart would be helpful.

Sven

On 09/06/2013 07:43 AM, Mateusz Mieszkowski wrote:
> Hi,
>
> I have similar problem. What's more, my code worked fine before migration to 6.10.0 (worked on 5.10.0).
> Now, when I click the link, nothing happens.
>
> I haven't got time to investigate this in more detail but just letting you know that this may not be something obvious.
>
> Cheers,
> Mateusz
>
> -----Original Message-----
> From: haiko@dds.nl [mailto:haiko@dds.nl]
> Sent: Monday, August 26, 2013 2:05 PM
> To: users@wicket.apache.org
> Subject: Re: ajaxlink in ListItem not working
>
> Sven,
>
> No, I forgot to change the names in the code. The names in the markup and java code are the same.
>
> Sven Meier <sv...@meiers.net> schreef:
>
>
>>> Wicket users,
>>>
>>> I got an AjaxLink in a ListItem, but there is no response when
>>> clicking. This is the markup code
>>>
>>> <ul>
>>>   <li wicket:id="colors">
>>>     <a wicket:id="selectLink"><wicket:container
>>> wicket:id="color">#ffffff</wicket:container></a>
>>>   </li>
>>> </ul>
>>>
>>> Java code
>>>
>>>   ListView<String> colorView = new ListView<String>("kleuren",
>>> getKleuren()) {
>>>
>>>          @Override
>>>          protected void populateItem(ListItem item) {
>>>              String color = (String) item.getModelObject();
>>>                 AjaxLink selectColor = new AjaxLink("selectLink",
>>> Model.of(Color)) {
>>>                     @Override
>>>                     public void onClick(AjaxRequestTarget target) {
>>>                         logger.debug("click color");
>>>                     }
>>>                 };
>>>
>>>                 Label kleurLabel = new Label("kleur", kleur);
>>>                 selectKleur.add(kleurLabel);
>>>                 item.add(selectKleur);
>>>
>>>             }
>>>         };
>>>
>>>         add(colorView);
>>>
>>> I can see javascript generated for the links in the items, but
>>> somehow this is not triggered.
>>>
>>> javascript code:
>>>
>>> ...
>>> (function(){Wicket.Ajax.ajax({"u":"./customizer?1-1.IBehaviorListener
>>> .0-customizerForm-stijlPanel-colorSelectiePanel-colorSelectie-submitColor","e":"click","c":"submitColor25"});})();..... Anybody has an idea or experience with ajaxlinks in listitems? How to debug this?
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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


RE: ajaxlink in ListItem not working

Posted by Mateusz Mieszkowski <mm...@objectivity.co.uk>.
Hi,

I have similar problem. What's more, my code worked fine before migration to 6.10.0 (worked on 5.10.0). 
Now, when I click the link, nothing happens. 

I haven't got time to investigate this in more detail but just letting you know that this may not be something obvious.

Cheers,
Mateusz

-----Original Message-----
From: haiko@dds.nl [mailto:haiko@dds.nl] 
Sent: Monday, August 26, 2013 2:05 PM
To: users@wicket.apache.org
Subject: Re: ajaxlink in ListItem not working

Sven,

No, I forgot to change the names in the code. The names in the markup and java code are the same.

Sven Meier <sv...@meiers.net> schreef:


>>
>> Wicket users,
>>
>> I got an AjaxLink in a ListItem, but there is no response when 
>> clicking. This is the markup code
>>
>> <ul>
>>  <li wicket:id="colors">
>>    <a wicket:id="selectLink"><wicket:container
>> wicket:id="color">#ffffff</wicket:container></a>
>>  </li>
>> </ul>
>>
>> Java code
>>
>>  ListView<String> colorView = new ListView<String>("kleuren",
>> getKleuren()) {
>>
>>         @Override
>>         protected void populateItem(ListItem item) {
>>             String color = (String) item.getModelObject();
>>                AjaxLink selectColor = new AjaxLink("selectLink",
>> Model.of(Color)) {
>>                    @Override
>>                    public void onClick(AjaxRequestTarget target) {
>>                        logger.debug("click color");
>>                    }
>>                };
>>
>>                Label kleurLabel = new Label("kleur", kleur);
>>                selectKleur.add(kleurLabel);
>>                item.add(selectKleur);
>>
>>            }
>>        };
>>
>>        add(colorView);
>>
>> I can see javascript generated for the links in the items, but 
>> somehow this is not triggered.
>>
>> javascript code:
>>
>> ...
>> (function(){Wicket.Ajax.ajax({"u":"./customizer?1-1.IBehaviorListener
>> .0-customizerForm-stijlPanel-colorSelectiePanel-colorSelectie-submitColor","e":"click","c":"submitColor25"});})();..... Anybody has an idea or experience with ajaxlinks in listitems? How to debug this?
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org





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


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


Re: ajaxlink in ListItem not working

Posted by ha...@dds.nl.
Sven,

No, I forgot to change the names in the code. The names in the markup  
and java code are the same.

Sven Meier <sv...@meiers.net> schreef:


>>
>> Wicket users,
>>
>> I got an AjaxLink in a ListItem, but there is no response when  
>> clicking. This is the markup code
>>
>> <ul>
>>  <li wicket:id="colors">
>>    <a wicket:id="selectLink"><wicket:container  
>> wicket:id="color">#ffffff</wicket:container></a>
>>  </li>
>> </ul>
>>
>> Java code
>>
>>  ListView<String> colorView = new ListView<String>("kleuren",  
>> getKleuren()) {
>>
>>         @Override
>>         protected void populateItem(ListItem item) {
>>             String color = (String) item.getModelObject();
>>                AjaxLink selectColor = new AjaxLink("selectLink",  
>> Model.of(Color)) {
>>                    @Override
>>                    public void onClick(AjaxRequestTarget target) {
>>                        logger.debug("click color");
>>                    }
>>                };
>>
>>                Label kleurLabel = new Label("kleur", kleur);
>>                selectKleur.add(kleurLabel);
>>                item.add(selectKleur);
>>
>>            }
>>        };
>>
>>        add(colorView);
>>
>> I can see javascript generated for the links in the items, but  
>> somehow this is not triggered.
>>
>> javascript code:
>>
>> ...
>> (function(){Wicket.Ajax.ajax({"u":"./customizer?1-1.IBehaviorListener.0-customizerForm-stijlPanel-colorSelectiePanel-colorSelectie-submitColor","e":"click","c":"submitColor25"});})();..... Anybody has an idea or experience with ajaxlinks in listitems? How to debug  
>> this?
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org





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


Re: ajaxlink in ListItem not working

Posted by Sven Meier <sv...@meiers.net>.
Is this the actual code?

   selectColor <-> selectKleur
   "selectLink" <-> "submitColor"

Sven

On 08/26/2013 12:33 PM, haiko@dds.nl wrote:
>
> Wicket users,
>
> I got an AjaxLink in a ListItem, but there is no response when 
> clicking. This is the markup code
>
> <ul>
>   <li wicket:id="colors">
>     <a wicket:id="selectLink"><wicket:container 
> wicket:id="color">#ffffff</wicket:container></a>
>   </li>
> </ul>
>
> Java code
>
>   ListView<String> colorView = new ListView<String>("kleuren", 
> getKleuren()) {
>
>          @Override
>          protected void populateItem(ListItem item) {
>              String color = (String) item.getModelObject();
>                 AjaxLink selectColor = new AjaxLink("selectLink", 
> Model.of(Color)) {
>                     @Override
>                     public void onClick(AjaxRequestTarget target) {
>                         logger.debug("click color");
>                     }
>                 };
>
>                 Label kleurLabel = new Label("kleur", kleur);
>                 selectKleur.add(kleurLabel);
>                 item.add(selectKleur);
>
>             }
>         };
>
>         add(colorView);
>
> I can see javascript generated for the links in the items, but somehow 
> this is not triggered.
>
> javascript code:
>
> ...
> (function(){Wicket.Ajax.ajax({"u":"./customizer?1-1.IBehaviorListener.0-customizerForm-stijlPanel-colorSelectiePanel-colorSelectie-submitColor","e":"click","c":"submitColor25"});})();..... 
>
>
> Anybody has an idea or experience with ajaxlinks in listitems? How to 
> debug this?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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