How to setResponsePage across frame based on Ajax

2009-02-13 Thread Mo Wu

Dear expert,

I extend the nested tree example in wicket. 
In Tree class, I override onNodeLinkClicked() method to setResponsePage,
when I click on the tree node.
I works fine to get the response page for the current frame. but I also want
to update the frame outside the current frame, It will not work, because the
onNodeLinkClicked(AjaxRequestTarget target, javax.swing.tree.TreeNode node)
is based on Ajax, it cannot update the frame outside, only if I refresh the
browser. 
Is there any way to accomplish this?

Best regards,

/Mo
-- 
View this message in context: 
http://www.nabble.com/How-to-setResponsePage-across-frame-based-on-Ajax-tp22005602p22005602.html
Sent from the Wicket - User 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: How to make a popup page for exception handling?

2009-01-28 Thread Mo Wu

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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to make a popup page for exception handling?

2009-01-22 Thread Mo Wu

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?

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--tp21588129p21605575.html
Sent from the Wicket - User 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: How to make a popup page for exception handling?

2009-01-22 Thread Mo Wu

what is the type of the errorWindow? Is the errorWindow a new page or a part
of the existing page?

Best regards,

Mo 


Newgro wrote:
> 
> 
>> I know how to show the exception in a feedback panel. But how to make the
>> popup dependent on the results of submission
> You could add the errorWindow to your page and in your catch you can 
> show it. But it's only working with ajax.
> 
> add errorWindow to markup and in class.
> 
> try {
>   exceptionalCode();
> } catch (TheExpectedException e) {
>   errorWindow.setModel(new Model(e));
>   errorWindow.show();
> }
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 


-- 
View this message in context: 
http://www.nabble.com/How-to-make-a-popup-page-for-exception-handling--tp21588129p21600597.html
Sent from the Wicket - User 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



How to make a popup page for exception handling?

2009-01-21 Thread Mo Wu

Dear experts,

I have one feature to be implemented, but I dont know how to do that:
I have one page, there is a form need to be submitted. after submitted, 
  1. If the results is correct, then the same page is returned.
  2. if there are some exceptions, then a popup need to be shown up and it
should also show the errorMessage. 

I know how to show the exception in a feedback panel. But how to make the
popup dependent on the results of submission.

Thanks for help!

Best regards,

Mo

-- 
View this message in context: 
http://www.nabble.com/How-to-make-a-popup-page-for-exception-handling--tp21588129p21588129.html
Sent from the Wicket - User 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



Wicket cannot setValue for the RequiredTextField

2009-01-20 Thread Mo Wu

Dear experts,

I am writing auto-test code for wicket application I developed.
In one webpage, there is one "form", and the "form" contains several
RequiredTextField (e.g. "id" and "alias").
In my test, I try to set the value for the RequiredTextField by doing:

FormTester form = tester.newFormTester("form");
form.setValue("id", "1000");
form.setValue("alias", "alias-1000");

But the value is not set, I also use the following code to confirm it:
assertEquals(form.getTextComponentValue("id"), "1000");
assertEquals(form.getTextComponentValue("alias"), "alias-1000");

I think must be something wrong with it. It works fine if use TextField
instead.

Thanks for your help!

Best regards,

Mo Wu
-- 
View this message in context: 
http://www.nabble.com/Wicket-cannot-setValue-for-the-RequiredTextField-tp21566732p21566732.html
Sent from the Wicket - User 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