You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ashika Umanga Umagiliya <au...@biggjapan.com> on 2010/01/18 07:24:22 UTC

WicketExtensions DataTable : Creating a Links using Model value?

Greetings,

I was going through WicketExtensions DataTable source and I was 
wondering how to create a hyperlink using PropertyColumn.

In docs it says:

 columns[0] = new PropertyColumn(new Model("Family Id"), "familyId");

What I want to do is,
1) create a Link using the field value "familyId",and directing to another page which display SubFamilies related to
 selected 'familyId'
2) create a Link which direct to another website . eg: http://www.ncbi.org/family?id=$familyid


My domain model is as:

One 'Family' has many 'SubFamily' objects.




||

Re: WicketExtensions DataTable : Creating a Links using Model value?

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
A somewhat similar question was asked just a couple of days ago [1] and,
probably, has been asked and answered many times before on this list.

Ernesto

References

[1]
http://old.nabble.com/How-to-get-a-cell-work-as-a-link-in-AjaxFallbackDefaultDataTable-td27161378.html

On Mon, Jan 18, 2010 at 7:24 AM, Ashika Umanga Umagiliya <
aumanga@biggjapan.com> wrote:

> Greetings,
>
> I was going through WicketExtensions DataTable source and I was wondering
> how to create a hyperlink using PropertyColumn.
>
> In docs it says:
>
> columns[0] = new PropertyColumn(new Model("Family Id"), "familyId");
>
> What I want to do is,
> 1) create a Link using the field value "familyId",and directing to another
> page which display SubFamilies related to
> selected 'familyId'
> 2) create a Link which direct to another website . eg:
> http://www.ncbi.org/family?id=$familyid
>
>
> My domain model is as:
>
> One 'Family' has many 'SubFamily' objects.
>
>
>
>
> ||
>

RE: Ajax unable to perform markup update

Posted by Martin Asenov <mA...@velti.com>.
Thanks namesake :)

I just put the formPanel in a webmarkupcontainer and updated the container. And it works fine. Setting the markup id didn't work for me due to unknown reasons. Anyway, you helped a lot! Thanks! :)

Regards,

Martin

-----Original Message-----
From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com] 
Sent: Monday, January 18, 2010 9:55 AM
To: users@wicket.apache.org
Subject: Re: Ajax unable to perform markup update

Or even better.. ajax-update the parent panel not the child panel.

**
Martin

2010/1/18 Martin Makundi <ma...@koodaripalvelut.com>:
> Hi!
>
> If the markupid number changes then ofcourse.. you should maybe call :
>
> newPanel.setMarkupid(oldPanel.getMarkupId()); when ajax updating
>
> **
> Martin
>
> 2010/1/18 Martin Asenov <mA...@velti.com>:
>> Hello, everyone! Although I've managed to handle such errors so far, I am unable to deal with this one...
>>
>> I've got an abstract class MyFormPanel that extends Panel and calls super("form_panel");
>>
>> Because I've got different form panels, i.e. ContactFormPanel, GroupFormPanel, etc. I'm trying to replace the panels according to the user's actions. So... here's a small snippet of the replacement:
>>
>>
>> MyFormPanel<Contact> temp = new ContactFormPanel(new Contact());
>> temp.setOutputMarkupId(true);
>> formPanel.replaceWith(temp);
>> formPanel = temp;
>>
>> formPanel.setVisible(true);
>> target.addComponent(formPanel);
>>
>> Note: formPanel is my initially created MyFormPanel, that has got setOutputPlaceHolderTag(true); and starts invisible.
>>
>> The first replacement is performed properly, but when a 'new group' button is hit for instance and I do the replacement in the very same manner, Ajax says unable to update markup - couldn't find component with id "form_panel_some_number".
>>
>> I just can't figure out why this occurs. If someone gives a hint I would be grateful.
>>
>> Thank you in advance,
>>
>> Martin
>>
>> -----Original Message-----
>> From: Eyal Golan [mailto:egolan74@gmail.com]
>> Sent: Monday, January 18, 2010 8:48 AM
>> To: users@wicket.apache.org
>> Subject: Re: WicketExtensions DataTable : Creating a Links using Model value?
>>
>> You can either override PropertyColumn's populateItem method, and add to the
>> cell the link you want.
>> Or you can use AbstractColumn.
>>
>> Eyal Golan
>> egolan74@gmail.com
>>
>> Visit: http://jvdrums.sourceforge.net/
>> LinkedIn: http://www.linkedin.com/in/egolan74
>>
>> P  Save a tree. Please don't print this e-mail unless it's really necessary
>>
>>
>> On Mon, Jan 18, 2010 at 8:24 AM, Ashika Umanga Umagiliya <
>> aumanga@biggjapan.com> wrote:
>>
>>> Greetings,
>>>
>>> I was going through WicketExtensions DataTable source and I was wondering
>>> how to create a hyperlink using PropertyColumn.
>>>
>>> In docs it says:
>>>
>>> columns[0] = new PropertyColumn(new Model("Family Id"), "familyId");
>>>
>>> What I want to do is,
>>> 1) create a Link using the field value "familyId",and directing to another
>>> page which display SubFamilies related to
>>> selected 'familyId'
>>> 2) create a Link which direct to another website . eg:
>>> http://www.ncbi.org/family?id=$familyid
>>>
>>>
>>> My domain model is as:
>>>
>>> One 'Family' has many 'SubFamily' objects.
>>>
>>>
>>>
>>>
>>> ||
>>>
>>
>> ---------------------------------------------------------------------
>> 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: Ajax unable to perform markup update

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Or even better.. ajax-update the parent panel not the child panel.

