As I suppose that you want to create a Javascript popup (i.e. a Wicket Link 
with PopupSettings), you need to decide wether to open the popup or not in the 
frontend (Javascript layer), not in the onClick() of the Link. So you could try 
something like this:

PopupSettings popupSettings = new PopupSettings() {
    @Override
    public String getPopupJavaScript() {
        return "if(!condition) return false; " + super.getPopupJavaScript();
    }
};

Link link = new Link("link") {
    @Override
    public void onClick() {
        // ...
    }

};
link.setPopupSettings(popupSettings);
add(link);

   -Tom



On 01.06.2012 at 16:40 hfriederichs wrote:

> For other questions I had earlier on, I created quickstarts, but, since I'm
> working on a very complex application, I couldn't reproduce the problem in a
> quickstart. I spent hours and hours copying more and more of my application
> into the quickstart, but to no avail.
> 
> So again, it's a simple question: how to make a conditional popup.


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

Reply via email to