NetTalk Central

Author Topic: file upload problem/question  (Read 3805 times)

cwtart

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • CommPay Software
    • Email
file upload problem/question
« on: June 09, 2013, 04:44:44 AM »
C8 9661 NT 7.10

I have a NetWebForm that has two controls - one is a File Upload and the other is a text field. The text field is meant to show the results of the uploaded file processing.

I am uploading a .xls spreadsheet and in the SaveFile Routine I use EasyExcel to extract the data from the spreadsheet and create .tps records - this all works fine. But I want to display the results of the data extraction. I save the results of the file processing to a string variable (record counts, record types, etc.) and the string variable is the field for the text field on the form.

I cannot get the text field to automatically refresh after the file processing - the only way I can see the results displayed in the text field is to click on the text field after the file upload and process. I have added the text field to the reset list in the FileUpload control but no refresh.

I have even tried to use Alert (set loc:alert) in the SaveFile Routine but Alert will not display from there.

Any suggestions? Thanks.

Chuck

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: file upload problem/question
« Reply #1 on: June 09, 2013, 06:03:09 AM »
Hi Chuck,

>> I save the results of the file processing to a string variable (record counts, record types, etc.) and the string variable is the field for the text field on the form.

you need to update the session value, not the local value (although that does no harm.) ie not so much

loc:whatever = someresult but
p_web.SetSessionValue('loc:whatever',someresult)


cheers
Bruce

cwtart

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • CommPay Software
    • Email
Re: file upload problem/question
« Reply #2 on: June 09, 2013, 07:17:04 AM »
Bruce,

I am, of course, updating the session value of the text variable right at the end of the uploaded file processing.

And I know it is being updated because when I click on the text control the string data displays.

The problem is I have to click (select) the text control before it displays. And the only reason that works is because in validate-client-side tab for the text control I have ticked refresh on select.

And why does setting loc:alert in the SaveFile embed not cause an alert dialog to display?

Chuck

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: file upload problem/question
« Reply #3 on: June 09, 2013, 09:08:20 PM »
>> I am, of course, updating the session value of the text variable right at the end of the uploaded file processing.

you see the problem when the question is incomplete. The shortest, quickest way to an answer is to post an example. Grab one of the shipping examples, add a couple fields, replicate the effect, and post here. Trying to figure it out by guessing is not very efficient.

cheers
Bruce

cwtart

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • CommPay Software
    • Email
Re: file upload problem/question
« Reply #4 on: June 10, 2013, 03:30:20 AM »
Bruce,

Rather than apparently taking offense where none was intended, why can't you answer my question? I have given a lot of information in my two posts on this thread.

"why does setting loc:alert in the SaveFile embed not cause an alert dialog to display?"

By design or by accident, loc:alert does not work in this embed. I am either doing something wrong, misunderstanding the sequence of things, or there is an actual problem here.

Shipping example 26 displays the same behavior. Perhaps because only validate embeds are meant for this? All I want to do is display the results of the processing of the uploaded file. Techniques that normally work in the form  validation embeds do not work in the SaveFile embed.

Chuck

NetTalk 4
NetTalk 7
File Explorer
File Explorer 5
FM2
FM3
Draw
AnyFont
Cryptonite
GPF Reporter
Hot Dates
Hyperactive
Message Box
Self Service
String Theory
Tearoff
Winevent
XFiles
Makeover

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: file upload problem/question
« Reply #5 on: June 10, 2013, 05:42:58 AM »
hi Chuck,

<< Rather than apparently taking offense where none was intended,

I promise you mate - no offense was taken. I apologize if it came through like that. And I didn't intend to cause any offense either.

>> why can't you answer my question?

It's a function of numbers. I get a fair few requests for help each and every day. I answer where I can, but where I can't duplicate an effect I ask for an example. Generally speaking requests that include an example always get priority when getting answered (although it doesn't always feel like that.)

Bear in mind that your app can be in any one of a bunch of modes (page, popup, content-body, mobile, front-loaded), and the fields themselves can also have any number of settings at the global, procedure, or field level which can cause any problem. Despite it "being easy" to switch from one mode to another and so on the actual underlying code is _very_ different from one mode to the next.

>> By design or by accident, loc:alert does not work in this embed. I am either doing something wrong, misunderstanding the sequence of things, or there is an actual problem here.

I completely agree. So we can approach this one of two ways - I can try and guess which mode, and sequence of events you are using, or I can test in all possible modes, or you can post an example with a "way to duplicate", (or tell me a route to duplicate in a shipping example.) Ok that's 3 ways. The first seldom leads to the actual answer, and the second takes a long time (which moves your request down the list) so I always recommend approach 3. It's fast, simple, and gets me to the root of the problem as fast as possible.

again - I'm not saying this to offend - I'm saying it because I have to handle requests from a lot of developers, and I need to be efficient or I'll never get through the work (never mind get any new work done.).

I understand you have one simple question, and you want a quick answer. I have dozens of those every day, so any help you can give me in getting to your answer quicker really helps me.

>>Shipping example 26 displays the same behavior.

I can run it here, tell me where to go and what to look for. (if you made any changes be sure to post the updated app & always include the dict, here.)

cheers
Bruce