Re: Request for re-opening a Jira issue

2014-09-15 Thread Martin Grigorov
Hi,

I think it should not be re-opened!

1. JIRA is not support forum!
If you have questions then you should ask here (at users@ mailing list).
If you have ideas then you should discuss them at dev@ mailing list.

2. If you want to not have the ?pageId in the url then you should stick to
stateless components and behaviors.
This is by design!
Stateful pages cannot work without the pageId parameter!
Solutions like NoVersionRequestMapper are pure hacks. Use them at your own
responsibility! Wicket developers are not responsible for them!

3. Wicket provides some default implementations for IRequestMapper
interface.
But it also allows you to provide your own when you believe the default
ones are not optimal for you.
3.1. Wicket does its best to be backward compatible with previous versions.
Before every release we test the suggested new release with as much
applications as we have. If we find a regression we cancel the release and
cut a new one. You are very welcome to join us with testing your
application, with your custom implementations of Wicket interfaces, and
report regressions !


I'll copy my response to the ticket for cross reference.

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

On Sun, Sep 14, 2014 at 10:55 AM, Bernard  wrote:

> Hi,
>
> I created a Jira issue
>
> https://issues.apache.org/jira/browse/WICKET-5693
> setVersioned(false) should force single Page Version
>
> Initially information was not sufficient or clear enough so the issue
> was closed.
>
> Meanwhile I have added the requested information.
>
> Could this issue please be re-opened.
>
> Many thanks.
>
> Bernard
>
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active.
> http://www.avast.com
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


[ANNOUNCE] Apache Wicket 1.5.12 is released

2014-09-15 Thread Martin Grigorov
This is the twelfth maintenance release of the Wicket 1.5.x series. This
release brings over 5 bug fixes and improvements.

Git tag:
release/wicket-1.5.12

Changelog:
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561&version=12326154

Maven:

 org.apache.wicket
 wicket-core
 1.5.12



Download the full distribution (including source):
http://www.apache.org/dyn/closer.cgi/wicket/1.5.12

The Wicket team


Ajax Post Data

2014-09-15 Thread Tobias Soloschenko
Hi,

is there a way to process post data with the wicket ajax function - ep dep are 
only for strings.

Kind regards and thanks! 

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



Re: Ajax Post Data

2014-09-15 Thread Martin Grigorov
http://markmail.org/message/fw7cjfo7bzvkjfdu

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

On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi,
>
> is there a way to process post data with the wicket ajax function - ep dep
> are only for strings.
>
> Kind regards and thanks!
>
> Tobias
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Ajax Post Data

2014-09-15 Thread Tobias Soloschenko
And how do I read the ep / dep in the backend if they aren't of Type String but 
a plain javascript object?

ty for the fast response!

Tobias 

> Am 15.09.2014 um 14:16 schrieb Martin Grigorov :
> 
> http://markmail.org/message/fw7cjfo7bzvkjfdu
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> Hi,
>> 
>> is there a way to process post data with the wicket ajax function - ep dep
>> are only for strings.
>> 
>> Kind regards and thanks!
>> 
>> Tobias
>> -
>> 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 Post Data

2014-09-15 Thread Martin Grigorov
With HTTP you can send either string or binary.
You have to convert at the server side
On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
tobiassolosche...@googlemail.com> wrote:

> And how do I read the ep / dep in the backend if they aren't of Type
> String but a plain javascript object?
>
> ty for the fast response!
>
> Tobias
>
> > Am 15.09.2014 um 14:16 schrieb Martin Grigorov :
> >
> > http://markmail.org/message/fw7cjfo7bzvkjfdu
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> >> Hi,
> >>
> >> is there a way to process post data with the wicket ajax function - ep
> dep
> >> are only for strings.
> >>
> >> Kind regards and thanks!
> >>
> >> Tobias
> >> -
> >> 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 Post Data

2014-09-15 Thread Tobias Soloschenko
But they are add to the query string. This is really bad - maybe it would be 
nice to add a new special attribute which is given directly to the jquery's 
data attribute. It would be possible to get the content via inputstream of the 
httpservletrequest. 

((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()

kind regards

Tobias

> Am 15.09.2014 um 14:43 schrieb Martin Grigorov :
> 
> With HTTP you can send either string or binary.
> You have to convert at the server side
> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> tobiassolosche...@googlemail.com> wrote:
> 
>> And how do I read the ep / dep in the backend if they aren't of Type
>> String but a plain javascript object?
>> 
>> ty for the fast response!
>> 
>> Tobias
>> 
>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov :
>>> 
>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
>>> 
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>> 
>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
>>> tobiassolosche...@googlemail.com> wrote:
>>> 
 Hi,
 
 is there a way to process post data with the wicket ajax function - ep
>> dep
 are only for strings.
 
 Kind regards and thanks!
 
 Tobias
 -
 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
>> 
>> 

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



Re: Ajax Post Data

2014-09-15 Thread Martin Grigorov
If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post", }) then
the parameters won't be in the query string.

wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
depending on the used 'method' (GET or POST) they will be in the query
string or request body.

Do you say that with method=post you still see the parameter in the query
string ?

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

On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> But they are add to the query string. This is really bad - maybe it would
> be nice to add a new special attribute which is given directly to the
> jquery's data attribute. It would be possible to get the content via
> inputstream of the httpservletrequest.
>
>
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>
> kind regards
>
> Tobias
>
> > Am 15.09.2014 um 14:43 schrieb Martin Grigorov :
> >
> > With HTTP you can send either string or binary.
> > You have to convert at the server side
> > On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> > tobiassolosche...@googlemail.com> wrote:
> >
> >> And how do I read the ep / dep in the backend if they aren't of Type
> >> String but a plain javascript object?
> >>
> >> ty for the fast response!
> >>
> >> Tobias
> >>
> >>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov :
> >>>
> >>> http://markmail.org/message/fw7cjfo7bzvkjfdu
> >>>
> >>> Martin Grigorov
> >>> Wicket Training and Consulting
> >>> https://twitter.com/mtgrigorov
> >>>
> >>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> >>> tobiassolosche...@googlemail.com> wrote:
> >>>
>  Hi,
> 
>  is there a way to process post data with the wicket ajax function - ep
> >> dep
>  are only for strings.
> 
>  Kind regards and thanks!
> 
>  Tobias
>  -
>  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
> >>
> >>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Ajax Post Data

2014-09-15 Thread Tobias Soloschenko
No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax with -- 
type:post, contentType:false, processData:false --I can read the content by 
inputstream I saw that the attrs.ep are passed into the data property but they 
are encoded which is wrong jQuery.param(data) line 634 of wicket-ajax-jquery. 
And how can I set the other both options so that I can read the content via 
stream?

Kind regards

Tobias 

> Am 15.09.2014 um 15:28 schrieb Martin Grigorov :
> 
> If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post", }) then
> the parameters won't be in the query string.
> 
> wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
> depending on the used 'method' (GET or POST) they will be in the query
> string or request body.
> 
> Do you say that with method=post you still see the parameter in the query
> string ?
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> But they are add to the query string. This is really bad - maybe it would
>> be nice to add a new special attribute which is given directly to the
>> jquery's data attribute. It would be possible to get the content via
>> inputstream of the httpservletrequest.
>> 
>> 
>> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>> 
>> kind regards
>> 
>> Tobias
>> 
>>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov :
>>> 
>>> With HTTP you can send either string or binary.
>>> You have to convert at the server side
>>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
>>> tobiassolosche...@googlemail.com> wrote:
>>> 
 And how do I read the ep / dep in the backend if they aren't of Type
 String but a plain javascript object?
 
 ty for the fast response!
 
 Tobias
 
> Am 15.09.2014 um 14:16 schrieb Martin Grigorov :
> 
> http://markmail.org/message/fw7cjfo7bzvkjfdu
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> Hi,
>> 
>> is there a way to process post data with the wicket ajax function - ep
 dep
>> are only for strings.
>> 
>> Kind regards and thanks!
>> 
>> Tobias
>> -
>> 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
>> 
>> -
>> 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 Post Data

2014-09-15 Thread Tobias Soloschenko
Let me show an example (%s are going to be replaced with the url /
callbackscript):

$.ajax({
type : 'POST',
url : '%s&fileName=' + encodeURIComponent(file.name) +
'&dropid='+dropid+'&fileid=' + fileid,
data : file,
contentType : false,
processData : false,

success:function(data, textStatus, jqXHR){
var file = this.data
// getFinishedUploadClientScript
%s
}
});

With this code I can invoke this on server side and read the data:
((HttpServletRequest)
RequestCycle.get().getRequest().getContainerRequest()).getInputStream()

---

Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(file.name) +
'&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
// getFinishedUploadClientScript
%s;
}});

