You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Bergmann Manfred <mb...@software-by-mabe.com> on 2009/07/02 00:42:16 UTC

Link not rendered in AjaxFallbackDefaultDataTable

Hi there.

First of all thank you for providing such a great framework.
I've reviewed a couple of frameworks lately including JSF, Grails,  
Lift and found that Wicket is the one I'd like to stay and use.

Here is now my first question:
In a AjaxFallbackDefaultDataTable I've defined a couple of columns.  
The first one should be a link that when clicked will highlight the  
row (as in your examples).
Therefore I've overriden populateItem() in AbstractColumn class:

-----------
cols.add(new AbstractColumn(new Model("Select")) {
     @Override
     public void populateItem(final Item item, String compId, IModel  
model) {
         //item.add(new Label(compId, "select"));
         item.add(new Link(compId, new Model("select")) {
             @Override
             public void onClick() {
                 log.trace("selected clicked...");
             }
         });
     }
});
-----------

However when the table is rendered, instead of the link a "[cell]" is  
displayed. That is for all rows which are displayed.
When the link is replaced with a Label, it is correctly displayed (see  
commented line above).

Any ideas what happening here?


Best regards,
Manfred

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


Re: Link not rendered in AjaxFallbackDefaultDataTable

Posted by Jeremy Thomerson <je...@wickettraining.com>.
oops - typo

--
Jeremy Thomerson
http://www.wickettraining.com




On Wed, Jul 1, 2009 at 9:15 PM, Igor Vaynberg<ig...@gmail.com> wrote:
> oncomponenttagbody() is a better place to override if you want to
> output text, see how Label works or search this list for "TextLink"
>
> -igor
>
> On Wed, Jul 1, 2009 at 3:44 PM, Jeremy
> Thomerson<je...@wickettraining.com> wrote:
>> Your link doesn't have any text.  The model for a link is not for the
>> text of the link, but for you to use in onclick.  Although you can
>> easily override onComponentTag (in the link) and
>> response.write(getModelObjectAsString());
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>>
>> On Wed, Jul 1, 2009 at 5:42 PM, Bergmann Manfred<mb...@software-by-mabe.com> wrote:
>>> Hi there.
>>>
>>> First of all thank you for providing such a great framework.
>>> I've reviewed a couple of frameworks lately including JSF, Grails, Lift and
>>> found that Wicket is the one I'd like to stay and use.
>>>
>>> Here is now my first question:
>>> In a AjaxFallbackDefaultDataTable I've defined a couple of columns. The
>>> first one should be a link that when clicked will highlight the row (as in
>>> your examples).
>>> Therefore I've overriden populateItem() in AbstractColumn class:
>>>
>>> -----------
>>> cols.add(new AbstractColumn(new Model("Select")) {
>>>    @Override
>>>    public void populateItem(final Item item, String compId, IModel model) {
>>>        //item.add(new Label(compId, "select"));
>>>        item.add(new Link(compId, new Model("select")) {
>>>            @Override
>>>            public void onClick() {
>>>                log.trace("selected clicked...");
>>>            }
>>>        });
>>>    }
>>> });
>>> -----------
>>>
>>> However when the table is rendered, instead of the link a "[cell]" is
>>> displayed. That is for all rows which are displayed.
>>> When the link is replaced with a Label, it is correctly displayed (see
>>> commented line above).
>>>
>>> Any ideas what happening here?
>>>
>>>
>>> Best regards,
>>> Manfred
>>>
>>> ---------------------------------------------------------------------
>>> 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: Link not rendered in AjaxFallbackDefaultDataTable

Posted by Igor Vaynberg <ig...@gmail.com>.
oncomponenttagbody() is a better place to override if you want to
output text, see how Label works or search this list for "TextLink"

-igor

On Wed, Jul 1, 2009 at 3:44 PM, Jeremy
Thomerson<je...@wickettraining.com> wrote:
> Your link doesn't have any text.  The model for a link is not for the
> text of the link, but for you to use in onclick.  Although you can
> easily override onComponentTag (in the link) and
> response.write(getModelObjectAsString());
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Wed, Jul 1, 2009 at 5:42 PM, Bergmann Manfred<mb...@software-by-mabe.com> wrote:
>> Hi there.
>>
>> First of all thank you for providing such a great framework.
>> I've reviewed a couple of frameworks lately including JSF, Grails, Lift and
>> found that Wicket is the one I'd like to stay and use.
>>
>> Here is now my first question:
>> In a AjaxFallbackDefaultDataTable I've defined a couple of columns. The
>> first one should be a link that when clicked will highlight the row (as in
>> your examples).
>> Therefore I've overriden populateItem() in AbstractColumn class:
>>
>> -----------
>> cols.add(new AbstractColumn(new Model("Select")) {
>>    @Override
>>    public void populateItem(final Item item, String compId, IModel model) {
>>        //item.add(new Label(compId, "select"));
>>        item.add(new Link(compId, new Model("select")) {
>>            @Override
>>            public void onClick() {
>>                log.trace("selected clicked...");
>>            }
>>        });
>>    }
>> });
>> -----------
>>
>> However when the table is rendered, instead of the link a "[cell]" is
>> displayed. That is for all rows which are displayed.
>> When the link is replaced with a Label, it is correctly displayed (see
>> commented line above).
>>
>> Any ideas what happening here?
>>
>>
>> Best regards,
>> Manfred
>>
>> ---------------------------------------------------------------------
>> 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: Link not rendered in AjaxFallbackDefaultDataTable

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Your link doesn't have any text.  The model for a link is not for the
text of the link, but for you to use in onclick.  Although you can
easily override onComponentTag (in the link) and
response.write(getModelObjectAsString());

--
Jeremy Thomerson
http://www.wickettraining.com




On Wed, Jul 1, 2009 at 5:42 PM, Bergmann Manfred<mb...@software-by-mabe.com> wrote:
> Hi there.
>
> First of all thank you for providing such a great framework.
> I've reviewed a couple of frameworks lately including JSF, Grails, Lift and
> found that Wicket is the one I'd like to stay and use.
>
> Here is now my first question:
> In a AjaxFallbackDefaultDataTable I've defined a couple of columns. The
> first one should be a link that when clicked will highlight the row (as in
> your examples).
> Therefore I've overriden populateItem() in AbstractColumn class:
>
> -----------
> cols.add(new AbstractColumn(new Model("Select")) {
>    @Override
>    public void populateItem(final Item item, String compId, IModel model) {
>        //item.add(new Label(compId, "select"));
>        item.add(new Link(compId, new Model("select")) {
>            @Override
>            public void onClick() {
>                log.trace("selected clicked...");
>            }
>        });
>    }
> });
> -----------
>
> However when the table is rendered, instead of the link a "[cell]" is
> displayed. That is for all rows which are displayed.
> When the link is replaced with a Label, it is correctly displayed (see
> commented line above).
>
> Any ideas what happening here?
>
>
> Best regards,
> Manfred
>
> ---------------------------------------------------------------------
> 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