wicket ajax question

2012-07-17 Thread mlabs
I have a panel with some content.
It has an AjaxLink that I use to refresh the panel. In the onclick handler I
refresh the content and target.add(component..) .. that all works great...
but I want to do it another way.

I add an AbstractAjaxBehavior to the panel, because I want to make ajax
calls to it from the client.

I override renderHead() to put some JS in the client header that I can use
later to call back to my panel - it is a JS object with a function that sets
up a $.ajax() call using the callbackURL of my behavior...

I override onRequest() to catch the incoming ajax call... sure enough it
gets hit in the debugger...
I do my internal refresh of my panel's model ...
Now I need to get it to re-render.. the AjaxLink did this via
target.add(..component), so I figured I would get myself an
AjaxRequestTarget and do the same:
WebApplication app = (WebApplication)getComponent().getApplication();
AjaxRequestTarget target =
app.newAjaxRequestTarget(getComponent().getPage());

... then target.add(..component..) as before...

however this time the panel doesn't appear to redraw...

what am I missing?
TIA



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-ajax-question-tp4650579.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: wicket ajax question

2012-07-17 Thread mlabs
the problem was that i wasn't passing the target back as the response..
found it better to reuse the wicket ajax stuff when it comes to updating
wicket panels...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-ajax-question-tp4650579p4650583.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: WICKET AJAX QUESTION

2012-02-06 Thread Andrea Del Bene
How are you attempting to clean textbox? For example you could clear 
textbox setting model object to empty string and adding textbox to 
AjaxRequestTarget.




Hi, i have one textbox.  we send the value of text box to listchoice. On add
button , we used ajax. But i am unable to clear the textbox value after
successfully add. Plz help me.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WICKET-AJAX-QUESTION-tp4361992p4361992.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: Ajax question

2007-10-19 Thread Doug Leeper

Gerolf...thanks for the tip.  Very useful tool.


Anyway I figured out a workaround.  I placed my tree in a div and had the
menu listen on the div for contextmenu events.  Even though I resend the
tree in an Ajax call, the contextmenu still works without resending the menu
creation stuff.
-- 
View this message in context: 
http://www.nabble.com/Ajax-question-tf4644668.html#a13296296
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Ajax question

2007-10-19 Thread Gerolf Seitz
On 10/19/07, Doug Leeper [EMAIL PROTECTED] wrote:


 At this point, I am not sure what I need to do to debug.  Is there any JS

debugging tools that I could use in Firefox that anyone would recommend?


you definitely want to use firefug [0] for that purpose.

Gerolf

[0] https://addons.mozilla.org/en-US/firefox/addon/1843


--
 View this message in context:
 http://www.nabble.com/Ajax-question-tf4644668.html#a13288186
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: Ajax question

2007-10-18 Thread Matej Knopp
Hi, what wicket version are you using and how do you re-invoke the
javascript on ajax update? if you are using wicket 1.3 the best way to
do invoke the javascript is using
IHeaderResponse.renderOnDomReadyJavascript (works on regular page
refresh and also on ajax update).

-Matej

On 10/18/07, Doug Leeper [EMAIL PROTECTED] wrote:

 I have a question that I hopefully someone will be able to answer.

 I have created a Wicket based framework on top of YUI Context menu in
 wicketstuff (menu2).  Everything works as expected.  It can be used on
 Tree/Table for those that are interested.

 However, the issue that I have come across is that the menu stops working
 when I send back the component that the contextmenu is listening on.  I
 understand that the DOM has changed and the menu needs to be recreated to
 reestablish its association.  What I don't know is what is the best way to
 reestablish the contextmenu.  I resend the Javascript to recreate the menu
 but that doesn't work.  Is there something that I am missing?  How do I have
 the YUI ContextMenu (in Javascript) re-listen on the recently sent
 component?

 Thanks in advance,
 - Doug

 P.S.  If you are interested in having a ContextMenu for your Wicket
 Application, please check out package
 org.wicketstuff.yui.markup.html.menu2.contextMenu.  Please be aware that
 this is a work in progress but does work.  There is also a working example
 in the wicketstuff-yui-examples.  I hope to have an example for Tree up very
 soon.
 --
 View this message in context: 
 http://www.nabble.com/Ajax-question-tf4644668.html#a13267305
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Ajax question

