Re: Adding a Link for a Whole ListItem

2007-10-05 Thread Christopher Gardner
I'm continuing to experiment with making a click of a row do a page
refresh.  I coded up a class called LinkableListView that uses a
LinkableListItem, which implements ILinkListener.  When the
LinkableListItem's onLinkedClick() is called, LinkableListItem
delegates back to LinkableListView.onClick().

Here is the what my LinkableListView generates for the 2 's.


...
 
...



To use this component, I created a very simple page with two tables.

One table contains a list of objects fetched from memory.  These
objects are fetched only once (at WebPage construction time).  Now
when I click on a row, I want the data from the LinkableListItem in
the selected row to be popped over to the second table which is
designed to hold only a single row.

In this simple page, EVERY time I click on a row in table 1, I get the
page expired message.  I'm new to Wicket, so please forgive and blot
out my ignorance.


On 10/4/07, swaroop belur <[EMAIL PROTECTED]> wrote:
>
>
> Look up how requesttargets work in wicket. In particular
> look up ListenerInterfaceRequestTarget for this use case.
> It just knows how to call ur component(link for example)
> in ur page object. Call will land in onLinkClicked.
>
> -swaroop
>
>
>
>
>
>
> Christopher Gardner-2 wrote:
> >
> > Thank you.  I got this to work.  Now I'm wondering how the
> > ILinkListener gets registered to pick up the event.  Does anything
> > that happens to implement that interface automatically get registered?
> >
> > On 10/3/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> >> Yes, but odds are you already had to do that, to override populateItem().
> >>
> >> Martijn
> >>
> >> On 10/3/07, Christopher Gardner <[EMAIL PROTECTED]> wrote:
> >> > Do you also have to subclass ListView (overriding newItem()) to create
> >> > an object of the ListItem subclass?
> >> >
> >> > On 10/3/07, Maurice Marrink <[EMAIL PROTECTED]> wrote:
> >> > > Yes you can, The trick is to extend ListItem and have it implement
> >> > > ILinkListener you can then add the onclick behavior through an
> >> > > attributemodifier or override oncomponenttag. To prevent having to
> >> > > make a subclass per page you should make the onLinkClicked method in
> >> > > your listitem redirect to a method in your listview.
> >> > >
> >> > > I could show you our code but it is cluttered with non relevant code,
> >> > > and the above really says it all.
> >> > >
> >> > > Maurice
> >> > >
> >> > > On 10/3/07, Christopher Gardner <[EMAIL PROTECTED]> wrote:
> >> > > > With a ListView is there a way to actually create a Link component
> >> > > > that encompasses the whole ListItem, such that when you click
> >> anywhere
> >> > > > on a row the onClick event is fired?  I know you can do this with
> >> Ajax
> >> > > > support, but I'm curious if you can do this using the traditional
> >> way,
> >> > > > i.e., with a full page refresh.  I don't want to add a "click here"
> >> > > > button to my row.
> >> > > >
> >> > > >
> >> -
> >> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> >> > > >
> >> > > >
> >> > >
> >> > > -
> >> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >> > >
> >> > >
> >> >
> >> > -----------------
> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> > For additional commands, e-mail: [EMAIL PROTECTED]
> >> >
> >> >
> >>
> >>
> >> --
> >> Buy Wicket in Action: http://manning.com/dashorst
> >> Apache Wicket 1.3.0-beta3 is released
> >> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/Adding-a-Link-for-a-Whole-ListItem-tf4561727.html#a13032210
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Adding a Link for a Whole ListItem

2007-10-03 Thread swaroop belur


Look up how requesttargets work in wicket. In particular
look up ListenerInterfaceRequestTarget for this use case.
It just knows how to call ur component(link for example)
in ur page object. Call will land in onLinkClicked.

-swaroop






Christopher Gardner-2 wrote:
> 
> Thank you.  I got this to work.  Now I'm wondering how the
> ILinkListener gets registered to pick up the event.  Does anything
> that happens to implement that interface automatically get registered?
> 
> On 10/3/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
>> Yes, but odds are you already had to do that, to override populateItem().
>>
>> Martijn
>>
>> On 10/3/07, Christopher Gardner <[EMAIL PROTECTED]> wrote:
>> > Do you also have to subclass ListView (overriding newItem()) to create
>> > an object of the ListItem subclass?
>> >
>> > On 10/3/07, Maurice Marrink <[EMAIL PROTECTED]> wrote:
>> > > Yes you can, The trick is to extend ListItem and have it implement
>> > > ILinkListener you can then add the onclick behavior through an
>> > > attributemodifier or override oncomponenttag. To prevent having to
>> > > make a subclass per page you should make the onLinkClicked method in
>> > > your listitem redirect to a method in your listview.
>> > >
>> > > I could show you our code but it is cluttered with non relevant code,
>> > > and the above really says it all.
>> > >
>> > > Maurice
>> > >
>> > > On 10/3/07, Christopher Gardner <[EMAIL PROTECTED]> wrote:
>> > > > With a ListView is there a way to actually create a Link component
>> > > > that encompasses the whole ListItem, such that when you click
>> anywhere
>> > > > on a row the onClick event is fired?  I know you can do this with
>> Ajax
>> > > > support, but I'm curious if you can do this using the traditional
>> way,
>> > > > i.e., with a full page refresh.  I don't want to add a "click here"
>> > > > button to my row.
>> > > >
>> > > >
>> -
>> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > > > For additional commands, e-mail: [EMAIL PROTECTED]
>> > > >
>> > > >
>> > >
>> > > -
>> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > > For additional commands, e-mail: [EMAIL PROTECTED]
>> > >
>> > >
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>>
>> --
>> Buy Wicket in Action: http://manning.com/dashorst
>> Apache Wicket 1.3.0-beta3 is released
>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Adding-a-Link-for-a-Whole-ListItem-tf4561727.html#a13032210
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Adding a Link for a Whole ListItem

