Focal Point
Interactive form

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2451085562

January 11, 2008, 10:58 AM
Firoz
Interactive form
Hi,

I need to create an interactive form with two input fields and two output fields.

All four fields are fields of a same file from which data will be fetched. Also i want to display error messages if data not found and incorrect input values are entered and also incorporate function keys to go back.

Please assist.


Thanks

focus on mainframe client
Windows
Excel
January 14, 2008, 09:30 AM
GamP
Do you need to develop this form on your mainframe, using focus, or is it to be a web-form on the windows platform?

If it is to run under focus on mainframe, then I think you'd best go with maintain. This has all the functionality you looking for built into it.
If it's to run on the web, then actually you would be best off by using webfocus maintain, but then you'd need to have the product. And if your profile is correct, you don't.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
January 15, 2008, 09:43 AM
Maintain Wizard
To create a Mainframe Maintain application, from the VM or MVS command prompt, issue MPAINT. If you are in MVS, you should create a WINFORMS PDS. It has the same attributes as your FOCEXEC PDS.

You will then be prompted for the name of the application and the Master file that you want to operate on.

From there you can create a simple application that takes in the data and gives out messages. Check the Mainframe Maintain manuals on how to do this.

Mark
January 15, 2008, 09:45 AM
PBrightwell
are you wanting to update a database or just display data based on the entered values? If it is the latter, you can use dialogue manager to create a form I think the command is createform. If you are wanting to update the database, you will need modify. Check your user manual.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
January 16, 2008, 07:01 AM
Firoz
I only want to display the retrieved data on screen. As i have said above, I have two input fields and two output fields, And when i enter the values in input fields and press enter the data should come up in the output fields. And also i want the output fields to disable the cursor on them. Please send me an example code if possible.


Thanks

focus on mainframe client
Windows
Excel
January 16, 2008, 08:53 AM
PBrightwell
Sorry, I don't have an example you will have to do some research. What you are wanting is not really an interactive form you are trying to create input parameters for an online report. There are 2 ways to do this with regular Focus on the mainframe, one is to use -PROMPT the other is to create a form similar to what you would do with HTML on WebFocus. I think the start and end commands are -CRTFORM BEGIN and -CRTFORM END. everything in between will be on your form. If you don't have a user manual for your version of Focus you should be able to download one from tech support.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
January 16, 2008, 10:16 AM
Firoz
Is it possible to get the output data on the same form ??


Thanks

focus on mainframe client
Windows
Excel
January 16, 2008, 10:46 AM
GamP
Example:
two files, one htm and one fex. In the fex teh htm file is largely duplicated as you will see.
Both reside in my app folder SESSION, and this is also where the request points to.
First the htm, which you should start in the browser with the http address (I called it firoz.htm):
<HTML>
<BODY marginheight="20" marginwidth="20" leftmargin="20" topmargin="20">
<form name="form1" action='/ibi_apps/WFServlet' method='get'>
<input type="hidden" name="IBIF_focexec" value="firoz">
<input type="hidden" name="IBIAPP_app" value="SESSION"><br>
Input field1: <input type="TEXT" name="INFIELD1" value=""><br>
Input field2: <input type="TEXT" name="INFIELD2" value=""><br>
Output field1: <input type="TEXT" name="OUTFIELD1" value="" readonly><br>
Output field2: <input type="TEXT" name="OUTFIELD2" value="" readonly><br>
<br>
<input type=submit value="--> GO!">
</form>
</BODY>
</HTML>

And the fex (I called it firoz.fex):
TABLE FILE CAR
PRINT COUNTRY
WHERE COUNTRY CONTAINS '&INFIELD1';
ON TABLE HOLD
END
-RUN
-SET &OUTFIELD1=&LINES;

TABLE FILE CAR
PRINT CAR
WHERE CAR CONTAINS '&INFIELD2';
ON TABLE HOLD
END
-RUN
-SET &OUTFIELD2=&LINES;
TABLE FILE CAR
PRINT CAR BY COUNTRY
ON TABLE HOLD FORMAT HTMTABLE
END

-HTMLFORM BEGIN
<HTML>
<BODY marginheight="20" marginwidth="20" leftmargin="20" topmargin="20">
<form name="form1" action='/ibi_apps/WFServlet' method='get'>
<input type="hidden" name="IBIF_focexec" value="firoz">
<input type="hidden" name="IBIAPP_app" value="SESSION"><br>
Input field1: <input type="TEXT" name="INFIELD1" value=""><br>
Input field2: <input type="TEXT" name="INFIELD2" value=""><br>
Output field1: <input type="TEXT" name="OUTFIELD1" value="&OUTFIELD1" readonly><br>
Output field2: <input type="TEXT" name="OUTFIELD2" value="&OUTFIELD2" readonly><br>
<br>
<input type=submit value="--> GO!">
</form>
<BR>
!IBI.FIL.HOLD;
</BODY>
</HTML>
-HTMLFORM END

Now, when you run this code, in the first field enter a searchstring for country, in the second field enter a searchstring for car. The number of records found will come up in the first and second output field.

Hope this simple example will help you get where you want to be.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
January 16, 2008, 10:59 AM
Firoz
Hi,

How do I run this in mainframe environment ?


Thanks

focus on mainframe client
Windows
Excel
January 17, 2008, 02:40 AM
GamP
You'll need a browser and - webfocus - to run this.
I did not realize you don't have this. Sorry about that.
But, if it's just plain old focus you've got, then what do you mean with 'form'?
If you're planning to use crtform, then yes, you can mix content, and also make fields readonly and such.
I do not have any example at hand, but I recommend reading up on the crtform in the focus manual. There you'll find all that is needed to do just what you want.
CRTFORM can be used in Dialog manager and in MODIY.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
January 17, 2008, 04:15 AM
Firoz
Thanks Gamp, I will comeback to you if i have any problems.


Thanks

focus on mainframe client
Windows
Excel