Hi my wicket friends,

There is fast way to make the popup for exception handling:

try {
...
} 
catch (Exception e){
    target.appendJavascript(String.format("alert('%s')",
                                                e));
}

and AjaxSubmitLink is used.

-Mo Wu


Michael O'Cleirigh wrote:
> 
> Hi Mo,
> 
>> I tried them, I can generate the modal Window. but the AjaxLink is not
>> submit
>> link for a form. I need to show the error message only if there is form
>> processing error.
>> Should I use AjaxSubmitLink instead? or do you have some examples similar
>> to
>> this condition?
>>
>>   
> If the alerts you want to show are tied to the existence of form 
> processing errors then prehaps you should subclass FeedbackPanel to add 
> in a javascript popup alert in addition to/replacing the standard 
> behavior of displaying the form errors in an unordered list?
> 
> Or you could create a panel consisting of the modal window and the 
> activation link but tied to the existence of feedback messages.  If 
> there are zero feedback messages (the form not submitted yet case) you 
> can have the panel invisible to start with (i.e. the link would not be 
> there or say something like 'No Errors').  When there are errors present 
> the link would be visible (or say something link 'There are X errors')  
> clicking the link would show the modal window with the errors.
> 
> Normally feedback messages are expected to be consumed by the feedback 
> panels during the rendering phase so they are cleared at the end of the 
> form submission request; you might have to cache it somewhere so that 
> the modal window will have the data available it since it populates 
> itself via an ajax update after the form submitting request that 
> generated the errors has already finished. 
> 
> Regards,
> 
> Mike
> 
>> cheers, :)
>> Mo
>>
>>
>> Newgro wrote:
>>   
>>> Fkleinko wrote:
>>>     
>>>> To show the ModalWindow you need an AjaxRequestTarget.
>>>> where do you get that from?
>>>>
>>>>       
>>> AjaxLink theLinkThatWillShowTheModalWindowIfItsClicked = new
>>> AjaxLink(...)
>>> {
>>>   public void onClick(AjaxRequestTarget target) {
>>>     myModalWindow.show(target);
>>>   }
>>> }
>>>
>>> Please check the examples i gave you. It's all there.
>>>
>>> Cheers
>>> Per
>>>
>>>     
>>
>>   
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-make-a-popup-page-for-exception-handling--tp21588129p21709550.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