Hi Henrique,

Answer can be found from javadoc

   /**
    * Gets whether this component and any children are visible.
    * <p>
* *WARNING: this method can be called multiple times during a request. If you override this* * method, it is a good idea to keep it cheap in terms of processing. Alternatively, you can
    * call {...@link #setVisible(boolean)}.
    * <p>
    *
    * @return True if component and any children are visible
    */
   public boolean isVisible()
   {
       return getFlag(FLAG_VISIBLE);
   }

-MSi


Henrique Boregio wrote:
I am overriding the link's onVisible method to do some conditional
markup. I've realized that this method is actually being call 4 times.
When I add a simple System.out to the following code, I get the
corresponding resut:


MyPAGE.JAVA

public class MyPage extends WebPage {
  public MyPage(final PageParameters parameters) {

    add(new Link("link") {
                public boolean isVisible() {
                   System.out.println("here i am");
                   return false;
                }
    }
  }
}

PAGE.HTML
<html><body>
<a href="#" wicket:id="link">The Link</a>
</body></html>

RESULT
here i am
here i am
here i am
here i am

Any ideas why this method is being called 4 times?
Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to