Re: How to reach a component in ListView

2009-10-20 Thread Jeremy Thomerson
Better to access whether or not they should be visible from within the
components (inside the listview) themselves.  On your links, override
isVisible and have it call to some method on ListDocumentForObject that
returns boolean of whether that link should be visible.  Then this method
could be overridden by child classes with different logic.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Oct 20, 2009 at 9:21 AM, pieter claassen wrote:

> I have an abstract class that adds a ListView to the page in the
> constructor. In the constructors of my children, I would like to set some
> of
> the rows in the ListView invisible. How do I reach the Wicket Components
> that were added to a ListView from outside the Listview.
>
> e.g.
> public abstract ListDocumentsForObject{
>public ListDocumentsForObject() {
>
>ListView documents = new ListView("documents", documentlist) {
>
>@Override
>protected void populateItem(ListItem item) {
>   .
>Link delete = new ConfirmLink("delete") {
>
>
> public final class ListDocumentsForUser extends ListDocumentsForObject {
>public ListDocumentsForUser(...) {
>super(...);
>setAllDeleteButtonsVisible(false);   <-I want to set all or some
> of the delete links as invisible.
>
>
> Thanks,
> Pieter
>


How to reach a component in ListView

2009-10-20 Thread pieter claassen
I have an abstract class that adds a ListView to the page in the
constructor. In the constructors of my children, I would like to set some of
the rows in the ListView invisible. How do I reach the Wicket Components
that were added to a ListView from outside the Listview.

e.g.
public abstract ListDocumentsForObject{
public ListDocumentsForObject() {

ListView documents = new ListView("documents", documentlist) {

@Override
protected void populateItem(ListItem item) {
   .
Link delete = new ConfirmLink("delete") {


public final class ListDocumentsForUser extends ListDocumentsForObject {
public ListDocumentsForUser(...) {
super(...);
setAllDeleteButtonsVisible(false);   <-I want to set all or some
of the delete links as invisible.


Thanks,
Pieter