The Upload Widget

Use this board to ask questions or have discussions with other Universal Displays users.
ahellsten
New User
Posts: 4
Joined: Thu Jun 14, 2018 11:11 am
First Name: Asa
Last Name: Hellsten
Company Name: Anda Pharmaceuticals
State / Province: Florida
Country: United States
Contact:

The Upload Widget

Post 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?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: The Upload Widget

Post 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.
ahellsten
New User
Posts: 4
Joined: Thu Jun 14, 2018 11:11 am
First Name: Asa
Last Name: Hellsten
Company Name: Anda Pharmaceuticals
State / Province: Florida
Country: United States
Contact:

Re: The Upload Widget

Post 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.
Attachments
Upload Widget problem.docx
(35.53 KiB) Downloaded 841 times
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: The Upload Widget

Post 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.)
ahellsten
New User
Posts: 4
Joined: Thu Jun 14, 2018 11:11 am
First Name: Asa
Last Name: Hellsten
Company Name: Anda Pharmaceuticals
State / Province: Florida
Country: United States
Contact:

Re: The Upload Widget

Post 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.
Attachments
Jav Script for File name check and extraction.txt
(1.79 KiB) Downloaded 834 times
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: The Upload Widget

Post 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
ahellsten
New User
Posts: 4
Joined: Thu Jun 14, 2018 11:11 am
First Name: Asa
Last Name: Hellsten
Company Name: Anda Pharmaceuticals
State / Province: Florida
Country: United States
Contact:

Re: The Upload Widget

Post by ahellsten »

The UPLOAD widget is working again now that we use the getFileNames() function instead.
Thank you!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests