Oh. I feel stupid haha
Thanks.


tohtori wrote:
> 
> 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>
>>  # The Link 
>> </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: [email protected]
> For additional commands, e-mail: [email protected]
> 

-- 
View this message in context: 
http://www.nabble.com/Markup%27s-isVisible-method-being-called-multiple-times-tp23114670p23114933.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to