This code is not working with the server side handling of the post content

kind regards

Tobias




2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
tobiassolosche...@googlemail.com>:

> No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax with --
> type:post, contentType:false, processData:false --I can read the content by
> inputstream I saw that the attrs.ep are passed into the data property but
> they are encoded which is wrong jQuery.param(data) line 634 of
> wicket-ajax-jquery. And how can I set the other both options so that I can
> read the content via stream?
>
> Kind regards
>
> Tobias
>
> > Am 15.09.2014 um 15:28 schrieb Martin Grigorov :
> >
> > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post", })
> then
> > the parameters won't be in the query string.
> >
> > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
> > depending on the used 'method' (GET or POST) they will be in the query
> > string or request body.
> >
> > Do you say that with method=post you still see the parameter in the query
> > string ?
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> >> But they are add to the query string. This is really bad - maybe it
> would
> >> be nice to add a new special attribute which is given directly to the
> >> jquery's data attribute. It would be possible to get the content via
> >> inputstream of the httpservletrequest.
> >>
> >>
> >>
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> >>
> >> kind regards
> >>
> >> Tobias
> >>
> >>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov :
> >>>
> >>> With HTTP you can send either string or binary.
> >>> You have to convert at the server side
> >>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> >>> tobiassolosche...@googlemail.com> wrote:
> >>>
>  And how do I read the ep / dep in the backend if they aren't of Type
>  String but a plain javascript object?
> 
>  ty for the fast response!
> 
>  Tobias
> 
> > Am 15.09.2014 um 14:16 schrieb Martin Grigorov  >:
> >
> > http://markmail.org/message/fw7cjfo7bzvkjfdu
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> >> Hi,
> >>
> >> is there a way to process post data with the wicket ajax function -
> ep
>  dep
> >> are only for strings.
> >>
> >> Kind regards and thanks!
> >>
> >> Tobias
> >>
> -
> >> 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
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
>


Re: Ajax Post Data

2014-09-15 Thread Martin Grigorov
Please file a ticket with attached quickstart application.

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

On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Let me show an example (%s are going to be replaced with the url /
> callbackscript):
>
> $.ajax({
> type : 'POST',
> url : '%s&fileName=' + encodeURIComponent(file.name) +
> '&dropid='+dropid+'&fileid=' + fileid,
> data : file,
> contentType : false,
> processData : false,
>
> success:function(data, textStatus, jqXHR){
> var file = this.data
> // getFinishedUploadClientScript
> %s
> }
> });
>
> With this code I can invoke this on server side and read the data:
> ((HttpServletRequest)
> RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>
> ---
>
> Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(file.name) +
> '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
> // getFinishedUploadClientScript
> %s;
> }});
>
> This code is not working with the server side handling of the post content
>
> kind regards
>
> Tobias
>
>
>
>
> 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> tobiassolosche...@googlemail.com>:
>
> > No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax with
> --
> > type:post, contentType:false, processData:false --I can read the content
> by
> > inputstream I saw that the attrs.ep are passed into the data property but
> > they are encoded which is wrong jQuery.param(data) line 634 of
> > wicket-ajax-jquery. And how can I set the other both options so that I
> can
> > read the content via stream?
> >
> > Kind regards
> >
> > Tobias
> >
> > > Am 15.09.2014 um 15:28 schrieb Martin Grigorov :
> > >
> > > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post", })
> > then
> > > the parameters won't be in the query string.
> > >
> > > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
> > > depending on the used 'method' (GET or POST) they will be in the query
> > > string or request body.
> > >
> > > Do you say that with method=post you still see the parameter in the
> query
> > > string ?
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > > tobiassolosche...@googlemail.com> wrote:
> > >
> > >> But they are add to the query string. This is really bad - maybe it
> > would
> > >> be nice to add a new special attribute which is given directly to the
> > >> jquery's data attribute. It would be possible to get the content via
> > >> inputstream of the httpservletrequest.
> > >>
> > >>
> > >>
> >
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > >>
> > >> kind regards
> > >>
> > >> Tobias
> > >>
> > >>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov  >:
> > >>>
> > >>> With HTTP you can send either string or binary.
> > >>> You have to convert at the server side
> > >>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> > >>> tobiassolosche...@googlemail.com> wrote:
> > >>>
> >  And how do I read the ep / dep in the backend if they aren't of Type
> >  String but a plain javascript object?
> > 
> >  ty for the fast response!
> > 
> >  Tobias
> > 
> > > Am 15.09.2014 um 14:16 schrieb Martin Grigorov <
> mgrigo...@apache.org
> > >:
> > >
> > > http://markmail.org/message/fw7cjfo7bzvkjfdu
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> > > tobiassolosche...@googlemail.com> wrote:
> > >
> > >> Hi,
> > >>
> > >> is there a way to process post data with the wicket ajax function
> -
> > ep
> >  dep
> > >> are only for strings.
> > >>
> > >> Kind regards and thanks!
> > >>
> > >> Tobias
> > >>
> > -
> > >> 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
> > >>
> > >> -
> > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > >> For additional commands, e-mail: users-h...@wicket.apache.org
> > >>
> > >>
> >
>


Re: Ajax Post Data

2014-09-15 Thread Tobias Soloschenko
Okay will do it when Im at home. :-) 

kind regards

Tobias 

> Am 15.09.2014 um 15:53 schrieb Martin Grigorov :
> 
> Please file a ticket with attached quickstart application.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> Let me show an example (%s are going to be replaced with the url /
>> callbackscript):
>> 
>>$.ajax({
>>type : 'POST',
>>url : '%s&fileName=' + encodeURIComponent(file.name) +
>> '&dropid='+dropid+'&fileid=' + fileid,
>>data : file,
>>contentType : false,
>>processData : false,
>> 
>>success:function(data, textStatus, jqXHR){
>>var file = this.data
>>// getFinishedUploadClientScript
>>%s
>>}
>>});
>> 
>> With this code I can invoke this on server side and read the data:
>> ((HttpServletRequest)
>> RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>> 
>> ---
>> 
>>Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(file.name) +
>> '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
>>// getFinishedUploadClientScript
>>%s;
>>}});
>> 
>> This code is not working with the server side handling of the post content
>> 
>> kind regards
>> 
>> Tobias
>> 
>> 
>> 
>> 
>> 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
>> tobiassolosche...@googlemail.com>:
>> 
>>> No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax with
>> --
>>> type:post, contentType:false, processData:false --I can read the content
>> by
>>> inputstream I saw that the attrs.ep are passed into the data property but
>>> they are encoded which is wrong jQuery.param(data) line 634 of
>>> wicket-ajax-jquery. And how can I set the other both options so that I
>> can
>>> read the content via stream?
>>> 
>>> Kind regards
>>> 
>>> Tobias
>>> 
 Am 15.09.2014 um 15:28 schrieb Martin Grigorov :
 
 If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post", })
