Submit button to execute .Net VB program

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
TracyC
Posts: 3
Joined: Sat May 20, 2017 5:46 am

Submit button to execute .Net VB program

Post by TracyC »

In one of our WAMs I have a Submit button defined on the page as:
<input onclick="{$SBMJS}" id="EFSUBMIT"
style="color: white; background-color: DarkBlue; height: 21px;"
type="submit" usemap=" " value="Submit" />

In that Wam’s rdmlx code #SBMJS is set like the following in order to execute a .Net VB program passing in data from the WAM page:
#SBMJS := "document.forms['LANSA'].action='http://domain:port/PGMA.aspx';document.forms['LANSA'].submit();"

How do I accomplish the same thing in a Visual Lansa (V14) reusable part?
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

Re: Submit button to execute .Net VB program

Post by MarkDale »

I think you are basically opening a URL on the client.

The VL web reusable part is already running on the client, so these two ways might suit

Either

Code: Select all

Define_Com Class(#PRIM_WEB.Page) Name(#WebPage) Description('Web Page') Displayposition(1) Height(327) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Width(587)
...
#WebPage.Source := 'http://domain:port/PGMA.aspx'

OR

Code: Select all

#sys_web.Navigate Target(New) Url('http://domain:port/PGMA.aspx')
If you need to get additional data from the web page to the .Net program, the easiest way would be to include it as parameters on the URL, (and modify the .Net program to get its data that way)
TracyC
Posts: 3
Joined: Sat May 20, 2017 5:46 am

Re: Submit button to execute .Net VB program

Post by TracyC »

Thank you for your response. I would need to encrypt (at least some of) the data before adding it to the URL and decrypt it in the .Net program. I was hoping not to have to do that. Are there alternative(s) for getting the data to the .Net program from my reusable part?
tsupartono

Re: Submit button to execute .Net VB program

Post by tsupartono »

I'm not entirely clear on the problem, but if what you want is to do a POST request from the browser, you can use PRIM_WEB.HttpRequest

See the documentation below for more details:
http://docs.lansa.com/14/en/lansa016/pr ... equest.htm

Question:
When you say you have to encrypt the data before adding to the URL, are you worried about the data appearing on the address bar of the browser?
TracyC
Posts: 3
Joined: Sat May 20, 2017 5:46 am

Re: Submit button to execute .Net VB program

Post by TracyC »

Yes, there's sensitive data that I don't want to be seen in the URL. I do want to do a post, so I think the prim_web.httpRequest looks like it'll work for me. Thank you!
Post Reply