Re: fileupload element checking filename existing before upload using ajax

2008-08-27 Thread Mattom
Found a different solution, in case somebody is interested:

 fileUploadField.add(new AjaxEventBehavior("onchange")
{
protected void onEvent(AjaxRequestTarget target) {
Request request = RequestCycle.get().getRequest();
String filename = request.getParameter("filename");
System.out.println("filename is [" + filename + "]");
}

public CharSequence getCallbackUrl(boolean 
onlyTargetActivePage) {
CharSequence callBackUrl =  
super.getCallbackUrl(onlyTargetActivePage);
return callBackUrl + "&filename=' + this.value + '";
}

});

not as beautiful as I'd like to have it, because I'm manually messing around 
with the callback url, but it works :-).

:-),
Thomas


 Original-Nachricht 
> Datum: Wed, 27 Aug 2008 22:51:51 +0200
> Von: "Mattom" <[EMAIL PROTECTED]>
> An: users@wicket.apache.org
> Betreff: Re: fileupload element checking filename existing before upload 
> using ajax

> That's what I've found, too, that uploading using ajax is not possible. 
> 
> But :-), I don't need the upload to be ajax, all I need is the filename,
> as soon as the file was choosen by the user.
> That way I could validate the filename serverside, and provide immediate
> feedback, before the (maybe) long upload is performed.
> So, just adding a parameter to the ajax "onchange" call would do the
> trick. 
> 
> What I'll try now is adding another "hidden" ajax form, link the file
> upload element to a hidden field in this form, and then "manually" submit this
> form, by adding my own "wicket free" javascript... not beautiful, but
> should work.
> 
> Thanks for your help,
> Thomas
> 
>  Original-Nachricht 
> > Datum: Wed, 27 Aug 2008 08:57:01 -0700 (PDT)
> > Von: Michael Sparer <[EMAIL PROTECTED]>
> > An: users@wicket.apache.org
> > Betreff: Re: fileupload element checking filename existing before upload
> using ajax
> 
> > 
> > the problem is file uploading with ajax - that's just not possible
> > (restriction of the http protocol as far as I remember), however you can
> > 'simulate' using some approaches, e.g. a hidden iframe where you post
> your
> > file to. 
> > that topic has been discussed many times, just search the list - if i
> > remember correctly there's already a component for that somewhere in
> > wicketstuff ...
> > 
> > regards,
> > Michael
> > 
> > Thomas Lutz wrote:
> > > 
> > > Hi list !
> > > 
> > > I'm trying to build a upload form consisting of one ore more
> > fileuploads.
> > > 
> > > If the file(s) already exist(s) on the server, I'd like to throw a
> > > validation message, but, before uploading takes place.
> > > 
> > > I tried to attach AjaxEventBehavior to the FileUploadField, onchange
> is
> > > executed, but I've no access to the current value of the file input
> > > element. Tried AjaxFormComponentUpdatingBehavior as well, no success.
> > > 
> > > How should I approach this ? Basically all I need is ajaxing the
> > onchange
> > > with the "new value" back to the server.
> > > 
> > > Thanks for your help,
> > > Thomas
> > > -- 
> > > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
> > > Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
> > > 
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > > 
> > > 
> > 
> > 
> > -
> > Michael Sparer
> > http://talk-on-tech.blogspot.com
> > -- 
> > View this message in context:
> >
> http://www.nabble.com/fileupload-element-checking-filename-existing-before-upload-using-ajax-tp19181551p19184026.html
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> > 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -- 
> GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry
> Passion!
> http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

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



Re: fileupload element checking filename existing before upload using ajax

2008-08-27 Thread Mattom
That's what I've found, too, that uploading using ajax is not possible. 

But :-), I don't need the upload to be ajax, all I need is the filename, as 
soon as the file was choosen by the user.
That way I could validate the filename serverside, and provide immediate 
feedback, before the (maybe) long upload is performed.
So, just adding a parameter to the ajax "onchange" call would do the trick. 

What I'll try now is adding another "hidden" ajax form, link the file upload 
element to a hidden field in this form, and then "manually" submit this form, 
by adding my own "wicket free" javascript... not beautiful, but should work.

Thanks for your help,
Thomas

 Original-Nachricht 
> Datum: Wed, 27 Aug 2008 08:57:01 -0700 (PDT)
> Von: Michael Sparer <[EMAIL PROTECTED]>
> An: users@wicket.apache.org
> Betreff: Re: fileupload element checking filename existing before upload 
> using ajax

