You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by oceatoon <t....@systheo.com> on 2004/08/19 11:54:54 UTC

Re: CForms: Bind Onload upload widget???

Hello

I am trying to declare a Java Pacakge in the  binding javascript/onload tag 
but I can't seem to get this to work??? 
 is it possible to import Java Packages like in flow in the binding 
javascript / onload tag ?

<fb:javascript id="path" path="@path" direction="load">
<fb:load-form> 
 var path = jxpathContext.getValue("@path");
 var uploadFile = new java.io.File(path);
 var uploadFilePart = 
Packages.org.apache.commons.httpclient.methods.multipart.FilePart(path,uploadFile);
  widget.setValue(uploadFilePart);
  </fb:load-form>
 </fb:javascript>


Thanks 
TIbor

oceatoon wrote:

> Hello everyone
> 
> I am faced with a pb to recover the content of my uplaod widget on bind
> load, since what I really bind onSave is the on server path(string) of my
> uploaded file.
> Therefore when I bind onLoad, the widget yiels offcourse because of
> getting a string instead of a Part type Object. So I looked for a
> constructor Part(string path) to put into the on bind load of the widget,
> but
> unfortunetly haven't found anything of the sort?  I might have missed it
> or is there some other technique ??
> 
> Thanks for the help
> Tibor



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CForms: Bind Onload upload widget???

Posted by oceatoon <t....@systheo.com>.
Thanks Bruno 

Indeed , the multiPart type isn't the same , This doesn't work.
well as anybody else would do in this case , I changed the idea :)
Anyhow thanks for he help
T.  
Bruno Dumon wrote:

> On Thu, 2004-08-19 at 11:54, oceatoon wrote:
>> Hello
>> 
>> I am trying to declare a Java Pacakge in the  binding javascript/onload
>> tag but I can't seem to get this to work???
>>  is it possible to import Java Packages like in flow in the binding
>> javascript / onload tag ?
>> 
>> <fb:javascript id="path" path="@path" direction="load">
>> <fb:load-form>
>>  var path = jxpathContext.getValue("@path");
>>  var uploadFile = new java.io.File(path);
>>  var uploadFilePart =
>>
Packages.org.apache.commons.httpclient.methods.multipart.FilePart(path,uploadFile);
> 
> you miss a 'new' keyword here.
> 
>>   widget.setValue(uploadFilePart);
> 
> but I don't think this will work, as the value for the upload widget
> should be a org.apache.cocoon.servlet.multipart.Part
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CForms: Bind Onload upload widget???

Posted by Bruno Dumon <br...@outerthought.org>.
On Thu, 2004-08-19 at 11:54, oceatoon wrote:
> Hello
> 
> I am trying to declare a Java Pacakge in the  binding javascript/onload tag 
> but I can't seem to get this to work??? 
>  is it possible to import Java Packages like in flow in the binding 
> javascript / onload tag ?
> 
> <fb:javascript id="path" path="@path" direction="load">
> <fb:load-form> 
>  var path = jxpathContext.getValue("@path");
>  var uploadFile = new java.io.File(path);
>  var uploadFilePart = 
> Packages.org.apache.commons.httpclient.methods.multipart.FilePart(path,uploadFile);

you miss a 'new' keyword here.

>   widget.setValue(uploadFilePart);

but I don't think this will work, as the value for the upload widget
should be a org.apache.cocoon.servlet.multipart.Part

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org