>>> then
 the parameters won't be in the query string.
 
 wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
 depending on the used 'method' (GET or POST) they will be in the query
 string or request body.
 
 Do you say that with method=post you still see the parameter in the
>> query
 string ?
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
 tobiassolosche...@googlemail.com> wrote:
 
> But they are add to the query string. This is really bad - maybe it
>>> would
> be nice to add a new special attribute which is given directly to the
> jquery's data attribute. It would be possible to get the content via
> inputstream of the httpservletrequest.
>> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> 
> kind regards
> 
> Tobias
> 
>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov >> :
>> 
>> With HTTP you can send either string or binary.
>> You have to convert at the server side
>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
>> tobiassolosche...@googlemail.com> wrote:
>> 
>>> And how do I read the ep / dep in the backend if they aren't of Type
>>> String but a plain javascript object?
>>> 
>>> ty for the fast response!
>>> 
>>> Tobias
>>> 
 Am 15.09.2014 um 14:16 schrieb Martin Grigorov <
>> mgrigo...@apache.org
 :
 
 http://markmail.org/message/fw7cjfo7bzvkjfdu
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
 tobiassolosche...@googlemail.com> wrote:
 
> Hi,
> 
> is there a way to process post data with the wicket ajax function
>> -
>>> ep
>>> dep
> are only for strings.
> 
> Kind regards and thanks!
> 
> Tobias
>>> -
> 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
> 
> -
> 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 comma

Programmatic Markup with fallback

2014-09-15 Thread Thibault Kruse
Hi,

I am trying to create a wicket panel that renders markup from some
remote source, but if fetching fails, renders some fallback markup. I
want to achieve this with minimal code.

I tried two approaches one based on overriding getMarkup(), one based
on http://wicket.apache.org/guide/guide/advanced.html#advanced_5, both
fail:

/**
 * attempts to use custom markup by overriding getMarkup()... but html is used
 */
public class CustomMarkupFallback1Panel extends GenericPanel {
@Override
public IMarkupFragment getMarkup() {
return Markup.of("it works");
}
}

CustomMarkupFallback1Panel.html:

Fail!



This first one overrides getMarkup() as suggested in the javadoc of
IMarkupResourceStreamProvider, but what gets rendered is instead the
static html (even though the debugger walks through getMarkup().


The second approach fails using IMarkupResourceStreamProvider works
for the intended markup, but not for the fallback markup
public class CustomMarkupFallback2Panel extends GenericPanel
IMarkupResourceStreamProvider {

@Override
public IResourceStream getMarkupResourceStream(MarkupContainer
container, Class containerClass) {
if (getModelObject() == null) {
// thows Exception, see below. html file exists
return getMarkup().getMarkupResourceStream();
} else {
// works
return new StringResourceStream(getModelObject());
}
}
}


At least the first failure seems like a bug to me, not sure whether
the second approach is supposed to work, or how else to load markup
the wicket way.

Is there maybe a completely different approach to achieve what I try to do?

cheers,
  Thibault



java.io.IOException: Stream closed
 at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:162)
 at java.io.BufferedInputStream.read(BufferedInputStream.java:325)
 at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
 at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
 at org.apache.wicket.util.io.BOMInputStream.getBOM(BOMInputStream.java:217)
 at 
org.apache.wicket.util.io.BOMInputStream.readFirstBytes(BOMInputStream.java:261)
 at org.apache.wicket.util.io.BOMInputStream.read(BOMInputStream.java:312)
 at 
org.apache.wicket.util.io.XmlReader.getXmlDeclaration(XmlReader.java:183)
 at org.apache.wicket.util.io.XmlReader.init(XmlReader.java:106)
 at org.apache.wicket.util.io.XmlReader.(XmlReader.java:81)
 at 
org.apache.wicket.markup.parser.XmlPullParser.parse(XmlPullParser.java:605)
 at 
org.apache.wicket.markup.AbstractMarkupParser.parse(AbstractMarkupParser.java:178)
 at 
org.apache.wicket.markup.loader.SimpleMarkupLoader.loadMarkup(SimpleMarkupLoader.java:51)
 at 
org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:57)
 at 
org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:52)
 at 
org.apache.wicket.markup.MarkupFactory.loadMarkup(MarkupFactory.java:412)
 at org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:448)
 at 
org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:544)
 at org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:305)
 at org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:236)
 at org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:194)
 at 
org.apache.wicket.MarkupContainer.getAssociatedMarkup(MarkupContainer.java:405)
 at 
org.apache.wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:372)
 at 
org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderHeadFromAssociatedMarkupFile(AssociatedMarkupSourcingStrategy.java:244)
 at 
org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderHead(AssociatedMarkupSourcingStrategy.java:220)
 at org.apache.wicket.Component.renderHead(Component.java:2652)
 at 
org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy$1.component(ChildFirstHeaderRenderStrategy.java:85)
 at 
org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:96)
 at 
org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87)
 at 
org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:51)
 at 
org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderChildHeaders(ChildFirstHeaderRenderStrategy.java:78)
 at 
org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderHeader(ChildFirstHeaderRenderStrategy.java:57)
 at 
org.apache.wicket.markup.html.internal.HtmlHeaderContainer.onComponentTagBody(HtmlHeaderContainer.java:170)
 at 
org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrateg

Re: Programmatic Markup with fallback

2014-09-15 Thread Sven Meier

Hi,

which Wicket version?

The first approach leads to a MarkupException here with Wicket 1.6.x.

Regards
Sven

On 09/15/2014 07:37 PM, Thibault Kruse wrote:

Hi,

I am trying to create a wicket panel that renders markup from some
remote source, but if fetching fails, renders some fallback markup. I
want to achieve this with minimal code.

I tried two approaches one based on overriding getMarkup(), one based
on http://wicket.apache.org/guide/guide/advanced.html#advanced_5, both
fail:

/**
  * attempts to use custom markup by overriding getMarkup()... but html is used
  */
public class CustomMarkupFallback1Panel extends GenericPanel {
 @Override
 public IMarkupFragment getMarkup() {
 return Markup.of("it works");
 }
}

CustomMarkupFallback1Panel.html:

 Fail!



This first one overrides getMarkup() as suggested in the javadoc of
IMarkupResourceStreamProvider, but what gets rendered is instead the
static html (even though the debugger walks through getMarkup().


The second approach fails using IMarkupResourceStreamProvider works
for the intended markup, but not for the fallback markup
public class CustomMarkupFallback2Panel extends GenericPanel
 IMarkupResourceStreamProvider {

 @Override
 public IResourceStream getMarkupResourceStream(MarkupContainer
container, Class containerClass) {
 if (getModelObject() == null) {
 // thows Exception, see below. html file exists
 return getMarkup().getMarkupResourceStream();
 } else {
 // works
 return new StringResourceStream(getModelObject());
 }
 }
}


At least the first failure seems like a bug to me, not sure whether
the second approach is supposed to work, or how else to load markup
the wicket way.

Is there maybe a completely different approach to achieve what I try to do?

cheers,
   Thibault



java.io.IOException: Stream closed
  at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:162)
  at java.io.BufferedInputStream.read(BufferedInputStream.java:325)
  at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
  at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
  at 
