You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Krthekeyan Suryanarayanan <kr...@verchaska.com> on 2004/02/16 09:41:22 UTC
providing hyperlinks on table values
Hi,
1)I am using the default table component. how can I provide a hyperlink on the
generated tablevalues in the tablerows.
2)say for example I have 5 columns where each tablevalue has to take the id
and all 5 columns should have different hyperlinks's destination.
how will I solve this problem.
thanks,
krthekeyan.s
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: providing hyperlinks on table values
Posted by Mindbridge <mi...@yahoo.com>.
Forgot to mention -- for best results please use beta4.
----- Original Message -----
From: "Krthekeyan Suryanarayanan" <kr...@verchaska.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Monday, February 16, 2004 10:41 AM
Subject: providing hyperlinks on table values
> Hi,
> 1)I am using the default table component. how can I provide a hyperlink on
the
> generated tablevalues in the tablerows.
> 2)say for example I have 5 columns where each tablevalue has to take the
id
> and all 5 columns should have different hyperlinks's destination.
>
> how will I solve this problem.
>
> thanks,
> krthekeyan.s
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: providing hyperlinks on table values
Posted by Jozsa Kristof <dy...@ond.vein.hu>.
On Mon, Feb 16, 2004 at 04:36:18PM +0200, Mindbridge wrote:
> > a) what's the preferred way of enabling a custom renderer when using
> > tableModel with a Table component?
>
> Just to mention: you can actually use the Block stuff with the table model
> approach but it involves some code.
>
> For each of the columns you want to configure in the same way invoke the
> following:
> column.loadSettings(<component>);
> (the component is the one where the Blocks are located and is most typically
> 'this')
> This is exactly what is being done if you define the columns using a string
> via the 'columns' parameter.
>
> Does this help?
Definetely! I've got the thing working at once.. thank you very much.
> If you need the more precise instrument, you could do
> column.setValueRendererSource(new BlockTableRendererSource(<block>))
> but that is way too elaborate, and probably the other approaches would be
> more useful.
Yeah before asking anything, I just started to walk that path.. but
loadSettings() is much more elegant (and I dont want that much control, all
I needed was some <a href-s>
> > b) why Spindle keeps on saying I *have to* use the tableModel mode for my
> > table.. (I didn't really want to but specifying the source/columns wasn't
> > enough of her (Geoff, is it her? :))
>
> That's probably because the Spindle you have uses beta3, rather than beta4.
> If you are using beta4 in your project, could you try to get the latest
> Spindle? It links to beta4, as far as I understand.
>
> Sorry, beta4 is just a major improvement...
Yeah, gotcha. The thing is, that I *did* upgrade Spindle this very morning,
but it has happened with eclipse M7, and I just realized later that Jetty
launcher was broken with that release (Geoff confirmed that on his website),
so I reverted to M5 which had the old Spindle. After blowing up M5's
configuration management dialog (was it a known bug that the window opens at
about 2 pixel wide, and it cannot be resized? a funny problem indeed), I
manually upgraded my old Spindle's jars to use Tapestry 3.0-beta4, so
everything works now. Ofc I'll upgrade Spindle and move to eclipse M7 as
soon as jettylauncher gets fixed.
Thanks for the help,
dyn
--
.Digital.Yearning.for.Networked.Assassination.and.Xenocide
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: providing hyperlinks on table values
Posted by Mindbridge <mi...@yahoo.com>.
> a) what's the preferred way of enabling a custom renderer when using
> tableModel with a Table component?
Just to mention: you can actually use the Block stuff with the table model
approach but it involves some code.
For each of the columns you want to configure in the same way invoke the
following:
column.loadSettings(<component>);
(the component is the one where the Blocks are located and is most typically
'this')
This is exactly what is being done if you define the columns using a string
via the 'columns' parameter.
Does this help?
If you need the more precise instrument, you could do
column.setValueRendererSource(new BlockTableRendererSource(<block>))
but that is way too elaborate, and probably the other approaches would be
more useful.
> b) why Spindle keeps on saying I *have to* use the tableModel mode for my
> table.. (I didn't really want to but specifying the source/columns wasn't
> enough of her (Geoff, is it her? :))
That's probably because the Spindle you have uses beta3, rather than beta4.
If you are using beta4 in your project, could you try to get the latest
Spindle? It links to beta4, as far as I understand.
Sorry, beta4 is just a major improvement...
----- Original Message -----
From: "Jozsa Kristof" <dy...@ond.vein.hu>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Monday, February 16, 2004 4:26 PM
Subject: Re: providing hyperlinks on table values
> On Mon, Feb 16, 2004 at 09:04:48AM -0500, Erik Hatcher wrote:
> > On Feb 16, 2004, at 8:32 AM, Jozsa Kristof wrote:
> > >On Mon, Feb 16, 2004 at 11:03:20AM +0200, Mindbridge wrote:
> > >>Hi,
> > >>
> > >>You can do something like this:
> > >>
> > >><table jwcid="table@contrib:Table" source="ognl:data"
> > >>columns="person:name,
> > >>!experience, salary" row="currentPerson"/>
> > >>
> > >><span jwcid="personColumnValue@Block">
> > >> <a jwcid="@DirectLink" listener="ognl:listeners.selectPerson"
> > >> parameters="ognl:currentPerson.id">
> > >> <img jwcid="@Image" image="ognl:currentPerson.pictureAsset"/>
> > >> <span jwcid="@Insert" value="ognl:currentPerson.name"/>
> > >> </a>
> > >></span>
> > >
> > >I just wanted to ask the very same thing when these mails popped in :)
> > >Ok, I
> > >tried it following your example, but seems the block aint really gets
> > >parsed. The difference in my code is, that I use the tableModel
> > >parameter,
> > >not the source/columns/row thing; I dunno if that'd make any
> > >difference in
> > >the expected behaviour.
> >
> > It makes all the difference in the world. The @Block stuff is
> > specifically designed for the source/columns mode.
>
> Hmm ok, I see.. then two questions:
> a) what's the preferred way of enabling a custom renderer when using
> tableModel with a Table component?
>
> b) why Spindle keeps on saying I *have to* use the tableModel mode for my
> table.. (I didn't really want to but specifying the source/columns wasn't
> enough of her (Geoff, is it her? :))
>
> dyn
> --
> .Digital.Yearning.for.Networked.Assassination.and.Xenocide
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: providing hyperlinks on table values
Posted by Jozsa Kristof <dy...@ond.vein.hu>.
On Mon, Feb 16, 2004 at 09:04:48AM -0500, Erik Hatcher wrote:
> On Feb 16, 2004, at 8:32 AM, Jozsa Kristof wrote:
> >On Mon, Feb 16, 2004 at 11:03:20AM +0200, Mindbridge wrote:
> >>Hi,
> >>
> >>You can do something like this:
> >>
> >><table jwcid="table@contrib:Table" source="ognl:data"
> >>columns="person:name,
> >>!experience, salary" row="currentPerson"/>
> >>
> >><span jwcid="personColumnValue@Block">
> >> <a jwcid="@DirectLink" listener="ognl:listeners.selectPerson"
> >> parameters="ognl:currentPerson.id">
> >> <img jwcid="@Image" image="ognl:currentPerson.pictureAsset"/>
> >> <span jwcid="@Insert" value="ognl:currentPerson.name"/>
> >> </a>
> >></span>
> >
> >I just wanted to ask the very same thing when these mails popped in :)
> >Ok, I
> >tried it following your example, but seems the block aint really gets
> >parsed. The difference in my code is, that I use the tableModel
> >parameter,
> >not the source/columns/row thing; I dunno if that'd make any
> >difference in
> >the expected behaviour.
>
> It makes all the difference in the world. The @Block stuff is
> specifically designed for the source/columns mode.
Hmm ok, I see.. then two questions:
a) what's the preferred way of enabling a custom renderer when using
tableModel with a Table component?
b) why Spindle keeps on saying I *have to* use the tableModel mode for my
table.. (I didn't really want to but specifying the source/columns wasn't
enough of her (Geoff, is it her? :))
dyn
--
.Digital.Yearning.for.Networked.Assassination.and.Xenocide
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: providing hyperlinks on table values
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 16, 2004, at 8:32 AM, Jozsa Kristof wrote:
> On Mon, Feb 16, 2004 at 11:03:20AM +0200, Mindbridge wrote:
>> Hi,
>>
>> You can do something like this:
>>
>> <table jwcid="table@contrib:Table" source="ognl:data"
>> columns="person:name,
>> !experience, salary" row="currentPerson"/>
>>
>> <span jwcid="personColumnValue@Block">
>> <a jwcid="@DirectLink" listener="ognl:listeners.selectPerson"
>> parameters="ognl:currentPerson.id">
>> <img jwcid="@Image" image="ognl:currentPerson.pictureAsset"/>
>> <span jwcid="@Insert" value="ognl:currentPerson.name"/>
>> </a>
>> </span>
>
> I just wanted to ask the very same thing when these mails popped in :)
> Ok, I
> tried it following your example, but seems the block aint really gets
> parsed. The difference in my code is, that I use the tableModel
> parameter,
> not the source/columns/row thing; I dunno if that'd make any
> difference in
> the expected behaviour.
It makes all the difference in the world. The @Block stuff is
specifically designed for the source/columns mode.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: providing hyperlinks on table values
Posted by Jozsa Kristof <dy...@ond.vein.hu>.
On Mon, Feb 16, 2004 at 11:03:20AM +0200, Mindbridge wrote:
> Hi,
>
> You can do something like this:
>
> <table jwcid="table@contrib:Table" source="ognl:data" columns="person:name,
> !experience, salary" row="currentPerson"/>
>
> <span jwcid="personColumnValue@Block">
> <a jwcid="@DirectLink" listener="ognl:listeners.selectPerson"
> parameters="ognl:currentPerson.id">
> <img jwcid="@Image" image="ognl:currentPerson.pictureAsset"/>
> <span jwcid="@Insert" value="ognl:currentPerson.name"/>
> </a>
> </span>
I just wanted to ask the very same thing when these mails popped in :) Ok, I
tried it following your example, but seems the block aint really gets
parsed. The difference in my code is, that I use the tableModel parameter,
not the source/columns/row thing; I dunno if that'd make any difference in
the expected behaviour.
My html code looks like that:
<table jwcid="contracttable@contrib:Table" tableModel="ognl:tableModel"/>
<span jwcid="documentNameColumnValue@Block">
blablabla
</span>
and the corresponding java code:
public ITableModel getTableModel() {
ITableColumn colCreatedT = new SimpleTableColumn("createdT", true) {
public Object getColumnValue(Object contract) {
return ((Contract) contract).getCreatedT();
}
};
SimpleTableColumn colDocumentName = new SimpleTableColumn("documentName", true) {
public Object getColumnValue(Object contract) {
return ((Contract) contract).getDocumentName();
}
};
ITableModel model = new SimpleTableModel(
new SimpleListTableDataModel(getAllContracts()),
new SimpleTableColumnModel(
new ITableColumn[] {
colCreatedT, colDocumentName }
));
model.getPagingState().setPageSize(5);
return model;
}
The whole table gets rendered, but i cant see the documentNameColumnValue
Block getting rendered anywhere in the output. Can you see what's wrong
above? (I also checked the AbstractTableColumn source and indeed it would
have to use the block rendered colname+VALUE_RENDERER_BLOCK_SUFFIX, so I
can't see what do I miss from above). /* i'm using beta-4 of Tapestry */
any help appreciated,
dyn
--
.Digital.Yearning.for.Networked.Assassination.and.Xenocide
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: providing hyperlinks on table values
Posted by Mindbridge <mi...@yahoo.com>.
Hi,
You can do something like this:
<table jwcid="table@contrib:Table" source="ognl:data" columns="person:name,
!experience, salary" row="currentPerson"/>
<span jwcid="personColumnValue@Block">
<a jwcid="@DirectLink" listener="ognl:listeners.selectPerson"
parameters="ognl:currentPerson.id">
<img jwcid="@Image" image="ognl:currentPerson.pictureAsset"/>
<span jwcid="@Insert" value="ognl:currentPerson.name"/>
</a>
</span>
The table will automatically use the above block to render the 'person'
column because of the block name (personColumnValue).
I will update the Table documentation with an example like that.
Hope this helps,
-mb
----- Original Message -----
From: "Krthekeyan Suryanarayanan" <kr...@verchaska.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Monday, February 16, 2004 10:41 AM
Subject: providing hyperlinks on table values
> Hi,
> 1)I am using the default table component. how can I provide a hyperlink on
the
> generated tablevalues in the tablerows.
> 2)say for example I have 5 columns where each tablevalue has to take the
id
> and all 5 columns should have different hyperlinks's destination.
>
> how will I solve this problem.
>
> thanks,
> krthekeyan.s
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org