On Thu, 2 Aug 2007 18:25:28 +0200
Federico Fanton <[EMAIL PROTECTED]> wrote:

> > I'm sorry, I'm looking for a way to show an alert dialog when a condition 
> > is met.. For example, the user fills in a "search form", submits it and if 
> > there's no data matching the query, a "no data found!" should pop up.. I'd 
> > like to use something like the "alert" JavaScript function, but I'm a bit 
> > confused about where to put it.. ^^;
>
> class alert extends abstractbehavior {
>  boolean istemporary() { return false; }
>  void renderhead(iheaderresponse r) {
> renderonloadjavascript("alert('error!');"); }
> }
> 
> form searchform=new form(...) {
>   onerror() { add(new alert(); }
> }

I tried as you suggested, but I'm facing a little problem.. If I'm not 
mistaken, "onError" is called on form validation, so I added my check for "no 
data" in a FormValidator.. My problem is that this check needs the form 
CompoundPropertyModel to be up to date with the form contents, but form 
validation is called *before* the model gets updated.. Am I going the wrong 
way? :/
Many thanks for your time!


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to