org.apache.wicket.util.io.BOMInputStream.getBOM(BOMInputStream.java:217)
  at 
org.apache.wicket.util.io.BOMInputStream.readFirstBytes(BOMInputStream.java:261)
  at org.apache.wicket.util.io.BOMInputStream.read(BOMInputStream.java:312)
  at 
org.apache.wicket.util.io.XmlReader.getXmlDeclaration(XmlReader.java:183)
  at org.apache.wicket.util.io.XmlReader.init(XmlReader.java:106)
  at org.apache.wicket.util.io.XmlReader.(XmlReader.java:81)
  at 
org.apache.wicket.markup.parser.XmlPullParser.parse(XmlPullParser.java:605)
  at 
org.apache.wicket.markup.AbstractMarkupParser.parse(AbstractMarkupParser.java:178)
  at 
org.apache.wicket.markup.loader.SimpleMarkupLoader.loadMarkup(SimpleMarkupLoader.java:51)
  at 
org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:57)
  at 
org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:52)
  at 
org.apache.wicket.markup.MarkupFactory.loadMarkup(MarkupFactory.java:412)
  at org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:448)
  at 
org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:544)
  at org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:305)
  at 
org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:236)
  at 
org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:194)
  at 
org.apache.wicket.MarkupContainer.getAssociatedMarkup(MarkupContainer.java:405)
  at 
org.apache.wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:372)
  at 
org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderHeadFromAssociatedMarkupFile(AssociatedMarkupSourcingStrategy.java:244)
  at 
org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderHead(AssociatedMarkupSourcingStrategy.java:220)
  at org.apache.wicket.Component.renderHead(Component.java:2652)
  at 
org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy$1.component(ChildFirstHeaderRenderStrategy.java:85)
  at 
org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:96)
  at 
org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87)
  at 
org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:51)
  at 
org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderChildHeaders(ChildFirstHeaderRenderStrategy.java:78)
  at 
org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderHeader(ChildFirstHeaderRenderStrategy.java:57)
  at 
org.apache.wic

Re: Programmatic Markup with fallback

2014-09-15 Thread Thibault Kruse
Sorry, this was wicket 1.6.16 and 1.6.17.
Here is a quickstart, to reproduce both cases some comments have to be switched:
https://github.com/tkruse/custommarkup

On Mon, Sep 15, 2014 at 7:50 PM, Sven Meier  wrote:
> Hi,
>
> which Wicket version?
>
> The first approach leads to a MarkupException here with Wicket 1.6.x.
>
> Regards
> Sven
>
>
> On 09/15/2014 07:37 PM, Thibault Kruse wrote:
>>
>> Hi,
>>
>> I am trying to create a wicket panel that renders markup from some
>> remote source, but if fetching fails, renders some fallback markup. I
>> want to achieve this with minimal code.
>>
>> I tried two approaches one based on overriding getMarkup(), one based
>> on http://wicket.apache.org/guide/guide/advanced.html#advanced_5, both
>> fail:
>>
>> /**
>>   * attempts to use custom markup by overriding getMarkup()... but html is
>> used
>>   */
>> public class CustomMarkupFallback1Panel extends GenericPanel {
>>  @Override
>>  public IMarkupFragment getMarkup() {
>>  return Markup.of("it works");
>>  }
>> }
>>
>> CustomMarkupFallback1Panel.html:
>> 
>>  Fail!
>> 
>>
>>
>> This first one overrides getMarkup() as suggested in the javadoc of
>> IMarkupResourceStreamProvider, but what gets rendered is instead the
>> static html (even though the debugger walks through getMarkup().
>>
>>
>> The second approach fails using IMarkupResourceStreamProvider works
>> for the intended markup, but not for the fallback markup
>> public class CustomMarkupFallback2Panel extends GenericPanel
>>  IMarkupResourceStreamProvider {
>>
>>  @Override
>>  public IResourceStream getMarkupResourceStream(MarkupContainer
>> container, Class containerClass) {
>>  if (getModelObject() == null) {
>>  // thows Exception, see below. html file exists
>>  return getMarkup().getMarkupResourceStream();
>>  } else {
>>  // works
>>  return new StringResourceStream(getModelObject());
>>  }
>>  }
>> }
>>
>>
>> At least the first failure seems like a bug to me, not sure whether
>> the second approach is supposed to work, or how else to load markup
>> the wicket way.
>>
>> Is there maybe a completely different approach to achieve what I try to
>> do?
>>
>> cheers,
>>Thibault
>>
>>
>>
>> java.io.IOException: Stream closed
>>   at
>> java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:162)
>>   at java.io.BufferedInputStream.read(BufferedInputStream.java:325)
>>   at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
>>   at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
>>   at
>> org.apache.wicket.util.io.BOMInputStream.getBOM(BOMInputStream.java:217)
>>   at
>> org.apache.wicket.util.io.BOMInputStream.readFirstBytes(BOMInputStream.java:261)
>>   at
>> org.apache.wicket.util.io.BOMInputStream.read(BOMInputStream.java:312)
>>   at
>> org.apache.wicket.util.io.XmlReader.getXmlDeclaration(XmlReader.java:183)
>>   at org.apache.wicket.util.io.XmlReader.init(XmlReader.java:106)
>>   at org.apache.wicket.util.io.XmlReader.(XmlReader.java:81)
>>   at
>> org.apache.wicket.markup.parser.XmlPullParser.parse(XmlPullParser.java:605)
>>   at
>> org.apache.wicket.markup.AbstractMarkupParser.parse(AbstractMarkupParser.java:178)
>>   at
>> org.apache.wicket.markup.loader.SimpleMarkupLoader.loadMarkup(SimpleMarkupLoader.java:51)
>>   at
>> org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:57)
>>   at
>> org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:52)
>>   at
>> org.apache.wicket.markup.MarkupFactory.loadMarkup(MarkupFactory.java:412)
>>   at
>> org.apache.wicket.markup.MarkupCache.loadMarkup(MarkupCache.java:448)
>>   at
>> org.apache.wicket.markup.MarkupCache.loadMarkupAndWatchForChanges(MarkupCache.java:544)
>>   at
>> org.apache.wicket.markup.MarkupCache.getMarkup(MarkupCache.java:305)
>>   at
>> org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:236)
>>   at
>> org.apache.wicket.markup.MarkupFactory.getMarkup(MarkupFactory.java:194)
>>   at
>> org.apache.wicket.MarkupContainer.getAssociatedMarkup(MarkupContainer.java:405)
>>   at
>> org.apache.wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:372)
>>   at
>> org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderHeadFromAssociatedMarkupFile(AssociatedMarkupSourcingStrategy.java:244)
>>   at
>> org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderHead(AssociatedMarkupSourcingStrategy.java:220)
>>   at org.apache.wicket.Component.renderHead(Component.java:2652)
>>   at
>> org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy$1.component(ChildFirstHeaderRenderStrategy.java:85)
>>   at
>> org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepC

Re: Ajax Post Data

2014-09-15 Thread Tobias Soloschenko
Ok I solved my problem with the quickstart and some investigations about
post requests:

