PxPlus User Forum

Twitter Twitter Twitter

Recent Posts

Pages: [1] 2 3 ... 10
1
Phil

There are any number of ways to add a printer list to a Webster+ panel.

If you have the list in a variable you can simply do something like:

[list printer$][data text=(printerlist$)][/list][/b]

You can see this in the *webster/pages/reports.html file where the system loads variable fieldNames$ which was added to the form using a [hide] short code.  This variable was loaded in the [form program=*report] which runs the INIT event in *webster/report.

Personally though I wouldn't put the printer list in the form.  No need to have the system load it on every request.  On windows you can have a fairly significant delay to get the list of printers if some of them are offline or misconfigured.

Instead I would create a drop down query for a printer$ input field and set the field as 'required'.  Whenever printer$ input is changed I would have an event that updates the user data with the last requested printer using the %webster'SetUserData() method so that all subsequent requests will have %usr.Printer$ with the last selected printer.  You can then use an [exec printer$=%usr.printer$] in your logic to initialize the value.

There are other methods such as using cookies, but personally I would suggest using the user data as that would provides consistency for the user regardless as to the browser.

2
Phil,

The difficulty here is that (I'm assuming) the list or printers needed is variable.  Because of this, the data needed for the drop box needs to be written to a memory file.

I tried the following and it seems to work (although I have not coded a Printer_Validate method).

1) Edited the _fm_panel_iol$ hidden variable in the html file to include printer$
2) Included the following code for the printer drop box:

 [row "*\[show usefile field=printer$\]:"][list printer$ size=20 event=Printer_Validate program=c:\webster\prog\tools][/list][/row]<br>

3) Coded the c:\webster\prog/tools program to load a memory file as follows:

 ! tools - load printer list
 !
  ENTER fileno
 !
  OPEN (HFN)"*memory*"
  fileno=LFO
 !
  printer_list$="Printer A/Printer B/Printer C/"
  FOR val$ FROM printer_list$
  WRITE (fileno,KEY=val$)
  NEXT
 !
  EXIT 

You would need to edit your Printer_List method accordingly.

Hope this helps!
3
Programming / Re: close programme
« Last post by EVa on Today at 04:27:57 AM »
Without knowing what's in the PFILEBOX program, it's impossible to tell why this isn't working all of the time.  Also, your PxPlus version looks pretty old (I'm guessing v11 or older) - you could check if the problem still happens when using a current version of PxPlus.
4
Programming / Re: close programme
« Last post by Danilo David on May 15, 2024, 11:22:51 PM »
Hello

im using this line codes to upload a file:
32420 CALL %WINDX$+%DF1_SDRIVE$+"D"+"F"+"1"+"\"+"P"+"R"+"O"+"G"+"_"+"D"+"F"+"1"+"\"+"P"+"F"+"I"+"L"+"E"+"B"+"O"+"X",INPUT_PAD$,START_PAD$,MSG("Excel facescanner")


Thank you

regards,
Danilo



5
Webster Plus / Re: Retrieving calculated string from program to web page
« Last post by pwhirley on May 15, 2024, 03:34:55 PM »
Thanks Susan,

Your understanding is correct.  I have tried adding a line down where all the other hidden variables are.  it looks like this:
[hide printerList$ value=""]

That didn't work, so I also tried adding printerList$ to the _fm_panel_iol$ value, also at the bottom of the page. 

Your suggestion suggests that I'm not totally ignorant, thankfully.  I think I understand this but I'm doing something wrong.

Phil
6
Webster Plus / Re: Retrieving calculated string from program to web page
« Last post by Susan Cryderman on May 15, 2024, 02:52:51 PM »
Phil,

Just for clarification - you may NOT want to use the File Maintenance Generator method for adding the hidden variable as this would over-write the previous edits you made to the html file.
7
Webster Plus / Re: Retrieving calculated string from program to web page
« Last post by Susan Cryderman on May 15, 2024, 02:40:16 PM »
Hi Phil,

If I'm understanding this correctly - printer$ is the element in the data file being maintained and printerList$ is the delimited list of available printers (that is not an element in the data file).

I have not tried this - but it sounds like you might need to add a Hidden Variable to the form.  You can do this by adding a line using the [hide] short code to the generated html page that looks something like:

[hide printerList$ value=""]

 - or -

If you are running PxPlus 2022 or later, you should be able to also do this from within the File Maintenance Generator.  Press the Hidden Variables button on Step 6 and add an Additional Variable of printerList$.
 
8
Webster Plus / Retrieving calculated string from program to web page
« Last post by pwhirley on May 15, 2024, 11:32:31 AM »
I'm not sure how best to explain my question. I feel sure it is an easy solution but I'm tired of trying to figure it out.
I have a file maintenance page generated through the NOMADS tools.  It works just fine and I've been able to do some tweaks.  I have copied _fm_webmaint to my progs folder and modified it and all the mods work except one.  One of the fields available to edit is the selected Printer.  I have made this a drop box and intend to offer a list of the available printers ON THE SERVER.  I inserted this line within the <form>:
[execute perform "Tools;Printer_List"]
The line executes and creates a variable, printerList$ that has a delimited list of available printers.  I cannot figure out how to make that variable available on the page so that it shows up in the line below:

[row "*\[show usefile field=printer$\]:"][list printer$ usefile event=Printer_Validate]
      [data rowsep=/]printerList$[/data][/list]
   [/row]<br />[/font][/font][/size][/size]

I have tried using %webster'Update(printerList$,mynewlist$) in my program, but I cannot get any data in the variable printerList$ on the web page.

Any help would be appreciated.  It is something simple, I am certain.

Thanks - Phil
9
Programming / Re: close programme
« Last post by EVa on May 15, 2024, 05:58:40 AM »
Can you explain what you mean by "uploading a file in the system" ?  Are you using iNomads or the webserver or Webster+ ?  Or is it an FTP upload ?  Do you have a screenshot of the popup ?
10
Programming / Re: close programme
« Last post by Danilo David on May 15, 2024, 02:23:35 AM »
hello,

Anyone knows, sometimes when Im uploading a file in the system
theres a popup "close programme" then when you press ok it will close everything
but thats not always like that, sometimes is ok.

Thank you for your reply
regards,
Danilo
Pages: [1] 2 3 ... 10