Display import count on Excel import

Display import count on Excel import

  
I'm doing an Excel import and I want to display a count of how many records have been created while it's running. The import button needs to be a submit, so I'm guessing that's why Ajax refreshes of any counter on the screen doesn't work. Does anyone have any suggestions?
Thanks!
Hello,

Create a local variable (ex: count) starting on 0 (zero).

each time a record is imported: count=count+1

In the end: return / show count

Hope it helps,
Luis Paulo Soares


Gerry wrote
:
I'm doing an Excel import and I want to display a count of how many records have been created while it's running. The import button needs to be a submit, so I'm guessing that's why Ajax refreshes of any counter on the screen doesn't work. Does anyone have any suggestions?
Thanks!
 
 
lpsoares wrote:
Hello,

Create a local variable (ex: count) starting on 0 (zero).

each time a record is imported: count=count+1

In the end: return / show count

Hope it helps,
Luis Paulo Soares

 
 
 
 I know I can do that. I want to show the counter while the import is running. That's the problem.
Gerry wrote:
 
 I know I can do that. I want to show the counter while the import is running. That's the problem.
 
 Hi Gerry,

Since you're doing a file upload the button you use will need to be a Submit, meaning you won't be able to send back Widget Refreshes during that screen action.

This means that, to do something like that, you will need to first submit the file, somehow store the binary data somewhere (session var?), and then on another call back to server (this time via ajax) create the records one at a time sending Widget Refreshes in the meantime.

Hope this helps,


Miguel
Hello,

On the submit button you can store the binary on a table and try to process it after. I think you can use the widget_click to process a ajax action after the upload. Correct me if my idea is wrong.


Miguel Melo wrote
:
 
 Hi Gerry,

Since you're doing a file upload the button you use will need to be a Submit, meaning you won't be able to send back Widget Refreshes during that screen action.

This means that, to do something like that, you will need to first submit the file, somehow store the binary data somewhere (session var?), and then on another call back to server (this time via ajax) create the records one at a time sending Widget Refreshes in the meantime.

Hope this helps,


Miguel
 
 
lpsoares wrote:
Hello,

On the submit button you can store the binary on a table and try to process it after. I think you can use the widget_click to process a ajax action after the upload. Correct me if my idea is wrong.
 
 
Yes. During the Submit action (where you upload the file) you can do a RunJavascript() (this action is in the HTTPRequestHandler extension) to queue some js execution for when the page reloads. The Js could be something like

osjs('#MyButtonId').click();

Which will call button MyButtonId, a potentially hidden ajax button, to do the record creation run.


Miguel