var reader = new FileReader();
reader.onload = (function(file) {
return function(e) {
Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
file.name) + '&dropid='+dropid+'&fileid=' + fileid,
ep:{data:btoa(reader.result)}, coh:[function(){
// getFinishedUploadClientScript
%s;
}]});
}
})(file);
reader.readAsBinaryString(file);

I add the content of the file as base64 encoded binary string to the
variable with the name data. The upload is now working like a charm. The
only thing the developer has to know about is the max of mb (2mb in example
of tomcat) for post requests:

https://github.com/klopfdreh/wicket-components-playground

kind regards

Tobias


2014-09-15 15:53 GMT+02:00 Martin Grigorov :

> Please file a ticket with attached quickstart application.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
>
> > Let me show an example (%s are going to be replaced with the url /
> > callbackscript):
> >
> > $.ajax({
> > type : 'POST',
> > url : '%s&fileName=' + encodeURIComponent(file.name) +
> > '&dropid='+dropid+'&fileid=' + fileid,
> > data : file,
> > contentType : false,
> > processData : false,
> >
> > success:function(data, textStatus, jqXHR){
> > var file = this.data
> > // getFinishedUploadClientScript
> > %s
> > }
> > });
> >
> > With this code I can invoke this on server side and read the data:
> > ((HttpServletRequest)
> > RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> >
> > ---
> >
> > Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(file.name)
> +
> > '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
> > // getFinishedUploadClientScript
> > %s;
> > }});
> >
> > This code is not working with the server side handling of the post
> content
> >
> > kind regards
> >
> > Tobias
> >
> >
> >
> >
> > 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> > tobiassolosche...@googlemail.com>:
> >
> > > No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax with
> > --
> > > type:post, contentType:false, processData:false --I can read the
> content
> > by
> > > inputstream I saw that the attrs.ep are passed into the data property
> but
> > > they are encoded which is wrong jQuery.param(data) line 634 of
> > > wicket-ajax-jquery. And how can I set the other both options so that I
> > can
> > > read the content via stream?
> > >
> > > Kind regards
> > >
> > > Tobias
> > >
> > > > Am 15.09.2014 um 15:28 schrieb Martin Grigorov  >:
> > > >
> > > > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post", })
> > > then
> > > > the parameters won't be in the query string.
> > > >
> > > > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
> > > > depending on the used 'method' (GET or POST) they will be in the
> query
> > > > string or request body.
> > > >
> > > > Do you say that with method=post you still see the parameter in the
> > query
> > > > string ?
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > > > tobiassolosche...@googlemail.com> wrote:
> > > >
> > > >> But they are add to the query string. This is really bad - maybe it
> > > would
> > > >> be nice to add a new special attribute which is given directly to
> the
> > > >> jquery's data attribute. It would be possible to get the content via
> > > >> inputstream of the httpservletrequest.
> > > >>
> > > >>
> > > >>
> > >
> >
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > > >>
> > > >> kind regards
> > > >>
> > > >> Tobias
> > > >>
> > > >>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <
> mgrigo...@apache.org
> > >:
> > > >>>
> > > >>> With HTTP you can send either string or binary.
> > > >>> You have to convert at the server side
> > > >>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> > > >>> tobiassolosche...@googlemail.com> wrote:
> > > >>>
> > >  And how do I read the ep / dep in the backend if they aren't of
> Type
> > >  String but a plain javascript object?
> > > 
> > >  ty for the fast response!
> > > 
> > >  Tobias
> > > 
> > > > Am 15.09.2014 um 14:16 schrieb Martin Grigorov <
> > mgrigo...@apache.org
> > > >:
> > > >
> > > > http://markmail.org/message/fw7cjfo7bzvkjfdu
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> > > > tobiass

Re: Ajax Post Data

2014-09-15 Thread Ernesto Reinaldo Barreiro
Hi,

Thanks for sharing! Why not make HTML5FilesDropableAjaxEventBehavior public
static so that it can be reused independently of Panel?

On Mon, Sep 15, 2014 at 8:30 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Ok I solved my problem with the quickstart and some investigations about
> post requests:
>
> var reader = new FileReader();
> reader.onload = (function(file) {
> return function(e) {
> Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> file.name) + '&dropid='+dropid+'&fileid=' + fileid,
> ep:{data:btoa(reader.result)}, coh:[function(){
> // getFinishedUploadClientScript
> %s;
> }]});
> }
> })(file);
> reader.readAsBinaryString(file);
>
> I add the content of the file as base64 encoded binary string to the
> variable with the name data. The upload is now working like a charm. The
> only thing the developer has to know about is the max of mb (2mb in example
> of tomcat) for post requests:
>
> https://github.com/klopfdreh/wicket-components-playground
>
> kind regards
>
> Tobias
>
>
> 2014-09-15 15:53 GMT+02:00 Martin Grigorov :
>
> > Please file a ticket with attached quickstart application.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> > > Let me show an example (%s are going to be replaced with the url /
> > > callbackscript):
> > >
> > > $.ajax({
> > > type : 'POST',
> > > url : '%s&fileName=' + encodeURIComponent(file.name) +
> > > '&dropid='+dropid+'&fileid=' + fileid,
> > > data : file,
> > > contentType : false,
> > > processData : false,
> > >
> > > success:function(data, textStatus, jqXHR){
> > > var file = this.data
> > > // getFinishedUploadClientScript
> > > %s
> > > }
> > > });
> > >
> > > With this code I can invoke this on server side and read the data:
> > > ((HttpServletRequest)
> > > RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > >
> > > ---
> > >
> > > Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> file.name)
> > +
> > > '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
> > > // getFinishedUploadClientScript
> > > %s;
> > > }});
> > >
> > > This code is not working with the server side handling of the post
> > content
> > >
> > > kind regards
> > >
> > > Tobias
> > >
> > >
> > >
> > >
> > > 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> > > tobiassolosche...@googlemail.com>:
> > >
> > > > No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax
> with
> > > --
> > > > type:post, contentType:false, processData:false --I can read the
> > content
> > > by
> > > > inputstream I saw that the attrs.ep are passed into the data property
> > but
> > > > they are encoded which is wrong jQuery.param(data) line 634 of
> > > > wicket-ajax-jquery. And how can I set the other both options so that
> I
> > > can
> > > > read the content via stream?
> > > >
> > > > Kind regards
> > > >
> > > > Tobias
> > > >
> > > > > Am 15.09.2014 um 15:28 schrieb Martin Grigorov <
> mgrigo...@apache.org
> > >:
> > > > >
> > > > > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post",
> })
> > > > then
> > > > > the parameters won't be in the query string.
> > > > >
> > > > > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
> > > > > depending on the used 'method' (GET or POST) they will be in the
> > query
> > > > > string or request body.
> > > > >
> > > > > Do you say that with method=post you still see the parameter in the
> > > query
> > > > > string ?
> > > > >
> > > > > Martin Grigorov
> > > > > Wicket Training and Consulting
> > > > > https://twitter.com/mtgrigorov
> > > > >
> > > > > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > > > > tobiassolosche...@googlemail.com> wrote:
> > > > >
> > > > >> But they are add to the query string. This is really bad - maybe
> it
> > > > would
> > > > >> be nice to add a new special attribute which is given directly to
> > the
> > > > >> jquery's data attribute. It would be possible to get the content
> via
> > > > >> inputstream of the httpservletrequest.
> > > > >>
> > > > >>
> > > > >>
> > > >
> > >
> >
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > > > >>
> > > > >> kind regards
> > > > >>
> > > > >> Tobias
> > > > >>
> > > > >>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <
> > mgrigo...@apache.org
> > > >:
> > > > >>>
> > > > >>> With HTTP you can send either string or binary.
> > > > >>> You have to convert at the server side
> > > > >>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> > > > >>> tobiassolosche...@googlemail.com> wrote:
> > > > >>>
> > > >  And how do I read the ep / dep