**
Martin

2010/1/18 Martin Makundi <ma...@koodaripalvelut.com>:
> Hi!
>
> If the markupid number changes then ofcourse.. you should maybe call :
>
> newPanel.setMarkupid(oldPanel.getMarkupId()); when ajax updating
>
> **
> Martin
>
> 2010/1/18 Martin Asenov <mA...@velti.com>:
>> Hello, everyone! Although I've managed to handle such errors so far, I am unable to deal with this one...
>>
>> I've got an abstract class MyFormPanel that extends Panel and calls super("form_panel");
>>
>> Because I've got different form panels, i.e. ContactFormPanel, GroupFormPanel, etc. I'm trying to replace the panels according to the user's actions. So... here's a small snippet of the replacement:
>>
>>
>> MyFormPanel<Contact> temp = new ContactFormPanel(new Contact());
>> temp.setOutputMarkupId(true);
>> formPanel.replaceWith(temp);
>> formPanel = temp;
>>
>> formPanel.setVisible(true);
>> target.addComponent(formPanel);
>>
>> Note: formPanel is my initially created MyFormPanel, that has got setOutputPlaceHolderTag(true); and starts invisible.
>>
>> The first replacement is performed properly, but when a 'new group' button is hit for instance and I do the replacement in the very same manner, Ajax says unable to update markup - couldn't find component with id "form_panel_some_number".
>>
>> I just can't figure out why this occurs. If someone gives a hint I would be grateful.
>>
>> Thank you in advance,
>>
>> Martin
>>
>> -----Original Message-----
>> From: Eyal Golan [mailto:egolan74@gmail.com]
>> Sent: Monday, January 18, 2010 8:48 AM
>> To: users@wicket.apache.org
>> Subject: Re: WicketExtensions DataTable : Creating a Links using Model value?
>>
>> You can either override PropertyColumn's populateItem method, and add to the
>> cell the link you want.
>> Or you can use AbstractColumn.
>>
>> Eyal Golan
>> egolan74@gmail.com
>>
>> Visit: http://jvdrums.sourceforge.net/
>> LinkedIn: http://www.linkedin.com/in/egolan74
>>
>> P  Save a tree. Please don't print this e-mail unless it's really necessary
>>
>>
>> On Mon, Jan 18, 2010 at 8:24 AM, Ashika Umanga Umagiliya <
>> aumanga@biggjapan.com> wrote:
>>
>>> Greetings,
>>>
>>> I was going through WicketExtensions DataTable source and I was wondering
>>> how to create a hyperlink using PropertyColumn.
>>>
>>> In docs it says:
>>>
>>> columns[0] = new PropertyColumn(new Model("Family Id"), "familyId");
>>>
>>> What I want to do is,
>>> 1) create a Link using the field value "familyId",and directing to another
>>> page which display SubFamilies related to
>>> selected 'familyId'
>>> 2) create a Link which direct to another website . eg:
>>> http://www.ncbi.org/family?id=$familyid
>>>
>>>
>>> My domain model is as:
>>>
>>> One 'Family' has many 'SubFamily' objects.
>>>
>>>
>>>
>>>
>>> ||
>>>
>>
>> ---------------------------------------------------------------------
>> 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: Ajax unable to perform markup update

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Hi!

If the markupid number changes then ofcourse.. you should maybe call :

newPanel.setMarkupid(oldPanel.getMarkupId()); when ajax updating

**
Martin

