Re: Drag/drop multiple items

2017-01-18 Thread Maxim Solodovnik
To be fair I'm not sure :(
This magic is hidden inside DroppableBehavior code :(
And I'm afraid my "drop" handler might be overridden inside
DroppableBehavior.onConfigure

Hopefully Sebastien can help here :)

On Thu, Jan 19, 2017 at 1:48 PM, Martin Makundi <
martin.maku...@koodaripalvelut.com> wrote:

> Can you group them in javascript and detect group in wicket side, for
> example as list of ids?
>
> 2017-01-19 8:29 GMT+02:00 Maxim Solodovnik :
>
> > Hello Sebastien,
> >
> > I'm trying to implement subj.
> > JS example I'm using as POC is here [1]
> > Everything works, except for one thing: no matter how many objects I'm
> > dropping I only have 1 onDrop() event inside wicket 
> >
> > can you help me to fix/workaround this?
> > Thanks in advance!
> >
> > [1]
> > http://stackoverflow.com/questions/793559/grouping-
> > draggable-objects-with-jquery-ui-draggable
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>



-- 
WBR
Maxim aka solomax


Re: Drag/drop multiple items

2017-01-18 Thread Martin Makundi
Can you group them in javascript and detect group in wicket side, for
example as list of ids?

2017-01-19 8:29 GMT+02:00 Maxim Solodovnik :

> Hello Sebastien,
>
> I'm trying to implement subj.
> JS example I'm using as POC is here [1]
> Everything works, except for one thing: no matter how many objects I'm
> dropping I only have 1 onDrop() event inside wicket 
>
> can you help me to fix/workaround this?
> Thanks in advance!
>
> [1]
> http://stackoverflow.com/questions/793559/grouping-
> draggable-objects-with-jquery-ui-draggable
>
> --
> WBR
> Maxim aka solomax
>


Drag/drop multiple items

2017-01-18 Thread Maxim Solodovnik
Hello Sebastien,

I'm trying to implement subj.
JS example I'm using as POC is here [1]
Everything works, except for one thing: no matter how many objects I'm
dropping I only have 1 onDrop() event inside wicket 

can you help me to fix/workaround this?
Thanks in advance!

[1]
http://stackoverflow.com/questions/793559/grouping-draggable-objects-with-jquery-ui-draggable

-- 
WBR
Maxim aka solomax


ApacheCon CFP closing soon (11 February)

2017-01-18 Thread Rich Bowen
Hello, fellow Apache enthusiast. Thanks for your participation, and
interest in, the projects of the Apache Software Foundation.

I wanted to remind you that the Call For Papers (CFP) for ApacheCon
North America, and Apache: Big Data North America, closes in less than a
month. If you've been putting it off because there was lots of time
left, it's time to dig for that inspiration and get those talk proposals in.

It's also time to discuss with your developer and user community whether
there's a track of talks that you might want to propose, so that you
have more complete coverage of your project than a talk or two.

We're looking for talks directly, and indirectly, related to projects at
the Apache Software Foundation. These can be anything from in-depth
technical discussions of the projects you work with, to talks about
community, documentation, legal issues, marketing, and so on. We're also
very interested in talks about projects and services built on top of
Apache projects, and case studies of how you use Apache projects to
solve real-world problems.

We are particularly interested in presentations from Apache projects
either in the Incubator, or recently graduated. ApacheCon is where
people come to find out what technology they'll be using this time next
year.

Important URLs are:

To submit a talk for Apache: Big Data -
http://events.linuxfoundation.org/events/apache-big-data-north-america/program/cfp
To submit a talk for ApacheCon -
http://events.linuxfoundation.org/events/apachecon-north-america/program/cfp

To register for Apache: Big Data -
http://events.linuxfoundation.org/events/apache-big-data-north-america/attend/register-
To register for ApacheCon -
http://events.linuxfoundation.org/events/apachecon-north-america/attend/register-

Early Bird registration rates end March 12th, but if you're a committer
on an Apache project, you get the low committer rate, which is less than
half of the early bird rate!

For further updated about ApacheCon, follow us on Twitter, @ApacheCon,
or drop by our IRC channel, #apachecon on the Freenode IRC network. Or
contact me - rbo...@apache.org - with any questions or concerns.

Thanks!

Rich Bowen, VP Conferences, Apache Software Foundation