Re: Ajax Post Data

2014-09-15 Thread Tobias Soloschenko
Hi,

it is not public static because of the use of ids and because of the
callback methods.

kind regards

Tobias

2014-09-15 20:37 GMT+02:00 Ernesto Reinaldo Barreiro :

> Hi,
>
> Thanks for sharing! Why not make HTML5FilesDropableAjaxEventBehavior public
> static so that it can be reused independently of Panel?
>
> On Mon, Sep 15, 2014 at 8:30 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
>
> > Ok I solved my problem with the quickstart and some investigations about
> > post requests:
> >
> > var reader = new FileReader();
> > reader.onload = (function(file) {
> > return function(e) {
> > Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> > file.name) + '&dropid='+dropid+'&fileid=' + fileid,
> > ep:{data:btoa(reader.result)}, coh:[function(){
> > // getFinishedUploadClientScript
> > %s;
> > }]});
> > }
> > })(file);
> > reader.readAsBinaryString(file);
> >
> > I add the content of the file as base64 encoded binary string to the
> > variable with the name data. The upload is now working like a charm. The
> > only thing the developer has to know about is the max of mb (2mb in
> example
> > of tomcat) for post requests:
> >
> > https://github.com/klopfdreh/wicket-components-playground
> >
> > kind regards
> >
> > Tobias
> >
> >
> > 2014-09-15 15:53 GMT+02:00 Martin Grigorov :
> >
> > > Please file a ticket with attached quickstart application.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> > > tobiassolosche...@googlemail.com> wrote:
> > >
> > > > Let me show an example (%s are going to be replaced with the url /
> > > > callbackscript):
> > > >
> > > > $.ajax({
> > > > type : 'POST',
> > > > url : '%s&fileName=' + encodeURIComponent(file.name) +
> > > > '&dropid='+dropid+'&fileid=' + fileid,
> > > > data : file,
> > > > contentType : false,
> > > > processData : false,
> > > >
> > > > success:function(data, textStatus, jqXHR){
> > > > var file = this.data
> > > > // getFinishedUploadClientScript
> > > > %s
> > > > }
> > > > });
> > > >
> > > > With this code I can invoke this on server side and read the data:
> > > > ((HttpServletRequest)
> > > >
> RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > > >
> > > > ---
> > > >
> > > > Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> > file.name)
> > > +
> > > > '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
> > > > // getFinishedUploadClientScript
> > > > %s;
> > > > }});
> > > >
> > > > This code is not working with the server side handling of the post
> > > content
> > > >
> > > > kind regards
> > > >
> > > > Tobias
> > > >
> > > >
> > > >
> > > >
> > > > 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> > > > tobiassolosche...@googlemail.com>:
> > > >
> > > > > No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax
> > with
> > > > --
> > > > > type:post, contentType:false, processData:false --I can read the
> > > content
> > > > by
> > > > > inputstream I saw that the attrs.ep are passed into the data
> property
> > > but
> > > > > they are encoded which is wrong jQuery.param(data) line 634 of
> > > > > wicket-ajax-jquery. And how can I set the other both options so
> that
> > I
> > > > can
> > > > > read the content via stream?
> > > > >
> > > > > Kind regards
> > > > >
> > > > > Tobias
> > > > >
> > > > > > Am 15.09.2014 um 15:28 schrieb Martin Grigorov <
> > mgrigo...@apache.org
> > > >:
> > > > > >
> > > > > > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post",
> > })
> > > > > then
> > > > > > the parameters won't be in the query string.
> > > > > >
> > > > > > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...})
> and
> > > > > > depending on the used 'method' (GET or POST) they will be in the
> > > query
> > > > > > string or request body.
> > > > > >
> > > > > > Do you say that with method=post you still see the parameter in
> the
> > > > query
> > > > > > string ?
> > > > > >
> > > > > > Martin Grigorov
> > > > > > Wicket Training and Consulting
> > > > > > https://twitter.com/mtgrigorov
> > > > > >
> > > > > > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > > > > > tobiassolosche...@googlemail.com> wrote:
> > > > > >
> > > > > >> But they are add to the query string. This is really bad - maybe
> > it
> > > > > would
> > > > > >> be nice to add a new special attribute which is given directly
> to
> > > the
> > > > > >> jquery's data attribute. It would be possible to get the content
> > via
> > > > > >> inputstream of the httpservletrequest.
> > > > > >>
> > > > > >>
> > > > > >>
> > > > >
> > > >
> > >
> >
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerReque

Re: Ajax Post Data

2014-09-15 Thread Ernesto Reinaldo Barreiro
You can make it abstract with same callback methods as panel. Users can the
choose between panel or behavior.

On Mon, Sep 15, 2014 at 8:41 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi,
>
> it is not public static because of the use of ids and because of the
> callback methods.
>
> kind regards
>
> Tobias
>
> 2014-09-15 20:37 GMT+02:00 Ernesto Reinaldo Barreiro :
>
> > Hi,
> >
> > Thanks for sharing! Why not make HTML5FilesDropableAjaxEventBehavior
> public
> > static so that it can be reused independently of Panel?
> >
> > On Mon, Sep 15, 2014 at 8:30 PM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> > > Ok I solved my problem with the quickstart and some investigations
> about
> > > post requests:
> > >
> > > var reader = new FileReader();
> > > reader.onload = (function(file) {
> > > return function(e) {
> > > Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> > > file.name) + '&dropid='+dropid+'&fileid=' + fileid,
> > > ep:{data:btoa(reader.result)}, coh:[function(){
> > > // getFinishedUploadClientScript
> > > %s;
> > > }]});
> > > }
> > > })(file);
> > > reader.readAsBinaryString(file);
> > >
> > > I add the content of the file as base64 encoded binary string to the
> > > variable with the name data. The upload is now working like a charm.
> The
> > > only thing the developer has to know about is the max of mb (2mb in
> > example
> > > of tomcat) for post requests:
> > >
> > > https://github.com/klopfdreh/wicket-components-playground
> > >
> > > kind regards
> > >
> > > Tobias
> > >
> > >
> > > 2014-09-15 15:53 GMT+02:00 Martin Grigorov :
> > >
> > > > Please file a ticket with attached quickstart application.
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> > > > tobiassolosche...@googlemail.com> wrote:
> > > >
> > > > > Let me show an example (%s are going to be replaced with the url /
> > > > > callbackscript):
> > > > >
> > > > > $.ajax({
> > > > > type : 'POST',
> > > > > url : '%s&fileName=' + encodeURIComponent(file.name) +
> > > > > '&dropid='+dropid+'&fileid=' + fileid,
> > > > > data : file,
> > > > > contentType : false,
> > > > > processData : false,
> > > > >
> > > > > success:function(data, textStatus, jqXHR){
> > > > > var file = this.data
> > > > > // getFinishedUploadClientScript
> > > > > %s
> > > > > }
> > > > > });
> > > > >
> > > > > With this code I can invoke this on server side and read the data:
> > > > > ((HttpServletRequest)
> > > > >
> > RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > > > >
> > > > > ---
> > > > >
> > > > > Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> > > file.name)
> > > > +
> > > > > '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
> > > > > // getFinishedUploadClientScript
> > > > > %s;
> > > > > }});
> > > > >
> > > > > This code is not working with the server side handling of the post
> > > > content
> > > > >
> > > > > kind regards
> > > > >
> > > > > Tobias
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> > > > > tobiassolosche...@googlemail.com>:
> > > > >
> > > > > > No - I'm using Wicket.Ajax.post(...) - but if I do a normal
> $.ajax
> > > with
> > > > > --
> > > > > > type:post, contentType:false, processData:false --I can read the
> > > > content
> > > > > by
> > > > > > inputstream I saw that the attrs.ep are passed into the data
> > property
> > > > but
> > > > > > they are encoded which is wrong jQuery.param(data) line 634 of
> > > > > > wicket-ajax-jquery. And how can I set the other both options so
> > that
> > > I
> > > > > can
> > > > > > read the content via stream?
> > > > > >
> > > > > > Kind regards
> > > > > >
> > > > > > Tobias
> > > > > >
> > > > > > > Am 15.09.2014 um 15:28 schrieb Martin Grigorov <
> > > mgrigo...@apache.org
> > > > >:
> > > > > > >
> > > > > > > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post",
> > > })
> > > > > > then
> > > > > > > the parameters won't be in the query string.
> > > > > > >
> > > > > > > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...})
> > and
> > > > > > > depending on the used 'method' (GET or POST) they will be in
> the
> > > > query
> > > > > > > string or request body.
> > > > > > >
> > > > > > > Do you say that with method=post you still see the parameter in
> > the
> > > > > query
> > > > > > > string ?
> > > > > > >
> > > > > > > Martin Grigorov
> > > > > > > Wicket Training and Consulting
> > > > > > > https://twitter.com/mtgrigorov
> > > > > > >
> > > > > > > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > > > > > > tobiasso

