Handling POST Method Submit Parameters

You can have a static html page holding hidden fields and start a Genero application with the hidden field values as parameters. These parameters are not visible to the end user.

Example html page: arguments.html
<html>
  <body>
    <form action="http://localhost:6394/wa/r/ArgumentsAllow" method="post">
      <input type="hidden" name="Arg" value="arg1" />
      <input type="hidden" name="Arg" value="arg2" />
      <input type="submit" value="Send" />
    </form>
  </body>
</html>

The method used is "post" and "submit" action should be executed.

Example application configuration file: ArgumentsAllow.xcf
<?xml version="1.0" encoding="UTF-8"?>
<APPLICATION Parent="defaultgwc"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/2.30/cfextwa.xsd">
   <EXECUTION AllowUrlParameters="TRUE">
     <PATH>C:\path-to-your-application\</PATH>
     <MODULE>arguments.42m</MODULE>
   </EXECUTION>
</APPLICATION>     

The "AllowUrlParameters" should be set to "TRUE".

You can get the parameters value with this kind of 4gl application: arguments.4gl
MAIN
  DEFINE
    i INTEGER,
    n INTEGER,
    s STRING
  
  OPEN WINDOW win WITH FORM "arguments"
 
  LET n = num_args()
  LET s = ""
  FOR i = 1 TO n
    LET s = s.append("\narg [" || i || "]=" || arg_val(i))
  END FOR
 
  DISPLAY s TO text
  
  MENU "Main"   
    COMMAND "exit"
      EXIT MENU
  END MENU
END MAIN

After executing the submit action, the application will get and display the values of the "arg1" and "arg2" parameters. These values are not visible in the url. Using this method, you can handle POST method submit parameters with the GWC.