> 
> the problem is file uploading with ajax - that's just not possible
> (restriction of the http protocol as far as I remember), however you can
> 'simulate' using some approaches, e.g. a hidden iframe where you post your
> file to. 
> that topic has been discussed many times, just search the list - if i
> remember correctly there's already a component for that somewhere in
> wicketstuff ...
> 
> regards,
> Michael
> 
> Thomas Lutz wrote:
> > 
> > Hi list !
> > 
> > I'm trying to build a upload form consisting of one ore more
> fileuploads.
> > 
> > If the file(s) already exist(s) on the server, I'd like to throw a
> > validation message, but, before uploading takes place.
> > 
> > I tried to attach AjaxEventBehavior to the FileUploadField, onchange is
> > executed, but I've no access to the current value of the file input
> > element. Tried AjaxFormComponentUpdatingBehavior as well, no success.
> > 
> > How should I approach this ? Basically all I need is ajaxing the
> onchange
> > with the "new value" back to the server.
> > 
> > Thanks for your help,
> > Thomas
> > -- 
> > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
> > Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> 
> 
> -
> Michael Sparer
> http://talk-on-tech.blogspot.com
> -- 
> View this message in context:
> http://www.nabble.com/fileupload-element-checking-filename-existing-before-upload-using-ajax-tp19181551p19184026.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

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



fileupload element checking filename existing before upload using ajax

2008-08-27 Thread Mattom
Hi list !

I'm trying to build a upload form consisting of one ore more fileuploads.

If the file(s) already exist(s) on the server, I'd like to throw a validation 
message, but, before uploading takes place.

I tried to attach AjaxEventBehavior to the FileUploadField, onchange is 
executed, but I've no access to the current value of the file input element. 
Tried AjaxFormComponentUpdatingBehavior as well, no success.

How should I approach this ? Basically all I need is ajaxing the onchange with 
the "new value" back to the server.

Thanks for your help,
Thomas
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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



Re: wicket servlet mapping to subdirectory

2008-06-19 Thread Mattom
Hi !

No, sorry, maybe i was not precise enough, when i have the /app/* mapping, i 
can access my "HomePage" directly, but all links from the HomePage as well as 
the style sheet link and some image links (all within wicket:link) don't work, 
as the "/app/" part is missing. The only images working are the one from the 
tree I use as menu.

Basically I don't need the /app/ subdirectory, but servlet filters in oc4j seem 
to be rather buggy, and they are not called, if you don't have either a page or 
a directory, just ip:port/context/?... does not work, as the filters are not 
called.

So I tried to "trick" the filter (acegi) by adding a subdirectory... I guess I 
have to add some filterPath or filterMappingPath flag to the init-params of the 
servlet, but so far nothing worked. I'll dig into the sources deeper tomorrow.

Thanks !
Tom

 Original-Nachricht 
> Datum: Thu, 19 Jun 2008 21:42:45 +0100
> Von: "Gwyn Evans" <[EMAIL PROTECTED]>
> An: users@wicket.apache.org
> Betreff: Re: wicket servlet mapping to subdirectory

> When you say "I always get redirected to the root of the webapp", do you
> mean when first trying to access your app, you have to go via a redirect
> or
> some such that takes you to "http://www.mysite.com/"; or similar?
> 
> The 'traditional' trick was to have an index.html that redirected to
> "app/"
> as below - any uise?
> 
> 
> 
> 
> 
> 
> 
> /Gwyn
> 
> On Thu, Jun 19, 2008 at 5:30 PM, Thomas Lutz <[EMAIL PROTECTED]> wrote:
> 
> > Hi list !
> >
> > I am forced to use the wicket servlet (1.3.3) instead of the filter
> because
> > of oc4j.
> >
> > I mapped the servlet to
> >
> > 
> >   Wicket Webapp
> >   /app/*
> > 
> >
> > This does not work, I always get redirected to the root of the webapp,
> and
> > therefore none of my pages shows up. If I map to /*, everything works
> fine,
> > but then my acegi filters to not work...
> >
> > Is there any parameter I need to set to tell wicket about the different
> > location ? Or, is it possible to configure some fake name in front of
> the
> > request strings "?" ?
> >
> > Thanks a lot,
> > Tom
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]

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