Re: Conditional Popup

2012-06-04 Thread hfriederichs
No suggestions? Anyone?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Conditional-Popup-tp4649649p4649706.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Conditional Popup

2012-06-04 Thread Thomas Götz
What about the AjaxLink alternative I already suggested?

   -Tom


On 04.06.2012 at 09:35 hfriederichs wrote:

 No suggestions? Anyone?


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



Re: Conditional Popup

2012-06-04 Thread hfriederichs

Thomas Götz-2 wrote
 
 As an alternative, you could use an AjaxLink and push the popup-opener JS
 to teh frontend, then you could have your decision logic (wether to open
 it or not) in the backend (Wicket layer).

 

But, how would you do that?

if  (condition) {
   info(Do this first);
} else {
   activate JS-popup-opener 
}

And furthermore, I need to pass data to the popup-page, so I would have to
stick that in the Session?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Conditional-Popup-tp4649649p4649708.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Conditional Popup

2012-06-04 Thread Thomas Götz
On 04.06.2012 at 13:21 hfriederichs wrote:

 
 Thomas Götz-2 wrote
 
 As an alternative, you could use an AjaxLink and push the popup-opener JS
 to teh frontend, then you could have your decision logic (wether to open
 it or not) in the backend (Wicket layer).
 
 
 
 But, how would you do that?
 
 if  (condition) {
   info(Do this first);
 } else {
   activate JS-popup-opener 
 }

Yes, this would be a possible solution, maybe something like that:

AjaxLink link = new AjaxLink(link) {
@Override
public void onClick(AjaxRequestTarget target) {
if (condition) {
info(...);
// target.add(feedbackPanel);
} else {
target.appendJavaScript(Wicket.$(' + myPopup.getMarkupId() + 
').open(););
}
}
};
add(link);


 And furthermore, I need to pass data to the popup-page, so I would have to
 stick that in the Session?

You could also pass a model to the Page's constructor e.g.

Cheers,
   -Tom


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



Re: Conditional Popup

2012-06-01 Thread Thomas Götz
Could you please provide a quickstart or post the interesting HTML and Java 
snippets?

   -Tom


On 01.06.2012 at 15:24 hfriederichs wrote:

 Hello,
 
 I have a wicket PopupPage that answers a wicket link, but I don't want it to
 popup when certain conditions are not met. In that case I want an
 info-message.
 
 So I tried something like:
 final LinkString theLink = new LinkString(...) {
   
 public void onClick() {
 if (condition) {
   info(Do this first);
 } else {
  setPopupSettings(thePopupSettings);  
  setResponsePage(thePopupPage);
 }
 };
 
 But no matter what I try, the popuppage always comes.
 
 
   
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Conditional-Popup-tp4649649.html
 Sent from the Users forum mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 


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



Re: Conditional Popup

2012-06-01 Thread hfriederichs
A quick-start costs me one or two hours; in the end, maybe I will. But I
think this is a reasonably simple question, so I'll await some
straightforward suggestions first.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Conditional-Popup-tp4649649p4649651.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Conditional Popup

2012-06-01 Thread Thomas Götz
To create a quickstart normally costs me around 5-7 seconds (copy/paste is my 
friend) ;-)
Isolating the problem is another question, right. But in your case this sound 
rather trivial. In my experience a lot of problems are solved easyly by 
creating a quickstart, in most cases because then I realize that I did 
something wrong ;-)

   -Tom


On 01.06.2012 at 16:06 hfriederichs wrote:

 A quick-start costs me one or two hours; in the end, maybe I will. But I
 think this is a reasonably simple question, so I'll await some
 straightforward suggestions first.


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



Re: Conditional Popup

2012-06-01 Thread hfriederichs
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.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Conditional-Popup-tp4649649p4649654.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Conditional Popup

2012-06-01 Thread Thomas Götz
As an alternative, you could use an AjaxLink and push the popup-opener JS to 
teh frontend, then you could have your decision logic (wether to open it or 
not) in the backend (Wicket layer).

   -Tom




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



Re: Conditional Popup

2012-06-01 Thread hfriederichs

Thomas Götz-2 wrote
 
 
 PopupSettings popupSettings = new PopupSettings() {
 @Override
 public String getPopupJavaScript() {
 return if(!condition) return false;  +
 super.getPopupJavaScript();
 }
 };
 
 

I'm sorry, but I don't understand your code. My condition is in the
Java/Wicket-layer, how can you put that between double quotes?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Conditional-Popup-tp4649649p4649665.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Conditional Popup

2012-06-01 Thread Thomas Götz
I thought you might have some condition that you could evaluate in JS. This is 
the reason I asked for a short quickstart, it simply eases discussion.

   -Tom


On 01.06.2012 at 19:19 hfriederichs wrote:

 I'm sorry, but I don't understand your code. My condition is in the
 Java/Wicket-layer, how can you put that between double quotes?


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