Re: How to access ListItem from ListView from AjaxLink?
>>> >>>> �...@override >>>> protected void populateItem(final Item item) >>>> { >>>> Contact contact = (Contact) >>>> item.getModelObject(); >>>> >>>> final Label contacteLabel = new >>>> Label("aname",contact.getName()); >>>> contacteLabel.setOutputMarkupId(true); >>>> >>>> item.add(new AjaxLink("name") { >>>> >>>> private static final long >>>> serialVersionUID = 1L; >>>> >>>> �...@override >>>> public void >>>> onClick(AjaxRequestTarget target) { >>>> >>>> if(target!= null) { >>>> >>>> contacteLabel.add(new >>>> >>>> AttributeModifier("style", true, new AbstractReadOnlyModel() { >>>> >>>> �...@override >>>> >>>> public String getObject() { >>>> >>>> return "background-color:#80b6ed;"; >>>> >>>> } >>>> >>>> })); >>>> >>>> target.addComponent(contacteLabel); >>>> } >>>> >>>> } >>>> >>>> >>>> >>>> }.add(contacteLabel)); >>>> } >>>> }; >>>> >>>> add(view); >>>> >>>> >>>> } >>>> } >>>> >>>> >>>> Regards >>>> P >>>> >>>> >>>> moontz wrote: >>>>> >>>>> i tried that before. did not work. no compile or runtime errors, but >>>>> the >>>>> source did not show the change. >>>>> >>>>> im thinking, since its an ajax link and because only the target panel >>>>> refreshes, the change to the link is not applied because the actual link >>>>> is not refreshed. only the other panel is. in which case i would need >>>>> to >>>>> append javascript. i was hping there was a pure wicket solutioin though >>>>> without using JS. >>>>> >>>>> >>>>> >>>>> igor.vaynberg wrote: >>>>>> >>>>>> final ListItem item >>>>>> >>>>>> -igor >>>>>> >>>>>> On Fri, Feb 13, 2009 at 7:36 AM, moontz wrote: >>>>>>> >>>>>>> I would like to add an attribute to the ListItem element in the markup >>>>>>> (basically change the class style) on click of the link. Below is my >>>>>>> snippet. Any insight on how I can accomplish this? Thanks in >>>>>>> advance! >>>>>>> >>>>>>> ListView lv = new ListView("tabListView", tabList) { >>>>>>> protected void populateItem(ListItem item) { >>>>>>> AjaxLink ajaxLink = new AjaxLink("tabLink", >>>>>>> item.getModel()) { >>>>>>> public void onClick(AjaxRequestTarget >>>>>>> target) >>>>>>> { >>>>>>> item.add(new >>>>>>> SimpleAttributeModifier("class", "on")); // >>>>>>> want to do this but do not have access to item object from inner class >>>>>>> -- >>>>>>> ideas for this? >>>>>>> . >>>>>>> . >>>>>>> . >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> View this message in context: >>>>>>> http://www.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p21998739.html >>>>>>> Sent from the Wicket - User mailing list archive at Nabble.com. >>>>>>> >>>>>>> >>>>>>> - >>>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>>>>> >>>>>>> >>>>>> >>>>>> - >>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> -- >>>> View this message in context: >>>> http://old.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p27867306.html >>>> Sent from the Wicket - User mailing list archive at Nabble.com. >>>> >>>> >>>> - >>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>> >>>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> >> >> -- >> View this message in context: >> http://old.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p27870307.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to access ListItem from ListView from AjaxLink?
stractReadOnlyModel() { >>> >>> �...@override >>> >>> public String getObject() { >>> >>> return "background-color:#80b6ed;"; >>> >>> } >>> >>> })); >>> >>> target.addComponent(contacteLabel); >>> } >>> >>> } >>> >>> >>> >>> }.add(contacteLabel)); >>> } >>> }; >>> >>> add(view); >>> >>> >>> } >>> } >>> >>> >>> Regards >>> P >>> >>> >>> moontz wrote: >>>> >>>> i tried that before. did not work. no compile or runtime errors, but >>>> the >>>> source did not show the change. >>>> >>>> im thinking, since its an ajax link and because only the target panel >>>> refreshes, the change to the link is not applied because the actual link >>>> is not refreshed. only the other panel is. in which case i would need >>>> to >>>> append javascript. i was hping there was a pure wicket solutioin though >>>> without using JS. >>>> >>>> >>>> >>>> igor.vaynberg wrote: >>>>> >>>>> final ListItem item >>>>> >>>>> -igor >>>>> >>>>> On Fri, Feb 13, 2009 at 7:36 AM, moontz wrote: >>>>>> >>>>>> I would like to add an attribute to the ListItem element in the markup >>>>>> (basically change the class style) on click of the link. Below is my >>>>>> snippet. Any insight on how I can accomplish this? Thanks in >>>>>> advance! >>>>>> >>>>>> ListView lv = new ListView("tabListView", tabList) { >>>>>> protected void populateItem(ListItem item) { >>>>>> AjaxLink ajaxLink = new AjaxLink("tabLink", >>>>>> item.getModel()) { >>>>>> public void onClick(AjaxRequestTarget >>>>>> target) >>>>>> { >>>>>> item.add(new >>>>>> SimpleAttributeModifier("class", "on")); // >>>>>> want to do this but do not have access to item object from inner class >>>>>> -- >>>>>> ideas for this? >>>>>> . >>>>>> . >>>>>> . >>>>>> >>>>>> >>>>>> -- >>>>>> View this message in context: >>>>>> http://www.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p21998739.html >>>>>> Sent from the Wicket - User mailing list archive at Nabble.com. >>>>>> >>>>>> >>>>>> - >>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>>>> >>>>>> >>>>> >>>>> - >>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>>> >>>>> >>>>> >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://old.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p27867306.html >>> Sent from the Wicket - User mailing list archive at Nabble.com. >>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > > -- > View this message in context: > http://old.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p27870307.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to access ListItem from ListView from AjaxLink?
d not work. no compile or runtime errors, but >>> the >>> source did not show the change. >>> >>> im thinking, since its an ajax link and because only the target panel >>> refreshes, the change to the link is not applied because the actual link >>> is not refreshed. only the other panel is. in which case i would need >>> to >>> append javascript. i was hping there was a pure wicket solutioin though >>> without using JS. >>> >>> >>> >>> igor.vaynberg wrote: >>>> >>>> final ListItem item >>>> >>>> -igor >>>> >>>> On Fri, Feb 13, 2009 at 7:36 AM, moontz wrote: >>>>> >>>>> I would like to add an attribute to the ListItem element in the markup >>>>> (basically change the class style) on click of the link. Below is my >>>>> snippet. Any insight on how I can accomplish this? Thanks in >>>>> advance! >>>>> >>>>> ListView lv = new ListView("tabListView", tabList) { >>>>> protected void populateItem(ListItem item) { >>>>> AjaxLink ajaxLink = new AjaxLink("tabLink", >>>>> item.getModel()) { >>>>> public void onClick(AjaxRequestTarget >>>>> target) >>>>> { >>>>> item.add(new >>>>> SimpleAttributeModifier("class", "on")); // >>>>> want to do this but do not have access to item object from inner class >>>>> -- >>>>> ideas for this? >>>>> . >>>>> . >>>>> . >>>>> >>>>> >>>>> -- >>>>> View this message in context: >>>>> http://www.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p21998739.html >>>>> Sent from the Wicket - User mailing list archive at Nabble.com. >>>>> >>>>> >>>>> - >>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>>> >>>>> >>>> >>>> - >>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>> >>>> >>>> >>> >>> >> >> -- >> View this message in context: >> http://old.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p27867306.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://old.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p27870307.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to access ListItem from ListView from AjaxLink?
gt;> (basically change the class style) on click of the link. Below is my >>>> snippet. Any insight on how I can accomplish this? Thanks in advance! >>>> >>>> ListView lv = new ListView("tabListView", tabList) { >>>> protected void populateItem(ListItem item) { >>>> AjaxLink ajaxLink = new AjaxLink("tabLink", >>>> item.getModel()) { >>>> public void onClick(AjaxRequestTarget target) >>>> { >>>> item.add(new >>>> SimpleAttributeModifier("class", "on")); // >>>> want to do this but do not have access to item object from inner class >>>> -- >>>> ideas for this? >>>> . >>>> . >>>> . >>>> >>>> >>>> -- >>>> View this message in context: >>>> http://www.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p21998739.html >>>> Sent from the Wicket - User mailing list archive at Nabble.com. >>>> >>>> >>>> - >>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>> >>>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> >> >> > > -- > View this message in context: > http://old.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p27867306.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to access ListItem from ListView from AjaxLink?
Hi I have got a refreshing view ,it contains list of links.I need to highlight the link when i click on that link. It works properly but if i click the next item in the list,the previous text remains highlighted. First Name # public class RefreshingPage extends BasePage { public RefreshingPage() { final List contacts = new ArrayList(10); // populate list of contacts to be displayed Iterator it = rgetContacts().iterator(); while (it.hasNext()) { contacts.add(new Model(it.next())); } // create the refreshing view RefreshingView view = new RefreshingView("view") { /** * Return an iterator over models for items in the view */ @Override protected Iterator getItemModels() { return contacts.iterator(); } @Override protected void populateItem(final Item item) { Contact contact = (Contact) item.getModelObject(); final Label contacteLabel = new Label("aname",contact.getName()); contacteLabel.setOutputMarkupId(true); item.add(new AjaxLink("name") { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { if(target!= null) { contacteLabel.add(new AttributeModifier("style", true, new AbstractReadOnlyModel() { @Override public String getObject() { return "background-color:#80b6ed;"; } })); target.addComponent(contacteLabel); } } }.add(contacteLabel)); } }; add(view); } } Regards P moontz wrote: > > i tried that before. did not work. no compile or runtime errors, but the > source did not show the change. > > im thinking, since its an ajax link and because only the target panel > refreshes, the change to the link is not applied because the actual link > is not refreshed. only the other panel is. in which case i would need to > append javascript. i was hping there was a pure wicket solutioin though > without using JS. > > > > igor.vaynberg wrote: >> >> final ListItem item >> >> -igor >> >> On Fri, Feb 13, 2009 at 7:36 AM, moontz wrote: >>> >>> I would like to add an attribute to the ListItem element in the markup >>> (basically change the class style) on click of the link. Below is my >>> snippet. Any insight on how I can accomplish this? Thanks in advance! >>> >>> ListView lv = new ListView("tabListView", tabList) { >>> protected void populateItem(ListItem item) { >>> AjaxLink ajaxLink = new AjaxLink("tabLink", >>> item.getModel()) { >>> public void onClick(AjaxRequestTarget target) >>> { >>>item.add(new >>> SimpleAttributeModifier("class", "on")); // >>> want to do this but do not have access to item object from inner class >>> -- >>> ideas for this? >>> . >>> . >>> . >>> >>> >>> -- >>> View this message in context: >>&g
Re: How to access ListItem from ListView from AjaxLink?
i tried that before. did not work. no compile or runtime errors, but the source did not show the change. im thinking, since its an ajax link and because only the target panel refreshes, the change to the link is not applied because the actual link is not refreshed. only the other panel is. in which case i would need to append javascript. i was hping there was a pure wicket solutioin though without using JS. igor.vaynberg wrote: > > final ListItem item > > -igor > > On Fri, Feb 13, 2009 at 7:36 AM, moontz wrote: >> >> I would like to add an attribute to the ListItem element in the markup >> (basically change the class style) on click of the link. Below is my >> snippet. Any insight on how I can accomplish this? Thanks in advance! >> >> ListView lv = new ListView("tabListView", tabList) { >> protected void populateItem(ListItem item) { >> AjaxLink ajaxLink = new AjaxLink("tabLink", >> item.getModel()) { >> public void onClick(AjaxRequestTarget target) { >>item.add(new >> SimpleAttributeModifier("class", "on")); // >> want to do this but do not have access to item object from inner class >> -- >> ideas for this? >> . >> . >> . >> >> >> -- >> View this message in context: >> http://www.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p21998739.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > ----------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p22001477.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to access ListItem from ListView from AjaxLink?
final ListItem item -igor On Fri, Feb 13, 2009 at 7:36 AM, moontz wrote: > > I would like to add an attribute to the ListItem element in the markup > (basically change the class style) on click of the link. Below is my > snippet. Any insight on how I can accomplish this? Thanks in advance! > > ListView lv = new ListView("tabListView", tabList) { > protected void populateItem(ListItem item) { > AjaxLink ajaxLink = new AjaxLink("tabLink", > item.getModel()) { > public void onClick(AjaxRequestTarget target) { >item.add(new > SimpleAttributeModifier("class", "on")); // > want to do this but do not have access to item object from inner class -- > ideas for this? > . > . > . > > > -- > View this message in context: > http://www.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p21998739.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to access ListItem from ListView from AjaxLink?
I would like to add an attribute to the ListItem element in the markup (basically change the class style) on click of the link. Below is my snippet. Any insight on how I can accomplish this? Thanks in advance! ListView lv = new ListView("tabListView", tabList) { protected void populateItem(ListItem item) { AjaxLink ajaxLink = new AjaxLink("tabLink", item.getModel()) { public void onClick(AjaxRequestTarget target) { item.add(new SimpleAttributeModifier("class", "on")); // want to do this but do not have access to item object from inner class -- ideas for this? . . . -- View this message in context: http://www.nabble.com/How-to-access-ListItem-from-ListView-from-AjaxLink--tp21998739p21998739.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org