2010/1/18 Martin Asenov <mA...@velti.com>:
> Hello, everyone! Although I've managed to handle such errors so far, I am unable to deal with this one...
>
> I've got an abstract class MyFormPanel that extends Panel and calls super("form_panel");
>
> Because I've got different form panels, i.e. ContactFormPanel, GroupFormPanel, etc. I'm trying to replace the panels according to the user's actions. So... here's a small snippet of the replacement:
>
>
> MyFormPanel<Contact> temp = new ContactFormPanel(new Contact());
> temp.setOutputMarkupId(true);
> formPanel.replaceWith(temp);
> formPanel = temp;
>
> formPanel.setVisible(true);
> target.addComponent(formPanel);
>
> Note: formPanel is my initially created MyFormPanel, that has got setOutputPlaceHolderTag(true); and starts invisible.
>
> The first replacement is performed properly, but when a 'new group' button is hit for instance and I do the replacement in the very same manner, Ajax says unable to update markup - couldn't find component with id "form_panel_some_number".
>
> I just can't figure out why this occurs. If someone gives a hint I would be grateful.
>
> Thank you in advance,
>
> Martin
>
> -----Original Message-----
> From: Eyal Golan [mailto:egolan74@gmail.com]
> Sent: Monday, January 18, 2010 8:48 AM
> To: users@wicket.apache.org
> Subject: Re: WicketExtensions DataTable : Creating a Links using Model value?
>
> You can either override PropertyColumn's populateItem method, and add to the
> cell the link you want.
> Or you can use AbstractColumn.
>
> Eyal Golan
> egolan74@gmail.com
>
> Visit: http://jvdrums.sourceforge.net/
> LinkedIn: http://www.linkedin.com/in/egolan74
>
> P  Save a tree. Please don't print this e-mail unless it's really necessary
>
>
> On Mon, Jan 18, 2010 at 8:24 AM, Ashika Umanga Umagiliya <
> aumanga@biggjapan.com> wrote:
>
>> Greetings,
>>
>> I was going through WicketExtensions DataTable source and I was wondering
>> how to create a hyperlink using PropertyColumn.
>>
>> In docs it says:
>>
>> columns[0] = new PropertyColumn(new Model("Family Id"), "familyId");
>>
>> What I want to do is,
>> 1) create a Link using the field value "familyId",and directing to another
>> page which display SubFamilies related to
>> selected 'familyId'
>> 2) create a Link which direct to another website . eg:
>> http://www.ncbi.org/family?id=$familyid
>>
>>
>> My domain model is as:
>>
>> One 'Family' has many 'SubFamily' objects.
>>
>>
>>
>>
>> ||
>>
>
> ---------------------------------------------------------------------
> 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


Ajax unable to perform markup update

Posted by Martin Asenov <mA...@velti.com>.
Hello, everyone! Although I've managed to handle such errors so far, I am unable to deal with this one...

I've got an abstract class MyFormPanel that extends Panel and calls super("form_panel");

Because I've got different form panels, i.e. ContactFormPanel, GroupFormPanel, etc. I'm trying to replace the panels according to the user's actions. So... here's a small snippet of the replacement: 


MyFormPanel<Contact> temp = new ContactFormPanel(new Contact());
temp.setOutputMarkupId(true);
formPanel.replaceWith(temp);
formPanel = temp;

formPanel.setVisible(true);
target.addComponent(formPanel);

Note: formPanel is my initially created MyFormPanel, that has got setOutputPlaceHolderTag(true); and starts invisible.

The first replacement is performed properly, but when a 'new group' button is hit for instance and I do the replacement in the very same manner, Ajax says unable to update markup - couldn't find component with id "form_panel_some_number".

I just can't figure out why this occurs. If someone gives a hint I would be grateful.

Thank you in advance,

Martin

-----Original Message-----
From: Eyal Golan [mailto:egolan74@gmail.com] 
Sent: Monday, January 18, 2010 8:48 AM
To: users@wicket.apache.org
Subject: Re: WicketExtensions DataTable : Creating a Links using Model value?

You can either override PropertyColumn's populateItem method, and add to the
cell the link you want.
Or you can use AbstractColumn.

Eyal Golan
egolan74@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Mon, Jan 18, 2010 at 8:24 AM, Ashika Umanga Umagiliya <
aumanga@biggjapan.com> wrote:

> Greetings,
>
> I was going through WicketExtensions DataTable source and I was wondering
> how to create a hyperlink using PropertyColumn.
>
> In docs it says:
>
> columns[0] = new PropertyColumn(new Model("Family Id"), "familyId");
>
> What I want to do is,
> 1) create a Link using the field value "familyId",and directing to another
> page which display SubFamilies related to
> selected 'familyId'
> 2) create a Link which direct to another website . eg:
> http://www.ncbi.org/family?id=$familyid
>
>
> My domain model is as:
>
> One 'Family' has many 'SubFamily' objects.
>
>
>
>
> ||
>

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


Re: WicketExtensions DataTable : Creating a Links using Model value?

Posted by Eyal Golan <eg...@gmail.com>.
You can either override PropertyColumn's populateItem method, and add to the
cell the link you want.
Or you can use AbstractColumn.

Eyal Golan
egolan74@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Mon, Jan 18, 2010 at 8:24 AM, Ashika Umanga Umagiliya <
aumanga@biggjapan.com> wrote:

> Greetings,
>
> I was going through WicketExtensions DataTable source and I was wondering
> how to create a hyperlink using PropertyColumn.
>
> In docs it says:
>
> columns[0] = new PropertyColumn(new Model("Family Id"), "familyId");
>
> What I want to do is,
> 1) create a Link using the field value "familyId",and directing to another
> page which display SubFamilies related to
> selected 'familyId'
> 2) create a Link which direct to another website . eg:
> http://www.ncbi.org/family?id=$familyid
>
>
> My domain model is as:
>
> One 'Family' has many 'SubFamily' objects.
>
>
>
>
> ||
>