-- 
(You've received this email because you're on a dev@ or users@ mailing
list of an Apache Software Foundation project. For subscription and
unsubscription information, consult the headers of this email message,
as this varies from one list to another.)

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



Re: Error while calling Wicket from a JavaScript function

2017-01-18 Thread James Selvakumar
Thanks for the clear explanation Martin.

On Wed, Jan 18, 2017, 8:30 PM Martin Grigorov  wrote:

> On Wed, Jan 18, 2017 at 10:35 AM, James Selvakumar 
> wrote:
>
> > Hi Martin,
> >
> > Is it possible to return a value from the ajax behavior while responding
> to
> > the ajax call?
> > I'm trying to do something like this in the server side:
> >
> > target.appendJavaScript("foo");
> > >
> >
> > And then try to use it in my JavaScript:
> >
> > var foo = Wicket.Ajax.get({ u: window.callbackUrl });
> >
>
> .get() makes an Ajax call, so it doesn't return a value
> You can use the callback methods (complete, success, failure) to get the
> returned response from the server
>
> But I think you don't need to use 'foo' from the server as a variable.
> You really need: target.appendJavaScript("doNextStep(foo)")
> I.e. execute something else once the Ajax call returns
>
>
>
> > > //do some processing with foo
> > >
> >
> > Is this valid? Or is there a better way?
> >
> >
> >
> > On Wed, Jan 18, 2017 at 5:26 PM, James Selvakumar 
> > wrote:
> >
> > > Thanks a lot Martin. You're right. I had something else in my code and
> > > after I fixed it, I managed to make a ajax call from JavaScript.
> > >
> > > On Wed, Jan 18, 2017 at 5:07 PM, Martin Grigorov  >
> > > wrote:
> > >
> > >> There is no variable named 'a' in your code snippet.
> > >> It might be another problem.
> > >>
> > >> Martin Grigorov
> > >> Wicket Training and Consulting
> > >> https://twitter.com/mtgrigorov
> > >>
> > >> On Wed, Jan 18, 2017 at 10:04 AM, James Selvakumar <
> ja...@mcruncher.com
> > >
> > >> wrote:
> > >>
> > >> > Hi Martin,
> > >> >
> > >> > I tried your suggestion but I'm still getting the same TypeError.
> > >> >
> > >> > On Wed, Jan 18, 2017 at 4:55 PM, James Selvakumar <
> > ja...@mcruncher.com>
> > >> > wrote:
> > >> >
> > >> > > Thanks Martin for the super fast reply. I'll try that out.
> > >> > >
> > >> > > On Wed, Jan 18, 2017 at 4:54 PM, Martin Grigorov <
> > >> mgrigo...@apache.org>
> > >> > > wrote:
> > >> > >
> > >> > >> var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
> > >> > >> should be
> > >> > >> var wcall = Wicket.Ajax.get({ u: window.callbackUrl });
> > >> > >>
> > >> > >> Martin Grigorov
> > >> > >> Wicket Training and Consulting
> > >> > >> https://twitter.com/mtgrigorov
> > >> > >>
> > >> > >> On Wed, Jan 18, 2017 at 9:51 AM, James Selvakumar <
> > >> ja...@mcruncher.com>
> > >> > >> wrote:
> > >> > >>
> > >> > >> > Dear Wicket team,
> > >> > >> >
> > >> > >> > I need to make a call to a Wicket page from my JavaScript
> > function.
> > >> > >> > I followed the guide Calling Wicket from Javascript
> > >> > >> >  > >> > >> > Calling+Wicket+from+Javascript>
> > >> > >> > and managed to define an ajax behavior to respond to the
> > JavaScript
> > >> > >> call.
> > >> > >> >
> > >> > >> > My ajax behavior looks like this:
> > >> > >> >
> > >> > >> > > private final AbstractDefaultAjaxBehavior behave = new
> > >> > >> > AbstractDefaultAjaxBehavior()
> > >> > >> > > {
> > >> > >> > > protected void respond(final AjaxRequestTarget target)
> > >> > >> > > {
> > >> > >> > > LOGGER.debug("Received a request from client to get
> the
> > >> > >> > encryption key");
> > >> > >> > > target.add(new Label("foo", "Yeah I was just called
> > from
> > >> > >> > Javascript!"));
> > >> > >> > > }
> > >> > >> > >
> > >> > >> > > public void renderHead(Component component,
> IHeaderResponse
> > >> > >> response)
> > >> > >> > > {
> > >> > >> > > super.renderHead(component, response);
> > >> > >> > > String callbackUrl = getCallbackUrl().toString();
> > >> > >> > > response.render(JavaScriptHeaderItem.forScript("var
> > >> > >> > callbackUrl='" + callbackUrl + "';", "values"));
> > >> > >> > > }
> > >> > >> > > };
> > >> > >> > >
> > >> > >> > > This callback url got rendered in the page like this:
> > >> > >> >
> > >> > >> > 
> > >> > >> > > /* > >> > >> > > var callbackUrl='./wicket/page?0-1.IBehaviorListener.0-';
> > >> > >> > > /*]]>*/
> > >> > >> > > 
> > >> > >> > >
> > >> > >> >
> > >> > >> >
> > >> > >> > And here is my JavaScript code:
> > >> > >> >
> > >> > >> > > var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
> > >> > >> > > alert(wcall);
> > >> > >> > >
> > >> > >> > > But I'm getting the following error in the Wicket Ajax Debug
> > >> Window:
> > >> > >> >
> > >> > >> > *An error occurred while executing Ajax request:TypeError: a is
> > >> > >> undefined*
> > >> > >> > >
> > >> > >> >
> > >> > >> > Can someone point out what's the mistake here?
> > >> > >> >
> > >> > >> > --
> > >> > >> > Thanks & regards
> > >> > >> > James
> > >> > >> >
> > >> > >>
> > >> > >
> > >> > >
> > >> > >
> > >> > > --
> > >> > > Thanks & regards
> > >> > > James Selvakumar
> > >> > >
> > >> >
> > >> >
> > >> >
> > >> > --
> > 

Re: Error while calling Wicket from a JavaScript function

2017-01-18 Thread Martin Grigorov
On Wed, Jan 18, 2017 at 10:35 AM, James Selvakumar 
wrote:

> Hi Martin,
>
> Is it possible to return a value from the ajax behavior while responding to
> the ajax call?
> I'm trying to do something like this in the server side:
>
> target.appendJavaScript("foo");
> >
>
> And then try to use it in my JavaScript:
>
> var foo = Wicket.Ajax.get({ u: window.callbackUrl });
>

.get() makes an Ajax call, so it doesn't return a value
You can use the callback methods (complete, success, failure) to get the
returned response from the server

But I think you don't need to use 'foo' from the server as a variable.
You really need: target.appendJavaScript("doNextStep(foo)")
I.e. execute something else once the Ajax call returns



> > //do some processing with foo
> >
>
> Is this valid? Or is there a better way?
>
>
>
> On Wed, Jan 18, 2017 at 5:26 PM, James Selvakumar 
> wrote:
>
> > Thanks a lot Martin. You're right. I had something else in my code and
> > after I fixed it, I managed to make a ajax call from JavaScript.
> >
> > On Wed, Jan 18, 2017 at 5:07 PM, Martin Grigorov 
> > wrote:
> >
> >> There is no variable named 'a' in your code snippet.
> >> It might be another problem.
> >>
> >> Martin Grigorov
> >> Wicket Training and Consulting
> >> https://twitter.com/mtgrigorov
> >>
> >> On Wed, Jan 18, 2017 at 10:04 AM, James Selvakumar  >
> >> wrote:
> >>
> >> > Hi Martin,
> >> >
> >> > I tried your suggestion but I'm still getting the same TypeError.
> >> >
> >> > On Wed, Jan 18, 2017 at 4:55 PM, James Selvakumar <
> ja...@mcruncher.com>
> >> > wrote:
> >> >
> >> > > Thanks Martin for the super fast reply. I'll try that out.
> >> > >
> >> > > On Wed, Jan 18, 2017 at 4:54 PM, Martin Grigorov <
> >> mgrigo...@apache.org>
> >> > > wrote:
> >> > >
> >> > >> var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
> >> > >> should be
> >> > >> var wcall = Wicket.Ajax.get({ u: window.callbackUrl });
> >> > >>
> >> > >> Martin Grigorov
> >> > >> Wicket Training and Consulting
> >> > >> https://twitter.com/mtgrigorov
> >> > >>
> >> > >> On Wed, Jan 18, 2017 at 9:51 AM, James Selvakumar <
> >> ja...@mcruncher.com>
> >> > >> wrote:
> >> > >>
> >> > >> > Dear Wicket team,
> >> > >> >
> >> > >> > I need to make a call to a Wicket page from my JavaScript
> function.
> >> > >> > I followed the guide Calling Wicket from Javascript
> >> > >> >  >> > >> > Calling+Wicket+from+Javascript>
> >> > >> > and managed to define an ajax behavior to respond to the
> JavaScript
> >> > >> call.
> >> > >> >
> >> > >> > My ajax behavior looks like this:
> >> > >> >
> >> > >> > > private final AbstractDefaultAjaxBehavior behave = new
> >> > >> > AbstractDefaultAjaxBehavior()
> >> > >> > > {
> >> > >> > > protected void respond(final AjaxRequestTarget target)
> >> > >> > > {
> >> > >> > > LOGGER.debug("Received a request from client to get the
> >> > >> > encryption key");
> >> > >> > > target.add(new Label("foo", "Yeah I was just called
> from
> >> > >> > Javascript!"));
> >> > >> > > }
> >> > >> > >
> >> > >> > > public void renderHead(Component component, IHeaderResponse
> >> > >> response)
> >> > >> > > {
> >> > >> > > super.renderHead(component, response);
> >> > >> > > String callbackUrl = getCallbackUrl().toString();
> >> > >> > > response.render(JavaScriptHeaderItem.forScript("var
> >> > >> > callbackUrl='" + callbackUrl + "';", "values"));
> >> > >> > > }
> >> > >> > > };
> >> > >> > >
> >> > >> > > This callback url got rendered in the page like this:
> >> > >> >
> >> > >> > 
> >> > >> > > /* >> > >> > > var callbackUrl='./wicket/page?0-1.IBehaviorListener.0-';
> >> > >> > > /*]]>*/
> >> > >> > > 
> >> > >> > >
> >> > >> >
> >> > >> >
> >> > >> > And here is my JavaScript code:
> >> > >> >
> >> > >> > > var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
> >> > >> > > alert(wcall);
> >> > >> > >
> >> > >> > > But I'm getting the following error in the Wicket Ajax Debug
> >> Window:
> >> > >> >
> >> > >> > *An error occurred while executing Ajax request:TypeError: a is
> >> > >> undefined*
> >> > >> > >
> >> > >> >
> >> > >> > Can someone point out what's the mistake here?
> >> > >> >
> >> > >> > --
> >> > >> > Thanks & regards
> >> > >> > James
> >> > >> >
> >> > >>
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > Thanks & regards
> >> > > James Selvakumar
> >> > >
> >> >
> >> >
> >> >
> >> > --
> >> > Thanks & regards
> >> > James
> >> >
> >>
> >
> >
> >
> > --
> > Thanks & regards
> > James
> >
>
>
>
> --
> Thanks & regards
> James
>


Re: Error while calling Wicket from a JavaScript function

2017-01-18 Thread James Selvakumar
Hi Martin,

Is it possible to return a value from the ajax behavior while responding to
the ajax call?
I'm trying to do something like this in the server side:

target.appendJavaScript("foo");
>

And then try to use it in my JavaScript:

var foo = Wicket.Ajax.get({ u: window.callbackUrl });
> //do some processing with foo
>

Is this valid? Or is there a better way?



On Wed, Jan 18, 2017 at 5:26 PM, James Selvakumar 
wrote:

> Thanks a lot Martin. You're right. I had something else in my code and
> after I fixed it, I managed to make a ajax call from JavaScript.
>
> On Wed, Jan 18, 2017 at 5:07 PM, Martin Grigorov 
> wrote:
>
>> There is no variable named 'a' in your code snippet.
>> It might be another problem.
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Wed, Jan 18, 2017 at 10:04 AM, James Selvakumar 
>> wrote:
>>
>> > Hi Martin,
>> >
>> > I tried your suggestion but I'm still getting the same TypeError.
>> >
>> > On Wed, Jan 18, 2017 at 4:55 PM, James Selvakumar 
>> > wrote:
>> >
>> > > Thanks Martin for the super fast reply. I'll try that out.
>> > >
>> > > On Wed, Jan 18, 2017 at 4:54 PM, Martin Grigorov <
>> mgrigo...@apache.org>
>> > > wrote:
>> > >
>> > >> var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
>> > >> should be
>> > >> var wcall = Wicket.Ajax.get({ u: window.callbackUrl });
>> > >>
>> > >> Martin Grigorov
>> > >> Wicket Training and Consulting
>> > >> https://twitter.com/mtgrigorov
>> > >>
>> > >> On Wed, Jan 18, 2017 at 9:51 AM, James Selvakumar <
>> ja...@mcruncher.com>
>> > >> wrote:
>> > >>
>> > >> > Dear Wicket team,
>> > >> >
>> > >> > I need to make a call to a Wicket page from my JavaScript function.
>> > >> > I followed the guide Calling Wicket from Javascript
>> > >> > > > >> > Calling+Wicket+from+Javascript>
>> > >> > and managed to define an ajax behavior to respond to the JavaScript
>> > >> call.
>> > >> >
>> > >> > My ajax behavior looks like this:
>> > >> >
>> > >> > > private final AbstractDefaultAjaxBehavior behave = new
>> > >> > AbstractDefaultAjaxBehavior()
>> > >> > > {
>> > >> > > protected void respond(final AjaxRequestTarget target)
>> > >> > > {
>> > >> > > LOGGER.debug("Received a request from client to get the
>> > >> > encryption key");
>> > >> > > target.add(new Label("foo", "Yeah I was just called from
>> > >> > Javascript!"));
>> > >> > > }
>> > >> > >
>> > >> > > public void renderHead(Component component, IHeaderResponse
>> > >> response)
>> > >> > > {
>> > >> > > super.renderHead(component, response);
>> > >> > > String callbackUrl = getCallbackUrl().toString();
>> > >> > > response.render(JavaScriptHeaderItem.forScript("var
>> > >> > callbackUrl='" + callbackUrl + "';", "values"));
>> > >> > > }
>> > >> > > };
>> > >> > >
>> > >> > > This callback url got rendered in the page like this:
>> > >> >
>> > >> > 
>> > >> > > /*> > >> > > var callbackUrl='./wicket/page?0-1.IBehaviorListener.0-';
>> > >> > > /*]]>*/
>> > >> > > 
>> > >> > >
>> > >> >
>> > >> >
>> > >> > And here is my JavaScript code:
>> > >> >
>> > >> > > var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
>> > >> > > alert(wcall);
>> > >> > >
>> > >> > > But I'm getting the following error in the Wicket Ajax Debug
>> Window:
>> > >> >
>> > >> > *An error occurred while executing Ajax request:TypeError: a is
>> > >> undefined*
>> > >> > >
>> > >> >
>> > >> > Can someone point out what's the mistake here?
>> > >> >
>> > >> > --
>> > >> > Thanks & regards
>> > >> > James
>> > >> >
>> > >>
>> > >
>> > >
>> > >
>> > > --
>> > > Thanks & regards
>> > > James Selvakumar
>> > >
>> >
>> >
>> >
>> > --
>> > Thanks & regards
>> > James
>> >
>>
>
>
>
> --
> Thanks & regards
> James
>



-- 
Thanks & regards
James


Re: Error while calling Wicket from a JavaScript function

2017-01-18 Thread James Selvakumar
Thanks a lot Martin. You're right. I had something else in my code and
after I fixed it, I managed to make a ajax call from JavaScript.

On Wed, Jan 18, 2017 at 5:07 PM, Martin Grigorov 
wrote:

> There is no variable named 'a' in your code snippet.
> It might be another problem.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Jan 18, 2017 at 10:04 AM, James Selvakumar 
> wrote:
>
> > Hi Martin,
> >
> > I tried your suggestion but I'm still getting the same TypeError.
> >
> > On Wed, Jan 18, 2017 at 4:55 PM, James Selvakumar 
> > wrote:
> >
> > > Thanks Martin for the super fast reply. I'll try that out.
> > >
> > > On Wed, Jan 18, 2017 at 4:54 PM, Martin Grigorov  >
> > > wrote:
> > >
> > >> var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
> > >> should be
> > >> var wcall = Wicket.Ajax.get({ u: window.callbackUrl });
> > >>
> > >> Martin Grigorov
> > >> Wicket Training and Consulting
> > >> https://twitter.com/mtgrigorov
> > >>
> > >> On Wed, Jan 18, 2017 at 9:51 AM, James Selvakumar <
> ja...@mcruncher.com>
> > >> wrote:
> > >>
> > >> > Dear Wicket team,
> > >> >
> > >> > I need to make a call to a Wicket page from my JavaScript function.
> > >> > I followed the guide Calling Wicket from Javascript
> > >> >  > >> > Calling+Wicket+from+Javascript>
> > >> > and managed to define an ajax behavior to respond to the JavaScript
> > >> call.
> > >> >
> > >> > My ajax behavior looks like this:
> > >> >
> > >> > > private final AbstractDefaultAjaxBehavior behave = new
> > >> > AbstractDefaultAjaxBehavior()
> > >> > > {
> > >> > > protected void respond(final AjaxRequestTarget target)
> > >> > > {
> > >> > > LOGGER.debug("Received a request from client to get the
> > >> > encryption key");
> > >> > > target.add(new Label("foo", "Yeah I was just called from
> > >> > Javascript!"));
> > >> > > }
> > >> > >
> > >> > > public void renderHead(Component component, IHeaderResponse
> > >> response)
> > >> > > {
> > >> > > super.renderHead(component, response);
> > >> > > String callbackUrl = getCallbackUrl().toString();
> > >> > > response.render(JavaScriptHeaderItem.forScript("var
> > >> > callbackUrl='" + callbackUrl + "';", "values"));
> > >> > > }
> > >> > > };
> > >> > >
> > >> > > This callback url got rendered in the page like this:
> > >> >
> > >> > 
> > >> > > /* > >> > > var callbackUrl='./wicket/page?0-1.IBehaviorListener.0-';
> > >> > > /*]]>*/
> > >> > > 
> > >> > >
> > >> >
> > >> >
> > >> > And here is my JavaScript code:
> > >> >
> > >> > > var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
> > >> > > alert(wcall);
> > >> > >
> > >> > > But I'm getting the following error in the Wicket Ajax Debug
> Window:
> > >> >
> > >> > *An error occurred while executing Ajax request:TypeError: a is
> > >> undefined*
> > >> > >
> > >> >
> > >> > Can someone point out what's the mistake here?
> > >> >
> > >> > --
> > >> > Thanks & regards
> > >> > James
> > >> >
> > >>
> > >
> > >
> > >
> > > --
> > > Thanks & regards
> > > James Selvakumar
> > >
> >
> >
> >
> > --
> > Thanks & regards
> > James
> >
>



-- 
Thanks & regards
James


Re: Error while calling Wicket from a JavaScript function

2017-01-18 Thread Martin Grigorov
There is no variable named 'a' in your code snippet.
It might be another problem.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Jan 18, 2017 at 10:04 AM, James Selvakumar 
wrote:

> Hi Martin,
>
> I tried your suggestion but I'm still getting the same TypeError.
>
> On Wed, Jan 18, 2017 at 4:55 PM, James Selvakumar 
> wrote:
>
> > Thanks Martin for the super fast reply. I'll try that out.
> >
> > On Wed, Jan 18, 2017 at 4:54 PM, Martin Grigorov 
> > wrote:
> >
> >> var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
> >> should be
> >> var wcall = Wicket.Ajax.get({ u: window.callbackUrl });
> >>
> >> Martin Grigorov
> >> Wicket Training and Consulting
> >> https://twitter.com/mtgrigorov
> >>
> >> On Wed, Jan 18, 2017 at 9:51 AM, James Selvakumar 
> >> wrote:
> >>
> >> > Dear Wicket team,
> >> >
> >> > I need to make a call to a Wicket page from my JavaScript function.
> >> > I followed the guide Calling Wicket from Javascript
> >> >  >> > Calling+Wicket+from+Javascript>
> >> > and managed to define an ajax behavior to respond to the JavaScript
> >> call.
> >> >
> >> > My ajax behavior looks like this:
> >> >
> >> > > private final AbstractDefaultAjaxBehavior behave = new
> >> > AbstractDefaultAjaxBehavior()
> >> > > {
> >> > > protected void respond(final AjaxRequestTarget target)
> >> > > {
> >> > > LOGGER.debug("Received a request from client to get the
> >> > encryption key");
> >> > > target.add(new Label("foo", "Yeah I was just called from
> >> > Javascript!"));
> >> > > }
> >> > >
> >> > > public void renderHead(Component component, IHeaderResponse
> >> response)
> >> > > {
> >> > > super.renderHead(component, response);
> >> > > String callbackUrl = getCallbackUrl().toString();
> >> > > response.render(JavaScriptHeaderItem.forScript("var
> >> > callbackUrl='" + callbackUrl + "';", "values"));
> >> > > }
> >> > > };
> >> > >
> >> > > This callback url got rendered in the page like this:
> >> >
> >> > 
> >> > > /* >> > > var callbackUrl='./wicket/page?0-1.IBehaviorListener.0-';
> >> > > /*]]>*/
> >> > > 
> >> > >
> >> >
> >> >
> >> > And here is my JavaScript code:
> >> >
> >> > > var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
> >> > > alert(wcall);
> >> > >
> >> > > But I'm getting the following error in the Wicket Ajax Debug Window:
> >> >
> >> > *An error occurred while executing Ajax request:TypeError: a is
> >> undefined*
> >> > >
> >> >
> >> > Can someone point out what's the mistake here?
> >> >
> >> > --
> >> > Thanks & regards
> >> > James
> >> >
> >>
> >
> >
> >
> > --
> > Thanks & regards
> > James Selvakumar
> >
>
>
>
> --
> Thanks & regards
> James
>


Re: Error while calling Wicket from a JavaScript function

2017-01-18 Thread James Selvakumar
Hi Martin,

I tried your suggestion but I'm still getting the same TypeError.

On Wed, Jan 18, 2017 at 4:55 PM, James Selvakumar 
wrote:

> Thanks Martin for the super fast reply. I'll try that out.
>
> On Wed, Jan 18, 2017 at 4:54 PM, Martin Grigorov 
> wrote:
>
>> var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
>> should be
>> var wcall = Wicket.Ajax.get({ u: window.callbackUrl });
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Wed, Jan 18, 2017 at 9:51 AM, James Selvakumar 
>> wrote:
>>
>> > Dear Wicket team,
>> >
>> > I need to make a call to a Wicket page from my JavaScript function.
>> > I followed the guide Calling Wicket from Javascript
>> > > > Calling+Wicket+from+Javascript>
>> > and managed to define an ajax behavior to respond to the JavaScript
>> call.
>> >
>> > My ajax behavior looks like this:
>> >
>> > > private final AbstractDefaultAjaxBehavior behave = new
>> > AbstractDefaultAjaxBehavior()
>> > > {
>> > > protected void respond(final AjaxRequestTarget target)
>> > > {
>> > > LOGGER.debug("Received a request from client to get the
>> > encryption key");
>> > > target.add(new Label("foo", "Yeah I was just called from
>> > Javascript!"));
>> > > }
>> > >
>> > > public void renderHead(Component component, IHeaderResponse
>> response)
>> > > {
>> > > super.renderHead(component, response);
>> > > String callbackUrl = getCallbackUrl().toString();
>> > > response.render(JavaScriptHeaderItem.forScript("var
>> > callbackUrl='" + callbackUrl + "';", "values"));
>> > > }
>> > > };
>> > >
>> > > This callback url got rendered in the page like this:
>> >
>> > 
>> > > /*> > > var callbackUrl='./wicket/page?0-1.IBehaviorListener.0-';
>> > > /*]]>*/
>> > > 
>> > >
>> >
>> >
>> > And here is my JavaScript code:
>> >
>> > > var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
>> > > alert(wcall);
>> > >
>> > > But I'm getting the following error in the Wicket Ajax Debug Window:
>> >
>> > *An error occurred while executing Ajax request:TypeError: a is
>> undefined*
>> > >
>> >
>> > Can someone point out what's the mistake here?
>> >
>> > --
>> > Thanks & regards
>> > James
>> >
>>
>
>
>
> --
> Thanks & regards
> James Selvakumar
>



-- 
Thanks & regards
James


Re: Error while calling Wicket from a JavaScript function

2017-01-18 Thread James Selvakumar
Thanks Martin for the super fast reply. I'll try that out.

On Wed, Jan 18, 2017 at 4:54 PM, Martin Grigorov 
wrote:

> var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
> should be
> var wcall = Wicket.Ajax.get({ u: window.callbackUrl });
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Jan 18, 2017 at 9:51 AM, James Selvakumar 
> wrote:
>
> > Dear Wicket team,
> >
> > I need to make a call to a Wicket page from my JavaScript function.
> > I followed the guide Calling Wicket from Javascript
> >  > Calling+Wicket+from+Javascript>
> > and managed to define an ajax behavior to respond to the JavaScript call.
> >
> > My ajax behavior looks like this:
> >
> > > private final AbstractDefaultAjaxBehavior behave = new
> > AbstractDefaultAjaxBehavior()
> > > {
> > > protected void respond(final AjaxRequestTarget target)
> > > {
> > > LOGGER.debug("Received a request from client to get the
> > encryption key");
> > > target.add(new Label("foo", "Yeah I was just called from
> > Javascript!"));
> > > }
> > >
> > > public void renderHead(Component component, IHeaderResponse
> response)
> > > {
> > > super.renderHead(component, response);
> > > String callbackUrl = getCallbackUrl().toString();
> > > response.render(JavaScriptHeaderItem.forScript("var
> > callbackUrl='" + callbackUrl + "';", "values"));
> > > }
> > > };
> > >
> > > This callback url got rendered in the page like this:
> >
> > 
> > > /* > > var callbackUrl='./wicket/page?0-1.IBehaviorListener.0-';
> > > /*]]>*/
> > > 
> > >
> >
> >
> > And here is my JavaScript code:
> >
> > > var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
> > > alert(wcall);
> > >
> > > But I'm getting the following error in the Wicket Ajax Debug Window:
> >
> > *An error occurred while executing Ajax request:TypeError: a is
> undefined*
> > >
> >
> > Can someone point out what's the mistake here?
> >
> > --
> > Thanks & regards
> > James
> >
>



-- 
Thanks & regards
James Selvakumar


Re: Error while calling Wicket from a JavaScript function

2017-01-18 Thread Martin Grigorov
var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
should be
var wcall = Wicket.Ajax.get({ u: window.callbackUrl });

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Jan 18, 2017 at 9:51 AM, James Selvakumar 
wrote:

> Dear Wicket team,
>
> I need to make a call to a Wicket page from my JavaScript function.
> I followed the guide Calling Wicket from Javascript
>  Calling+Wicket+from+Javascript>
> and managed to define an ajax behavior to respond to the JavaScript call.
>
> My ajax behavior looks like this:
>
> > private final AbstractDefaultAjaxBehavior behave = new
> AbstractDefaultAjaxBehavior()
> > {
> > protected void respond(final AjaxRequestTarget target)
> > {
> > LOGGER.debug("Received a request from client to get the
> encryption key");
> > target.add(new Label("foo", "Yeah I was just called from
> Javascript!"));
> > }
> >
> > public void renderHead(Component component, IHeaderResponse response)
> > {
> > super.renderHead(component, response);
> > String callbackUrl = getCallbackUrl().toString();
> > response.render(JavaScriptHeaderItem.forScript("var
> callbackUrl='" + callbackUrl + "';", "values"));
> > }
> > };
> >
> > This callback url got rendered in the page like this:
>
> 
> > /* > var callbackUrl='./wicket/page?0-1.IBehaviorListener.0-';
> > /*]]>*/
> > 
> >
>
>
> And here is my JavaScript code:
>
> > var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
> > alert(wcall);
> >
> > But I'm getting the following error in the Wicket Ajax Debug Window:
>
> *An error occurred while executing Ajax request:TypeError: a is undefined*
> >
>
> Can someone point out what's the mistake here?
>
> --
> Thanks & regards
> James
>


Error while calling Wicket from a JavaScript function

2017-01-18 Thread James Selvakumar
Dear Wicket team,

I need to make a call to a Wicket page from my JavaScript function.
I followed the guide Calling Wicket from Javascript

and managed to define an ajax behavior to respond to the JavaScript call.

My ajax behavior looks like this:

> private final AbstractDefaultAjaxBehavior behave = new 
> AbstractDefaultAjaxBehavior()
> {
> protected void respond(final AjaxRequestTarget target)
> {
> LOGGER.debug("Received a request from client to get the encryption 
> key");
> target.add(new Label("foo", "Yeah I was just called from 
> Javascript!"));
> }
>
> public void renderHead(Component component, IHeaderResponse response)
> {
> super.renderHead(component, response);
> String callbackUrl = getCallbackUrl().toString();
> response.render(JavaScriptHeaderItem.forScript("var callbackUrl='" + 
> callbackUrl + "';", "values"));
> }
> };
>
> This callback url got rendered in the page like this:


> /* var callbackUrl='./wicket/page?0-1.IBehaviorListener.0-';
> /*]]>*/
> 
>


And here is my JavaScript code:

> var wcall = Wicket.Ajax.get({ u: '${callbackUrl}'});
> alert(wcall);
>
> But I'm getting the following error in the Wicket Ajax Debug Window:

*An error occurred while executing Ajax request:TypeError: a is undefined*
>

Can someone point out what's the mistake here?

-- 
Thanks & regards
James