2007-10-03 Thread Christopher Gardner
Thank you.  I got this to work.  Now I'm wondering how the
ILinkListener gets registered to pick up the event.  Does anything
that happens to implement that interface automatically get registered?

On 10/3/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> Yes, but odds are you already had to do that, to override populateItem().
>
> Martijn
>
> On 10/3/07, Christopher Gardner <[EMAIL PROTECTED]> wrote:
> > Do you also have to subclass ListView (overriding newItem()) to create
> > an object of the ListItem subclass?
> >
> > On 10/3/07, Maurice Marrink <[EMAIL PROTECTED]> wrote:
> > > Yes you can, The trick is to extend ListItem and have it implement
> > > ILinkListener you can then add the onclick behavior through an
> > > attributemodifier or override oncomponenttag. To prevent having to
> > > make a subclass per page you should make the onLinkClicked method in
> > > your listitem redirect to a method in your listview.
> > >
> > > I could show you our code but it is cluttered with non relevant code,
> > > and the above really says it all.
> > >
> > > Maurice
> > >
> > > On 10/3/07, Christopher Gardner <[EMAIL PROTECTED]> wrote:
> > > > With a ListView is there a way to actually create a Link component
> > > > that encompasses the whole ListItem, such that when you click anywhere
> > > > on a row the onClick event is fired?  I know you can do this with Ajax
> > > > support, but I'm curious if you can do this using the traditional way,
> > > > i.e., with a full page refresh.  I don't want to add a "click here"
> > > > button to my row.
> > > >
> > > > -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Buy Wicket in Action: http://manning.com/dashorst
> Apache Wicket 1.3.0-beta3 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Adding a Link for a Whole ListItem

2007-10-03 Thread Martijn Dashorst
Yes, but odds are you already had to do that, to override populateItem().

Martijn

On 10/3/07, Christopher Gardner <[EMAIL PROTECTED]> wrote:
> Do you also have to subclass ListView (overriding newItem()) to create
> an object of the ListItem subclass?
>
> On 10/3/07, Maurice Marrink <[EMAIL PROTECTED]> wrote:
> > Yes you can, The trick is to extend ListItem and have it implement
> > ILinkListener you can then add the onclick behavior through an
> > attributemodifier or override oncomponenttag. To prevent having to
> > make a subclass per page you should make the onLinkClicked method in
> > your listitem redirect to a method in your listview.
> >
> > I could show you our code but it is cluttered with non relevant code,
> > and the above really says it all.
> >
> > Maurice
> >
> > On 10/3/07, Christopher Gardner <[EMAIL PROTECTED]> wrote:
> > > With a ListView is there a way to actually create a Link component
> > > that encompasses the whole ListItem, such that when you click anywhere
> > > on a row the onClick event is fired?  I know you can do this with Ajax
> > > support, but I'm curious if you can do this using the traditional way,
> > > i.e., with a full page refresh.  I don't want to add a "click here"
> > > button to my row.
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Adding a Link for a Whole ListItem

2007-10-03 Thread Christopher Gardner
Do you also have to subclass ListView (overriding newItem()) to create
an object of the ListItem subclass?

On 10/3/07, Maurice Marrink <[EMAIL PROTECTED]> wrote:
> Yes you can, The trick is to extend ListItem and have it implement
> ILinkListener you can then add the onclick behavior through an
> attributemodifier or override oncomponenttag. To prevent having to
> make a subclass per page you should make the onLinkClicked method in
> your listitem redirect to a method in your listview.
>
> I could show you our code but it is cluttered with non relevant code,
> and the above really says it all.
>
> Maurice
>
> On 10/3/07, Christopher Gardner <[EMAIL PROTECTED]> wrote:
> > With a ListView is there a way to actually create a Link component
> > that encompasses the whole ListItem, such that when you click anywhere
> > on a row the onClick event is fired?  I know you can do this with Ajax
> > support, but I'm curious if you can do this using the traditional way,
> > i.e., with a full page refresh.  I don't want to add a "click here"
> > button to my row.
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Adding a Link for a Whole ListItem

2007-10-03 Thread Maurice Marrink
Yes you can, The trick is to extend ListItem and have it implement
ILinkListener you can then add the onclick behavior through an
attributemodifier or override oncomponenttag. To prevent having to
make a subclass per page you should make the onLinkClicked method in
your listitem redirect to a method in your listview.

I could show you our code but it is cluttered with non relevant code,
and the above really says it all.

Maurice

On 10/3/07, Christopher Gardner <[EMAIL PROTECTED]> wrote:
> With a ListView is there a way to actually create a Link component
> that encompasses the whole ListItem, such that when you click anywhere
> on a row the onClick event is fired?  I know you can do this with Ajax
> support, but I'm curious if you can do this using the traditional way,
> i.e., with a full page refresh.  I don't want to add a "click here"
> button to my row.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Adding a Link for a Whole ListItem

2007-10-03 Thread Christopher Gardner
With a ListView is there a way to actually create a Link component
that encompasses the whole ListItem, such that when you click anywhere
on a row the onClick event is fired?  I know you can do this with Ajax
support, but I'm curious if you can do this using the traditional way,
i.e., with a full page refresh.  I don't want to add a "click here"
button to my row.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]