It is currently 13 April 2021, 11:07 Advanced search

Enter Upload Mode

Questions and answers on how to best use Instant Developer

Enter Upload Mode

Postby john w » 12 March 2021, 16:52

I am using a Blob field to upload a file to my application. I do not need to save the file but I do need to process it for my purposes. All of my processes appear to be working. The problem I am having is I would like to the use the EnterUploadMode procedure. InDe will not let me use it in a form Load event, or elsewhere. So how can I make use of this? I am not using DO.

The goal is to set the the field to allow the user to simply choose the file without having to activate the function on the Blob field itself. It will save a step and be something more familiar to the user.

I someone can help me get this function into my app I do appreciate it.

Thanks...
Regards

John W
User avatar
john w
 
Posts: 633
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Enter Upload Mode

Postby ljwilson » 12 March 2021, 19:17

You mean it doesn't work or that you can not get it to appear in visual code?

The trick in the online documentation still works--lookup up the method then click to the Italian version. Often there is example code. I then run that through google translate. That shows the method is part of the blob panel field.
2021-03-12_14-15-40.png
2021-03-12_14-15-40.png (100.45 KiB) Viewed 292 times


This is the Italian code from the online help for EnterUploadMode translated:
Code: Select all
// ****************************************************************************
//Place the panel on the first category without image and prepare the
//field for loading
// ****************************************************************************
public void Categories.
{
   int line: = ONE
   //
   // I am looking for the first category without image
   for each row (Categories)
   {
     Record Categories
       int ID //
       string CategoryName //
       string Description //
       string Image //
     //
     // If it doesn't have the image
     if IsNull (Categories.Image)
     {
       // I position myself on that category and prepare the field for loading
       Categories.ActualPosition: = row
       Categories.Image.EnterUploadMode ()
       //
       // ... and I stop
       break
     }
     //
     // I keep looking
     line: = line + ONE
   }
}


...jack
ljwilson
 
Posts: 565
Joined: 26 November 2013, 14:15

Re: Enter Upload Mode - Update

Postby john w » 13 March 2021, 16:43

Sadly I cannot get the method to show in the editor. I am not sure what the issue is. I did see the information in the Italian forum. I know this has to be something simple I am missing.

Thanks for the response. I will keep slogging away and maybe I figure out the problem.

Update:
It was something simple. I was missing working with panel field vs the panel field value. I have placed it in the form load event. However it is still not displaying the Choose File process. I still have to click on the Upload Arrow. I will check to see what I must have missed in the settings.
Regards

John W
User avatar
john w
 
Posts: 633
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Enter Upload Mode

Postby ljwilson » 13 March 2021, 18:39

What theme are you using? I got it to work in Zen and Bootstrap. When I do blob uploads I have an imdb table using it. Steps I did:

  1. Added the OnChangeRow event to the panel where the blob field lives. In that event is the blob field's call to EnterUploadMode
  2. In the load event of the form where the blob panel lives, added this:
    Code: Select all
    executeOnClient("document.getElementsByName("blob")[0].click();")

The onChangeRow event gets called before the load event. As long as you only have one blob field on the panel then the javascript should work.

I got the idea of using the OnChangeRow event from reading some posts on the Italian Forum.

...jack
ljwilson
 
Posts: 565
Joined: 26 November 2013, 14:15

Re: Enter Upload Mode

Postby john w » 15 March 2021, 16:40

Thanks for the added suggestion I will give it try. It has to be something like this that I am missing.
Regards

John W
User avatar
john w
 
Posts: 633
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Enter Upload Mode

Postby john w » 16 March 2021, 17:26

The added script seems to have resolved the issue I was encountering. Thanks! Very much appreciated. Onward
Regards

John W
User avatar
john w
 
Posts: 633
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests