You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by JeroenWolff <je...@gmail.com> on 2010/05/13 14:47:06 UTC
ListView highlight selected row
Hi, i'm a wicket newbee...i've got a ListView with a AjaxLink so the selected
'customer' details will be shown in a detailed panel. But now i would like
to highlite the selected 'customer' row in de ListView so the user can see
which row he/she selected.
How can i do this?
Thanks,
Jeroen
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2197486.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ListView highlight selected row
Posted by Jeremy Thomerson <je...@wickettraining.com>.
Ah - the beauty of creating a quickstart. It almost always makes us go back
and see what other weird combination of things is actually creating the
issue :)
--
Jeremy Thomerson
http://www.wickettraining.com
On Thu, May 20, 2010 at 3:18 PM, JeroenWolff <je...@gmail.com> wrote:
>
> Now i've got it working with the quickstart and a simple ListView. Now i
> have
> to find out the difference and why it is now working..,now working on
> jetty...tomorrow i test it on Websphere...
>
> Thanks!
>
>
> public class HomePage extends WebPage {
> private Contact selected = new Contact();
>
> @SuppressWarnings("serial")
> public HomePage(final PageParameters parameters) {
>
> final WebMarkupContainer table = new
> WebMarkupContainer("table");
> PageableListView<Contact> listView = new
> PageableListView<Contact>(
> "contactrow", getContacts(), 4) {
>
> @Override
> protected ListItem<Contact> newItem(int index) {
> ListItem<Contact> item = new
> ListItem<Contact>(index,
> getListItemModel(getModel(),
> index)) {
>
> @Override
> protected void
> onComponentTag(ComponentTag tag) {
> super.onComponentTag(tag);
> if (getModelObject() ==
> selected) {
> tag.put("class",
> "selected");
> }
> }
>
> };
> return item;
> }
>
> @Override
> protected void populateItem(final ListItem<Contact>
> item) {
> Contact contact = item.getModelObject();
>
> final AjaxFallbackLink<Contact>
> contactDateLink = new
> AjaxFallbackLink<Contact>(
> "link") {
>
> @Override
> public void
> onClick(AjaxRequestTarget target) {
>
> selected = (Contact)
> getParent().getDefaultModelObject();
>
> if (target != null) {
>
> target.addComponent(table);
> }
>
> }
>
> };
> contactDateLink.add(new Label("linklabel",
> contact.getContactDate().toString()));
> item.add(contactDateLink);
> item.add(new Label("code",
> contact.getCode()));
> item.add(new Label("description",
> contact.getDescription()));
> }
>
> };
> table.setOutputMarkupId(true);
> table.add(listView);
> add(table);
> add(new AjaxPagingNavigator("navigator", listView));
>
> }
>
> public static List<Contact> getContacts() {
> List<Contact> resultList = new ArrayList<Contact>();
> Contact contact = new Contact("A", new Date(),
> "description1");
> resultList.add(contact);
> contact = new Contact("B", new Date(), "description2");
> resultList.add(contact);
> contact = new Contact("C", new Date(), "description3");
> resultList.add(contact);
> contact = new Contact("D", new Date(), "description4");
> resultList.add(contact);
> return resultList;
> }
>
> }
>
> @SuppressWarnings("serial")
> class Contact implements Serializable {
> private String code;
> private Date contactDate;
> private String description;
>
> public Contact() {
> super();
> }
>
> public Contact(String code, Date contactDate, String description) {
> super();
> this.code = code;
> this.contactDate = contactDate;
> this.description = description;
> }
>
> public String getCode() {
> return code;
> }
>
> public void setCode(String code) {
> this.code = code;
> }
>
> public Date getContactDate() {
> return contactDate;
> }
>
> public void setContactDate(Date contactDate) {
> this.contactDate = contactDate;
> }
>
> public String getDescription() {
> return description;
> }
>
> public void setDescription(String description) {
> this.description = description;
> }
>
> }
>
>
>
> <body>
> <table wicket:id="table">
> <tbody>
> <tr>
> <th style="width: 20px"></th>
> <th style="width:
> 105px;">ContactDate</th>
> <th>Description</th>
> </tr>
> <tr wicket:id="contactrow" bgcolor="#FFFFFF"
> onmouseover="this.bgColor='gold';"
>
> onmouseout="this.bgColor='#FFFFFF';">
> <td>[code]</td>
> <td> # [10/5/2010] </td>
> <td>[desc]</td>
> </tr>
> </tbody>
> </table>
> <div id="navigator" wicket:id="navigator"></div>
> </body>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2225237.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: ListView highlight selected row
Posted by JeroenWolff <je...@gmail.com>.
Now i've got it working with the quickstart and a simple ListView. Now i have
to find out the difference and why it is now working..,now working on
jetty...tomorrow i test it on Websphere...
Thanks!
public class HomePage extends WebPage {
private Contact selected = new Contact();
@SuppressWarnings("serial")
public HomePage(final PageParameters parameters) {
final WebMarkupContainer table = new WebMarkupContainer("table");
PageableListView<Contact> listView = new PageableListView<Contact>(
"contactrow", getContacts(), 4) {
@Override
protected ListItem<Contact> newItem(int index) {
ListItem<Contact> item = new ListItem<Contact>(index,
getListItemModel(getModel(), index)) {
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
if (getModelObject() == selected) {
tag.put("class", "selected");
}
}
};
return item;
}
@Override
protected void populateItem(final ListItem<Contact> item) {
Contact contact = item.getModelObject();
final AjaxFallbackLink<Contact> contactDateLink = new
AjaxFallbackLink<Contact>(
"link") {
@Override
public void onClick(AjaxRequestTarget target) {
selected = (Contact) getParent().getDefaultModelObject();
if (target != null) {
target.addComponent(table);
}
}
};
contactDateLink.add(new Label("linklabel",
contact.getContactDate().toString()));
item.add(contactDateLink);
item.add(new Label("code", contact.getCode()));
item.add(new Label("description", contact.getDescription()));
}
};
table.setOutputMarkupId(true);
table.add(listView);
add(table);
add(new AjaxPagingNavigator("navigator", listView));
}
public static List<Contact> getContacts() {
List<Contact> resultList = new ArrayList<Contact>();
Contact contact = new Contact("A", new Date(), "description1");
resultList.add(contact);
contact = new Contact("B", new Date(), "description2");
resultList.add(contact);
contact = new Contact("C", new Date(), "description3");
resultList.add(contact);
contact = new Contact("D", new Date(), "description4");
resultList.add(contact);
return resultList;
}
}
@SuppressWarnings("serial")
class Contact implements Serializable {
private String code;
private Date contactDate;
private String description;
public Contact() {
super();
}
public Contact(String code, Date contactDate, String description) {
super();
this.code = code;
this.contactDate = contactDate;
this.description = description;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Date getContactDate() {
return contactDate;
}
public void setContactDate(Date contactDate) {
this.contactDate = contactDate;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
<body>
<table wicket:id="table">
<tbody>
<tr>
<th style="width: 20px"></th>
<th style="width: 105px;">ContactDate</th>
<th>Description</th>
</tr>
<tr wicket:id="contactrow" bgcolor="#FFFFFF"
onmouseover="this.bgColor='gold';"
onmouseout="this.bgColor='#FFFFFF';">
<td>[code]</td>
<td> # [10/5/2010] </td>
<td>[desc]</td>
</tr>
</tbody>
</table>
<div id="navigator" wicket:id="navigator"></div>
</body>
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2225237.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ListView highlight selected row
Posted by Igor Vaynberg <ig...@gmail.com>.
maybe your javascript is overriding it
-igor
On Thu, May 20, 2010 at 12:04 PM, JeroenWolff <je...@gmail.com> wrote:
>
> thanks, it is not rendered in the html (view source in browser)
> when i disable Javascript it works fine! I will put it in the quickstart and
> report it in Jira
>
> thanks
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2225133.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: ListView highlight selected row
Posted by JeroenWolff <je...@gmail.com>.
thanks, it is not rendered in the html (view source in browser)
when i disable Javascript it works fine! I will put it in the quickstart and
report it in Jira
thanks
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2225133.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ListView highlight selected row
Posted by Igor Vaynberg <ig...@gmail.com>.
so its not rendered in markup? or its rendered in markup but you dont
see the effect? if latter its most likely a css issue, if former
create a quickstart and attach it to a jira issue.
-igor
On 5/20/10, JeroenWolff <je...@gmail.com> wrote:
>
> Igor, you are right. It is still not rendered when i do the
> super.onComponentTag after the tag.put.
>
> This is the markup for the listview. "zoekresultaat" is the id for the
> listview.
>
> When the page is rendered the first time it works fine, but not in Ajax
> updates. In the debugger is see that on the selected item the put is done,
> but i don't see it rendered.
>
> Thanks
>
>
> <table wicket:id=tabel>
> <tbody>
> <tr>
> <th style="width:20px"></th>
> <th style="width:105px;">Contactmoment</th>
> <th>Omschrijving</th>
> </tr>
> <tr wicket:id="zoekresultaat" bgcolor="#FFFFFF"
> onmouseover="this.bgColor='gold';" onmouseout="this.bgColor='#FFFFFF';">
> <td>[x]</td>
> <td> # </td>
> <td>[blabla]</td>
> </tr>
> </tbody>
> </table>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2224291.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: ListView highlight selected row
Posted by JeroenWolff <je...@gmail.com>.
Igor, you are right. It is still not rendered when i do the
super.onComponentTag after the tag.put.
This is the markup for the listview. "zoekresultaat" is the id for the
listview.
When the page is rendered the first time it works fine, but not in Ajax
updates. In the debugger is see that on the selected item the put is done,
but i don't see it rendered.
Thanks
<table wicket:id=tabel>
<tbody>
<tr>
<th style="width:20px"></th>
<th style="width:105px;">Contactmoment</th>
<th>Omschrijving</th>
</tr>
<tr wicket:id="zoekresultaat" bgcolor="#FFFFFF"
onmouseover="this.bgColor='gold';" onmouseout="this.bgColor='#FFFFFF';">
<td>[x]</td>
<td> # </td>
<td>[blabla]</td>
</tr>
</tbody>
</table>
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2224291.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ListView highlight selected row
Posted by Igor Vaynberg <ig...@gmail.com>.
no, i dont think its rendered in the super called, only prepared for
rendering so his code should work just fine.
set a breakpoint and see if its being called. also what markup is the
listview attached to?
-igor
On Tue, May 18, 2010 at 11:51 PM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> try doing the tag.put("class", "foo") BEFORE the super.onComponentTag -
> which is where the tag is rendered
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Wed, May 19, 2010 at 1:48 AM, JeroenWolff <je...@gmail.com> wrote:
>
>>
>> Igor, thanks you've helped me a lot...but now i repaint the whole table and
>> on every onComponentTag i update the class if the item is selected or not.
>> I
>> see in the debugger that onComponentTag and the tag.put("class",
>> "selected")
>> but it is not rendered.
>>
>> What do i do wrong??
>>
>> Thanks!!
>>
>> This is my code:
>>
>> public class HomePage extends BasePage {
>> private KlantContact selected = new KlantContact();
>> private Panel detailPanel = new DetailPanel("details", selected);
>> private PageableListView<KlantContact> listView = null;
>> private List<KlantContact> klantContacten = null;
>>
>> @SpringBean
>> private KlantContactDAO dao;
>>
>> public HomePage(PageParameters parameters) {
>> String bsn = parameters.getString("bsn");
>> InjectorHolder.getInjector().inject(this);
>>
>> final WebMarkupContainer tabel = new WebMarkupContainer("tabel");
>> klantContacten = dao.geefKlantContactenVanDeLaatste2Maanden(bsn,
>> new LocalDateTime());
>>
>> listView = new PageableListView<KlantContact>("zoekresultaat",
>> klantContacten, 5) {
>> private static final long serialVersionUID = 1L;
>>
>> @Override
>> protected ListItem<KlantContact> newItem(int index)
>> {
>> ListItem<KlantContact> item = new
>> ListItem<KlantContact>(index,
>> getListItemModel(getModel(),
>> index)) {
>> private static final long
>> serialVersionUID = 1L;
>>
>> @Override
>> protected void
>> onComponentTag(ComponentTag tag) {
>> super.onComponentTag(tag);
>> if (getModelObject() ==
>> selected) {
>> tag.put("class",
>> "welselected");
>> } else {
>> tag.put("class",
>> "notselected");
>> }
>> }
>>
>> };
>> item.setOutputMarkupId(true);
>> return item;
>> }
>>
>> @Override
>> protected void populateItem(final
>> ListItem<KlantContact> item) {
>> KlantContact contact =
>> item.getModelObject();
>>
>> final AjaxFallbackLink<KlantContact>
>> contactDatumLink = new
>> AjaxFallbackLink<KlantContact>(
>> "contactdatumlink") {
>> private static final long
>> serialVersionUID = 1L;
>>
>> @Override
>> public void
>> onClick(AjaxRequestTarget target) {
>> // het geselecteerde
>> KlantContact bepalen
>> selected = (KlantContact)
>> getParent()
>>
>> .getDefaultModelObject();
>> // het detailpanel vervangen
>> met een nieuw detailpanel
>> // waar de gelecteerde
>> klantcontact details op komen.
>> DetailPanel replacement =
>> new DetailPanel("details",
>> selected);
>>
>> replacement.setOutputMarkupId(true);
>>
>> detailPanel.replaceWith(replacement);
>> detailPanel = replacement;
>>
>> if (target != null) {
>>
>> target.addComponent(detailPanel);
>> // render de
>> listview opnieuw om de selected css te zetten
>>
>> target.addComponent(tabel);
>> }
>>
>> }
>>
>> };
>> contactDatumLink.add(new
>> Label("contactdatumlinklabel",
>> new
>> PropertyModel<KlantContact>(contact,
>>
>> "getContactDatumTijdDDMMYYHHMM")));
>> item.add(contactDatumLink);
>> item.add(new Label("soort",
>> contact.getContactWijze()));
>> item.add(new Label("omschrijving", contact
>> .getOmschrijving()));
>> }
>>
>> };
>> tabel.setOutputMarkupId(true);
>> listView.setOutputMarkupId(true);
>> tabel.add(listView);
>> add(tabel);
>> add(new AjaxPagingNavigator("navigator", listView));
>> detailPanel.setOutputMarkupId(true);
>> add(detailPanel);
>> }
>>
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2222348.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> 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: ListView highlight selected row
Posted by Jeremy Thomerson <je...@wickettraining.com>.
try doing the tag.put("class", "foo") BEFORE the super.onComponentTag -
which is where the tag is rendered
--
Jeremy Thomerson
http://www.wickettraining.com
On Wed, May 19, 2010 at 1:48 AM, JeroenWolff <je...@gmail.com> wrote:
>
> Igor, thanks you've helped me a lot...but now i repaint the whole table and
> on every onComponentTag i update the class if the item is selected or not.
> I
> see in the debugger that onComponentTag and the tag.put("class",
> "selected")
> but it is not rendered.
>
> What do i do wrong??
>
> Thanks!!
>
> This is my code:
>
> public class HomePage extends BasePage {
> private KlantContact selected = new KlantContact();
> private Panel detailPanel = new DetailPanel("details", selected);
> private PageableListView<KlantContact> listView = null;
> private List<KlantContact> klantContacten = null;
>
> @SpringBean
> private KlantContactDAO dao;
>
> public HomePage(PageParameters parameters) {
> String bsn = parameters.getString("bsn");
> InjectorHolder.getInjector().inject(this);
>
> final WebMarkupContainer tabel = new WebMarkupContainer("tabel");
> klantContacten = dao.geefKlantContactenVanDeLaatste2Maanden(bsn,
> new LocalDateTime());
>
> listView = new PageableListView<KlantContact>("zoekresultaat",
> klantContacten, 5) {
> private static final long serialVersionUID = 1L;
>
> @Override
> protected ListItem<KlantContact> newItem(int index)
> {
> ListItem<KlantContact> item = new
> ListItem<KlantContact>(index,
> getListItemModel(getModel(),
> index)) {
> private static final long
> serialVersionUID = 1L;
>
> @Override
> protected void
> onComponentTag(ComponentTag tag) {
> super.onComponentTag(tag);
> if (getModelObject() ==
> selected) {
> tag.put("class",
> "welselected");
> } else {
> tag.put("class",
> "notselected");
> }
> }
>
> };
> item.setOutputMarkupId(true);
> return item;
> }
>
> @Override
> protected void populateItem(final
> ListItem<KlantContact> item) {
> KlantContact contact =
> item.getModelObject();
>
> final AjaxFallbackLink<KlantContact>
> contactDatumLink = new
> AjaxFallbackLink<KlantContact>(
> "contactdatumlink") {
> private static final long
> serialVersionUID = 1L;
>
> @Override
> public void
> onClick(AjaxRequestTarget target) {
> // het geselecteerde
> KlantContact bepalen
> selected = (KlantContact)
> getParent()
>
> .getDefaultModelObject();
> // het detailpanel vervangen
> met een nieuw detailpanel
> // waar de gelecteerde
> klantcontact details op komen.
> DetailPanel replacement =
> new DetailPanel("details",
> selected);
>
> replacement.setOutputMarkupId(true);
>
> detailPanel.replaceWith(replacement);
> detailPanel = replacement;
>
> if (target != null) {
>
> target.addComponent(detailPanel);
> // render de
> listview opnieuw om de selected css te zetten
>
> target.addComponent(tabel);
> }
>
> }
>
> };
> contactDatumLink.add(new
> Label("contactdatumlinklabel",
> new
> PropertyModel<KlantContact>(contact,
>
> "getContactDatumTijdDDMMYYHHMM")));
> item.add(contactDatumLink);
> item.add(new Label("soort",
> contact.getContactWijze()));
> item.add(new Label("omschrijving", contact
> .getOmschrijving()));
> }
>
> };
> tabel.setOutputMarkupId(true);
> listView.setOutputMarkupId(true);
> tabel.add(listView);
> add(tabel);
> add(new AjaxPagingNavigator("navigator", listView));
> detailPanel.setOutputMarkupId(true);
> add(detailPanel);
> }
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2222348.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: ListView highlight selected row
Posted by JeroenWolff <je...@gmail.com>.
Igor, thanks you've helped me a lot...but now i repaint the whole table and
on every onComponentTag i update the class if the item is selected or not. I
see in the debugger that onComponentTag and the tag.put("class", "selected")
but it is not rendered.
What do i do wrong??
Thanks!!
This is my code:
public class HomePage extends BasePage {
private KlantContact selected = new KlantContact();
private Panel detailPanel = new DetailPanel("details", selected);
private PageableListView<KlantContact> listView = null;
private List<KlantContact> klantContacten = null;
@SpringBean
private KlantContactDAO dao;
public HomePage(PageParameters parameters) {
String bsn = parameters.getString("bsn");
InjectorHolder.getInjector().inject(this);
final WebMarkupContainer tabel = new WebMarkupContainer("tabel");
klantContacten = dao.geefKlantContactenVanDeLaatste2Maanden(bsn,
new LocalDateTime());
listView = new PageableListView<KlantContact>("zoekresultaat",
klantContacten, 5) {
private static final long serialVersionUID = 1L;
@Override
protected ListItem<KlantContact> newItem(int index) {
ListItem<KlantContact> item = new ListItem<KlantContact>(index,
getListItemModel(getModel(), index)) {
private static final long serialVersionUID = 1L;
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
if (getModelObject() == selected) {
tag.put("class", "welselected");
} else {
tag.put("class", "notselected");
}
}
};
item.setOutputMarkupId(true);
return item;
}
@Override
protected void populateItem(final ListItem<KlantContact> item) {
KlantContact contact = item.getModelObject();
final AjaxFallbackLink<KlantContact> contactDatumLink = new
AjaxFallbackLink<KlantContact>(
"contactdatumlink") {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
// het geselecteerde KlantContact bepalen
selected = (KlantContact) getParent()
.getDefaultModelObject();
// het detailpanel vervangen met een nieuw detailpanel
// waar de gelecteerde klantcontact details op komen.
DetailPanel replacement = new DetailPanel("details",
selected);
replacement.setOutputMarkupId(true);
detailPanel.replaceWith(replacement);
detailPanel = replacement;
if (target != null) {
target.addComponent(detailPanel);
// render de listview opnieuw om de selected css te zetten
target.addComponent(tabel);
}
}
};
contactDatumLink.add(new Label("contactdatumlinklabel",
new PropertyModel<KlantContact>(contact,
"getContactDatumTijdDDMMYYHHMM")));
item.add(contactDatumLink);
item.add(new Label("soort", contact.getContactWijze()));
item.add(new Label("omschrijving", contact
.getOmschrijving()));
}
};
tabel.setOutputMarkupId(true);
listView.setOutputMarkupId(true);
tabel.add(listView);
add(tabel);
add(new AjaxPagingNavigator("navigator", listView));
detailPanel.setOutputMarkupId(true);
add(detailPanel);
}
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2222348.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ListView highlight selected row
Posted by Igor Vaynberg <ig...@gmail.com>.
repaint the item, eg add it to the target
-igor
On Mon, May 17, 2010 at 1:30 PM, JeroenWolff <je...@gmail.com> wrote:
>
> Thanks Igor...
>
> But i forgot to tell...my app is a single page app with only Ajax
> replacements. Is it possible to click on a (Ajax) link in de
> (Pageable)ListView and replace the ListView with a changed style on the
> selected Item?
>
> now in my Ajax onClick i have target.addChildren(listView, Label.class); to
> update the Labels in the listview, but
> how can i change the Attribute of that selected Item?
>
> Thanks,
>
> Jeroen
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2220309.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: ListView highlight selected row
Posted by JeroenWolff <je...@gmail.com>.
Thanks Igor...
But i forgot to tell...my app is a single page app with only Ajax
replacements. Is it possible to click on a (Ajax) link in de
(Pageable)ListView and replace the ListView with a changed style on the
selected Item?
now in my Ajax onClick i have target.addChildren(listView, Label.class); to
update the Labels in the listview, but
how can i change the Attribute of that selected Item?
Thanks,
Jeroen
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2220309.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ListView highlight selected row
Posted by Igor Vaynberg <ig...@gmail.com>.
add(new listview(....) {
item newitem(...) {
return new item(..) {
oncomponenttag(tag) {
super.oncomponenttag(tag);
if (getmodelobject().equals(selectedobject) {
tag.put("class", "selected");
-igor
On Thu, May 13, 2010 at 5:47 AM, JeroenWolff <je...@gmail.com> wrote:
>
> Hi, i'm a wicket newbee...i've got a ListView with a AjaxLink so the selected
> 'customer' details will be shown in a detailed panel. But now i would like
> to highlite the selected 'customer' row in de ListView so the user can see
> which row he/she selected.
>
> How can i do this?
>
> Thanks,
>
> Jeroen
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/ListView-highlight-selected-row-tp2197486p2197486.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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