Page 1 of 1

The Upload Widget

Posted: Wed Apr 21, 2021 10:02 am
by ahellsten
Hello,
we just upgraded Profound UI and suddenly the Upload widget returns more information than expected.

For example:
'Upload[x][/color]Sandoz Ct Chg Notification.msg (74.5 KB)' instead of 'Sandoz Ct Chg Nortification.msg'

Now data coming back is not parsed correctly.

What can we do?

Re: The Upload Widget

Posted: Wed Apr 21, 2021 4:14 pm
by Scott Klement
Hello!

Sorry to hear that you've run into troubles. If I understand correctly, you've run into a change in the way filenames are displayed in the upload widget? This is odd because we haven't made any changes to that. Just some routine bug fixes were made, but I don't see how that would affect your screen.

Can you explain the problem a little more? I'm not completely sure I understand. Are you referring to the (74.5 KB) showing in the widget? As far as I'm aware, that's always been there. Or, are you referring to the Upload[x][/color] that you mentioned? That is really strange, I've never seen that before, and it looks more like something from these forums than something from Profound UI, which makes me think that's not what you mean?

In any case, none of this should be in the data structure that's sent to your program, so I'm not understanding exactly what problem you're running into.

Re: The Upload Widget

Posted: Wed Apr 21, 2021 4:33 pm
by ahellsten
Hi Scott,
Yes I am referring to the 'Upload[x]' part of the message. I am sorry but when I pasted the result I didn't notice the [/color] that I don't actually see on the screen.
I have attached a screen shot of the widget.

Re: The Upload Widget

Posted: Wed Apr 21, 2021 4:39 pm
by Scott Klement
Hello,

It looks correct in the upload widget to me. However, you are having problems in a separate widget, looks like a textbox widget or something similar. Can you tell us how your program takes the data from the upload widget and puts it into those textboxes?

I'm guessing you've written some sort of custom JavaScript code that extracts that, somehow? But, that would be your own custom code -- we don't include anything like that in the product (at least, not to my knowledge.)

Re: The Upload Widget

Posted: Wed Apr 21, 2021 4:52 pm
by ahellsten
Yes I can see that too that the file name comes over correctly.
But I don't understand why the Javascript suddenly doesn't work as before.
'On Change' we run the attached script.

Re: The Upload Widget

Posted: Wed Apr 21, 2021 5:47 pm
by Scott Klement
It looks like you are calling getInnerText() against the upload widget, then splicing out everything between the word "Clear" and the word "Remove" and assuming this is the filename. This is not a supported way to get the filenames from the upload widget -- and will break if even minor changes are made to the HTML structure.

In this case, we made a change in January 2020 (so about 15 months ago) that fixed the browser freezing up when using the upload widget under a particular set of circumstances.

Normally, this would not cause a problem -- except, the way you're using getInnerText() relies on the underlying HTML structure being 100% the same as before.

Please consider updating your code to use the getFileNames() function that we document and provide for this purpose. That way, when we make changes, it won't cause your custom code to fail.
https://docs.profoundlogic.com/x/SAFIAg

Re: The Upload Widget

Posted: Wed Apr 28, 2021 10:46 am
by ahellsten
The UPLOAD widget is working again now that we use the getFileNames() function instead.
Thank you!