sa_sch
28th March 2012, 11:54
Hi all,
we have a session where we import ascii data out of a local file. The path of this file has to be filled by the user, therefore he has two possibilities. The session contains a form field where he can enter the full path of the local file and a button which opens a dialog box to select a local file.
In Worktop the users are used to enter the drive like “V:\” into the form field and press the button to open the dialog box in this folder. Everything fine. But now we tested it in Webtop. Although the function behind the button starts the dialog box, it doesn’t open the entered path.

Here is the code of the external function behind the button:

function extern browse.local()
{
long ret
domain tcmcs.str100 temp.path

if isspace(f.path) then
f.path = "c:\temp"
endif
ret = seq.open.dialog.local(false,"", f.path,"*.*",temp.path)
if ret = 1 or ret = 0 then
f.path = strip$(temp.path)
endif
}

While additional tests we found 2 problems:
- The function doesn’t recognize that the user has entered a value into the form field (extern variable f.path)
- Even after setting “c:\temp” in the variable f.path the seq.open.dialog.local() function doesn’t open this path. Instead it opens a default folder.

How do we have to change the code that this functionality also runs in Webtop? Has anybody an idea?

Thanks in advance and regards
sa_sch

zardoz
4th April 2012, 12:02
It just happened to my code, that works in bw but not in webtop. It seems that sometimes in webtop some form fields - in type 4 sessions - aren't get.
If I remember correctly, just add a "check.all.input()" as first line of code in your function to solve this.

vahdani
4th April 2012, 13:34
Hi,

I hav had good experience of using zoom functionality:

I define zoom to session but without any session for form field and then add following to the script:


field.file.f:
before.zoom:
g.ret = seq.open.dialog.local(
false, |boolean mselect,
"", |string defaultname,
"", |string directory,
"All Files(*.*)|*.*|Text Files(*.txt, *.csv)|*.txt;*.csv", |string filter,
file.f) |ref string filename)
input.again()

Virender
4th April 2012, 14:46
Hi Sa

Try using client2server function, let user select the file through browsing location.

tmpfile = creat.tmp.file$( bse.tmp.dir$() )
client2server(file.c, tmpfile, fp, false, true)
fp = seq.open(tmpfile, "r")

Other possibility may be to use latest WebUI version, check the release of your WebUI version and see if there is any update available on Infor site as per your environment and deploy the same in your host.

All the best.

Virendra

sa_sch
4th April 2012, 15:03
Hi all,

thanks for your answers!

@zardoz: I just tested with check.all.input(). It doesn’t solve the problem but it gave me another idea. I forgot to mention that the button is declared as form command with command type = field behind the form field path. It seems that the time of pressing the button is too early for webtop. The value I’ve putted in the form field path hasn’t been set into the variable when I press the button direct after input. The variable is empty when I check it. But if I tab above the button to the next form field and press the button after, the function gets the value of the form field and opens with the right path.
So is there a function with which the value on the form can be set or saved correctly in the variable? Then I will call this as first line of code in my browse.local() function.

@vahdani: Zoom functionality unfortunately didn't have any effects on the behaviour...

@Virender: I think we use the latest WebUI, but I will check again and also look after client2server functions. I don't know a lot about them so I will check if they match in this case.

Regards

Rinkashiki
5th November 2013, 03:00
Hello.
Thank you very much everyone for solutions. A very necessary thing.