Re: AuthenticatedWebSession.authenticate() not being called

2014-09-15 Thread Lucio Crusca
> Puzzled. I try to create a quickstart, but the real problem is that I'm
> pretty sure the quickstart will work perfectly. Even my code has worked
> perfectly for the last 2 years...

Here is a quickstart-like piece of code showing the problem (I obtained it
by cutting away unneded pieces from my project):

http://www.sulweb.org/download/sparsi/swquick.zip

any user/password will do (i.e. the code would accept any of them, but
they won't work anyway). I expect this code to login any user with any
password and reach AuthenticatedPage. It reloads the SignInPage instead
and the authenticate() method never gets called.




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



Re: Ajax Post Data

2014-09-15 Thread Tobias Soloschenko
Hi,

I will have a look at it, but I don't want the API to be changed. Thanks anyway 
for the Feedback.

kind regards

Tobias

> Am 15.09.2014 um 21:32 schrieb Ernesto Reinaldo Barreiro :
> 
> You can make it abstract with same callback methods as panel. Users can the
> choose between panel or behavior.
> 
> On Mon, Sep 15, 2014 at 8:41 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> Hi,
>> 
>> it is not public static because of the use of ids and because of the
>> callback methods.
>> 
>> kind regards
>> 
>> Tobias
>> 
>> 2014-09-15 20:37 GMT+02:00 Ernesto Reinaldo Barreiro :
>> 
>>> Hi,
>>> 
>>> Thanks for sharing! Why not make HTML5FilesDropableAjaxEventBehavior
>> public
>>> static so that it can be reused independently of Panel?
>>> 
>>> On Mon, Sep 15, 2014 at 8:30 PM, Tobias Soloschenko <
>>> tobiassolosche...@googlemail.com> wrote:
>>> 
 Ok I solved my problem with the quickstart and some investigations
>> about
 post requests:
 
var reader = new FileReader();
reader.onload = (function(file) {
return function(e) {
Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
 file.name) + '&dropid='+dropid+'&fileid=' + fileid,
ep:{data:btoa(reader.result)}, coh:[function(){
// getFinishedUploadClientScript
%s;
}]});
}
})(file);
reader.readAsBinaryString(file);
 
 I add the content of the file as base64 encoded binary string to the
 variable with the name data. The upload is now working like a charm.
>> The
 only thing the developer has to know about is the max of mb (2mb in
>>> example
 of tomcat) for post requests:
 
 https://github.com/klopfdreh/wicket-components-playground
 
 kind regards
 
 Tobias
 
 
 2014-09-15 15:53 GMT+02:00 Martin Grigorov :
 
> Please file a ticket with attached quickstart application.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> Let me show an example (%s are going to be replaced with the url /
>> callbackscript):
>> 
>>$.ajax({
>>type : 'POST',
>>url : '%s&fileName=' + encodeURIComponent(file.name) +
>> '&dropid='+dropid+'&fileid=' + fileid,
>>data : file,
>>contentType : false,
>>processData : false,
>> 
>>success:function(data, textStatus, jqXHR){
>>var file = this.data
>>// getFinishedUploadClientScript
>>%s
>>}
>>});
>> 
>> With this code I can invoke this on server side and read the data:
>> ((HttpServletRequest)
>>> RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>> 
>> ---
>> 
>>Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
 file.name)
> +
>> '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
>>// getFinishedUploadClientScript
>>%s;
>>}});
>> 
>> This code is not working with the server side handling of the post
> content
>> 
>> kind regards
>> 
>> Tobias
>> 
>> 
>> 
>> 
>> 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
>> tobiassolosche...@googlemail.com>:
>> 
>>> No - I'm using Wicket.Ajax.post(...) - but if I do a normal
>> $.ajax
 with
>> --
>>> type:post, contentType:false, processData:false --I can read the
> content
>> by
>>> inputstream I saw that the attrs.ep are passed into the data
>>> property
> but
>>> they are encoded which is wrong jQuery.param(data) line 634 of
>>> wicket-ajax-jquery. And how can I set the other both options so
>>> that
 I
>> can
>>> read the content via stream?
>>> 
>>> Kind regards
>>> 
>>> Tobias
>>> 
 Am 15.09.2014 um 15:28 schrieb Martin Grigorov <
 mgrigo...@apache.org
>> :
 
 If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post",
 })
>>> then
 the parameters won't be in the query string.
 
 wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...})
>>> and
 depending on the used 'method' (GET or POST) they will be in
>> the
> query
 string or request body.
 
 Do you say that with method=post you still see the parameter in
>>> the
>> query
 string ?
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
 tobiassolosche...@googlemail.com> wrote:
 
> But they are add to the query string. This is really bad -
>> m

Re: Ajax Post Data

2014-09-15 Thread Martin Grigorov
Hi Tobias,

On Mon, Sep 15, 2014 at 9:30 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Ok I solved my problem with the quickstart and some investigations about
> post requests:
>
> var reader = new FileReader();
> reader.onload = (function(file) {
> return function(e) {
> Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> file.name) + '&dropid='+dropid+'&fileid=' + fileid,
> ep:{data:btoa(reader.result)}, coh:[function(){
> // getFinishedUploadClientScript
> %s;
> }]});
> }
> })(file);
> reader.readAsBinaryString(file);
>
> I add the content of the file as base64 encoded binary string to the
>

Is the base64 encoded string sent as part of the query string or as request
body ?


> variable with the name data. The upload is now working like a charm. The
> only thing the developer has to know about is the max of mb (2mb in example
> of tomcat) for post requests:
>
> https://github.com/klopfdreh/wicket-components-playground
>
> kind regards
>
> Tobias
>
>
> 2014-09-15 15:53 GMT+02:00 Martin Grigorov :
>
> > Please file a ticket with attached quickstart application.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> > > Let me show an example (%s are going to be replaced with the url /
> > > callbackscript):
> > >
> > > $.ajax({
> > > type : 'POST',
> > > url : '%s&fileName=' + encodeURIComponent(file.name) +
> > > '&dropid='+dropid+'&fileid=' + fileid,
> > > data : file,
> > > contentType : false,
> > > processData : false,
> > >
> > > success:function(data, textStatus, jqXHR){
> > > var file = this.data
> > > // getFinishedUploadClientScript
> > > %s
> > > }
> > > });
> > >
> > > With this code I can invoke this on server side and read the data:
> > > ((HttpServletRequest)
> > > RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > >
> > > ---
> > >
> > > Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> file.name)
> > +
> > > '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
> > > // getFinishedUploadClientScript
> > > %s;
> > > }});
> > >
> > > This code is not working with the server side handling of the post
> > content
> > >
> > > kind regards
> > >
> > > Tobias
> > >
> > >
> > >
> > >
> > > 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> > > tobiassolosche...@googlemail.com>:
> > >
> > > > No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax
> with
> > > --
> > > > type:post, contentType:false, processData:false --I can read the
> > content
> > > by
> > > > inputstream I saw that the attrs.ep are passed into the data property
> > but
> > > > they are encoded which is wrong jQuery.param(data) line 634 of
> > > > wicket-ajax-jquery. And how can I set the other both options so that
> I
> > > can
> > > > read the content via stream?
> > > >
> > > > Kind regards
> > > >
> > > > Tobias
> > > >
> > > > > Am 15.09.2014 um 15:28 schrieb Martin Grigorov <
> mgrigo...@apache.org
> > >:
> > > > >
> > > > > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post",
> })
> > > > then
> > > > > the parameters won't be in the query string.
> > > > >
> > > > > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
> > > > > depending on the used 'method' (GET or POST) they will be in the
> > query
> > > > > string or request body.
> > > > >
> > > > > Do you say that with method=post you still see the parameter in the
> > > query
> > > > > string ?
> > > > >
> > > > > Martin Grigorov
> > > > > Wicket Training and Consulting
> > > > > https://twitter.com/mtgrigorov
> > > > >
> > > > > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > > > > tobiassolosche...@googlemail.com> wrote:
> > > > >
> > > > >> But they are add to the query string. This is really bad - maybe
> it
> > > > would
> > > > >> be nice to add a new special attribute which is given directly to
> > the
> > > > >> jquery's data attribute. It would be possible to get the content
> via
> > > > >> inputstream of the httpservletrequest.
> > > > >>
> > > > >>
> > > > >>
> > > >
> > >
> >
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > > > >>
> > > > >> kind regards
> > > > >>
> > > > >> Tobias
> > > > >>
> > > > >>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <
> > mgrigo...@apache.org
> > > >:
> > > > >>>
> > > > >>> With HTTP you can send either string or binary.
> > > > >>> You have to convert at the server side
> > > > >>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> > > > >>> tobiassolosche...@googlemail.com> wrote:
> > > > >>>
> > > >  And how do I read the ep / dep in the backend if they aren't of
> > 

Re: Ajax Post Data

2014-09-15 Thread Ernesto Reinaldo Barreiro
Hi,

You dont need to change your API: panel will remain the same.

On Tue, Sep 16, 2014 at 8:44 AM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi,
>
> I will have a look at it, but I don't want the API to be changed. Thanks
> anyway for the Feedback.
>
> kind regards
>
> Tobias
>
> > Am 15.09.2014 um 21:32 schrieb Ernesto Reinaldo Barreiro <
> reier...@gmail.com>:
> >
> > You can make it abstract with same callback methods as panel. Users can
> the
> > choose between panel or behavior.
> >
> > On Mon, Sep 15, 2014 at 8:41 PM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> >> Hi,
> >>
> >> it is not public static because of the use of ids and because of the
> >> callback methods.
> >>
> >> kind regards
> >>
> >> Tobias
> >>
> >> 2014-09-15 20:37 GMT+02:00 Ernesto Reinaldo Barreiro <
> reier...@gmail.com>:
> >>
> >>> Hi,
> >>>
> >>> Thanks for sharing! Why not make HTML5FilesDropableAjaxEventBehavior
> >> public
> >>> static so that it can be reused independently of Panel?
> >>>
> >>> On Mon, Sep 15, 2014 at 8:30 PM, Tobias Soloschenko <
> >>> tobiassolosche...@googlemail.com> wrote:
> >>>
>  Ok I solved my problem with the quickstart and some investigations
> >> about
>  post requests:
> 
> var reader = new FileReader();
> reader.onload = (function(file) {
> return function(e) {
> Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
>  file.name) + '&dropid='+dropid+'&fileid=' + fileid,
> ep:{data:btoa(reader.result)}, coh:[function(){
> // getFinishedUploadClientScript
> %s;
> }]});
> }
> })(file);
> reader.readAsBinaryString(file);
> 
>  I add the content of the file as base64 encoded binary string to the
>  variable with the name data. The upload is now working like a charm.
> >> The
>  only thing the developer has to know about is the max of mb (2mb in
> >>> example
>  of tomcat) for post requests:
> 
>  https://github.com/klopfdreh/wicket-components-playground
> 
>  kind regards
> 
>  Tobias
> 
> 
>  2014-09-15 15:53 GMT+02:00 Martin Grigorov :
> 
> > Please file a ticket with attached quickstart application.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> > tobiassolosche...@googlemail.com> wrote:
> >
> >> Let me show an example (%s are going to be replaced with the url /
> >> callbackscript):
> >>
> >>$.ajax({
> >>type : 'POST',
> >>url : '%s&fileName=' + encodeURIComponent(file.name) +
> >> '&dropid='+dropid+'&fileid=' + fileid,
> >>data : file,
> >>contentType : false,
> >>processData : false,
> >>
> >>success:function(data, textStatus, jqXHR){
> >>var file = this.data
> >>// getFinishedUploadClientScript
> >>%s
> >>}
> >>});
> >>
> >> With this code I can invoke this on server side and read the data:
> >> ((HttpServletRequest)
> >>> RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> >>
> >> ---
> >>
> >>Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
>  file.name)
> > +
> >> '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
> >>// getFinishedUploadClientScript
> >>%s;
> >>}});
> >>
> >> This code is not working with the server side handling of the post
> > content
> >>
> >> kind regards
> >>
> >> Tobias
> >>
> >>
> >>
> >>
> >> 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> >> tobiassolosche...@googlemail.com>:
> >>
> >>> No - I'm using Wicket.Ajax.post(...) - but if I do a normal
> >> $.ajax
>  with
> >> --
> >>> type:post, contentType:false, processData:false --I can read the
> > content
> >> by
> >>> inputstream I saw that the attrs.ep are passed into the data
> >>> property
> > but
> >>> they are encoded which is wrong jQuery.param(data) line 634 of
> >>> wicket-ajax-jquery. And how can I set the other both options so
> >>> that
>  I
> >> can
> >>> read the content via stream?
> >>>
> >>> Kind regards
> >>>
> >>> Tobias
> >>>
>  Am 15.09.2014 um 15:28 schrieb Martin Grigorov <
>  mgrigo...@apache.org
> >> :
> 
>  If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post",
>  })
> >>> then
>  the parameters won't be in the query string.
> 
>  wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...})
> >>> and
>  depending on the used 'method' (GET or POST) they will be in
> >> the
> >>>