cancel
Showing results for 
Search instead for 
Did you mean: 

FileUpload - strange behaviour

Former Member
0 Kudos

Hi all,

I'm experiencing a strange problem with the FileUpload control:

--> I have a default view '<i>UploadView</i>'.

--> <i>UploadView</i> its context has one binary value attribute '<i>data</i>'

--> <i>UploadView</i> contains a FileUpload control. The data property of that control has been bound to the context attr '<i>data</i>'

--> <i>UploadView</i> contains a button. An eventhandler is set for the button. In the eventhandler <i>wdFirePlugToResultView()</i> is called. <i>ResultView</i> is another view connected with <i>UploadView</i>.

When I execute the application & I put put a url in the FileUpload Control & I click on the button, the only thing I see is the <i>UploadView</i> being refreshed?? So no <i>ResultView</i> is shown?

Why is that?

Thanks in advance,

Jeroen

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

achim_hauck2
Active Contributor
0 Kudos

Jeroen,

are you sure, the strange behaviour is because of the Upload-UI-element?

Does the navigation work without the Upload-element on the UploadView?

kr, achim

Former Member
0 Kudos

Yes: when I disable the FileUpload UI element, everything works as expected

When I leave the URL field empty (with FileUpload element enabled), navigation also works...

achim_hauck2
Active Contributor
0 Kudos

to my knowledge the upload-element works like this:

you browse to a file and press the upload button, then the the file is uploaded & the input-filed is empty again.

so, how is it possible that there's an URL entered in the input-field in your case? do you enter it manually afterwards?

maybe this works:

you empty the context-element bound to the "fileName"-property before you navigate to the next view manually in your code.

kr, achim

Former Member
0 Kudos

Achim,

What do you mean by "the upload button"? The FileUpload-element has only a browse button. The button I'm referring to is an ordinary button I've put in the view. So what I'm doing is:

1. Start app

2. Fill in a (local) URL in the (empty) field of the FileUpload-element (either manually or by using the browse button)

3. Click on my 'ordinary' button: the upload seems to start (I don't know why: I've never explicitly coded that), but when it's done, instead of executing the event-handler associated with my button (= going to another view), the view with the FileUpload-element is shown again (with an empty URL field)

What exactly is supposed to trigger the upload?

The strange behaviour I'm referring to is that

1. The upload seems to start although I've never explicitly coded that

2. the event handler of my button isn't executed when I click on it (except when I disable the FileUpload element or when I leave its URL field empty)

Hope I'm clear...

Former Member
0 Kudos

>you browse to a file and press the upload button, then

>the the file is uploaded & the input-filed is empty

>again.

When you browse to a file, & choose it, it is not uploaded but only its URl is filled in...

achim_hauck2
Active Contributor
0 Kudos

you're right. I've added a regular button to "upload" the file, too.

anyway, try to empty the context element that is bound to the "fileName"-Property before you fire the plug to the next view like:


wdContext.current<yourNode>Element.set<PropertyName>("");

where do you want to use the "data" of the upload? in your view with the upload-element or in the next view?

kr, achim

Former Member
0 Kudos

I do not need the filename, only the data, so I haven't bound the filename property to a context value attr...

the data will be used in the next view

achim_hauck2
Active Contributor
0 Kudos

well, then I suggest to bind the "fileName"-property to a contextelement and clear it as proposed before

if the "data"-bound contextelement is mapped to the next view (with an intermediate controller) you can process it there.

kr, achim