2007-10-18 Thread Doug Leeper

I am using 1.3 (Trunk).

I am calling AjaxRequestTarget.target.appendJavascript() right after i call
AjaxRequestTarget.target.addComponent().  Is this the right approach?

Do I have access to IHeaderResponse in an Ajax call?

Thanks
- Doug


-- 
View this message in context: 
http://www.nabble.com/Ajax-question-tf4644668.html#a13277031
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Ajax question

2007-10-18 Thread Doug Leeper

FYI...there is a working example of this problem in the
wicketstuff-yui-examples project under Context Menu 2 - Tree
-- 
View this message in context: 
http://www.nabble.com/Ajax-question-tf4644668.html#a13278196
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Ajax question

2007-10-18 Thread James McLaughlin
On 10/18/07, Doug Leeper [EMAIL PROTECTED] wrote:

 I am using 1.3 (Trunk).

 I am calling AjaxRequestTarget.target.appendJavascript() right after i call
 AjaxRequestTarget.target.addComponent().  Is this the right approach?

 Do I have access to IHeaderResponse in an Ajax call?

Have your component implement IHeaderContributor and override
 void renderHead(final IHeaderResponse response);


 Thanks
 - Doug



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



Re: Ajax question

2007-10-18 Thread Doug Leeper

I just found this.

With a AjaxRequestTarget, you can get the HeaderResponse.

Unfortunately, it still doesn't work :-(
-- 
View this message in context: 
http://www.nabble.com/Ajax-question-tf4644668.html#a13279426
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Ajax question

2007-10-18 Thread Matej Knopp
You should make your component implement IHeaderContributor. Or your
behavior, depends on how you implement your menu. Then you don't have
to worry about AjaxRequestTarget.

-Matej

On 10/18/07, Doug Leeper [EMAIL PROTECTED] wrote:

 I just found this.

 With a AjaxRequestTarget, you can get the HeaderResponse.

 Unfortunately, it still doesn't work :-(
 --
 View this message in context: 
 http://www.nabble.com/Ajax-question-tf4644668.html#a13279426
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Ajax question

2007-10-18 Thread Doug Leeper

My Behavior extends AbstractDefaultAjaxBehavior which implements
IHeaderContributor.

There are no components involved except the one that is to be listened in
on for client side clicks.

At this point, I am not sure what I need to do to debug.  Is there any JS
debugging tools that I could use in Firefox that anyone would recommend?
-- 
View this message in context: 
http://www.nabble.com/Ajax-question-tf4644668.html#a13288186
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Ajax question

2007-10-17 Thread Doug Leeper

I have a question that I hopefully someone will be able to answer.

I have created a Wicket based framework on top of YUI Context menu in
wicketstuff (menu2).  Everything works as expected.  It can be used on
Tree/Table for those that are interested.

However, the issue that I have come across is that the menu stops working
when I send back the component that the contextmenu is listening on.  I
understand that the DOM has changed and the menu needs to be recreated to
reestablish its association.  What I don't know is what is the best way to
reestablish the contextmenu.  I resend the Javascript to recreate the menu
but that doesn't work.  Is there something that I am missing?  How do I have
the YUI ContextMenu (in Javascript) re-listen on the recently sent
component?

Thanks in advance,
- Doug

P.S.  If you are interested in having a ContextMenu for your Wicket
Application, please check out package
org.wicketstuff.yui.markup.html.menu2.contextMenu.  Please be aware that
this is a work in progress but does work.  There is also a working example
in the wicketstuff-yui-examples.  I hope to have an example for Tree up very
soon.
-- 
View this message in context: 
http://www.nabble.com/Ajax-question-tf4644668.html#a13267305
Sent from the Wicket - User mailing list archive at Nabble.com.


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