Increase the System Inquiry Reply Line Size in WebFacing
April 20, 2005 Michael Sansoterra
WebFacing is a good tool for making green screen applications available for use in the ubiquitous browser. The technology has sufficiently matured to the point where 5250 applications can be tailored to be fairly consistent with true Web applications–with some work, of course. However, even though it is free, there are a few features unavailable with standard WebFacing.
The most grievous of these omissions is WebFacing’s inability to render system screens such as those produced by the WRKSPLF or RUNQRY commands. (Actually, system screens can be WebFaced, this just isn’t a “free” feature–one has to purchase the Advanced Edition of the WebSphere Development Studio Client for each developer doing advanced WebFacing.)
Although most system screens will not render with the standard WebFacing tool included with WDSc, of necessity, IBM has been kind enough to allow the message inquiry and change password screens to function in the WebFacing environment!
All of that boring background was given just to present a challenge I encountered while WebFacing an application. I needed the ability to run some parameterized Query/400 queries. However, understanding that system screens like the “Select Records” prompt of the Run Query (RUNQRY) command would be unavailable in a WebFacing environment, I decided to convert the Query/400 queries to Query Manager (QM) queries, which can be used to prompt the user for parameters. Parameterized QM queries will function in a WebFacing environment because they use the Message Inquiry (Display Program Messages) screen to retrieve parameter data. As evidenced by the sample screen shot below, the amount of data that can be entered on a message reply line is quite large, although often only one character is needed. (See Figure 1 below.)
Figure 1: Green screen system inquiry reply line (click on the image to see a larger view).
However, when I ran a parameterized QM query in the WebFacing environment, I was surprised to find out that the size of the reply line available to WebFacing is only four characters! All parameters would have to be pretty small to fit with that limitation! Fortunately, with a little digging I found a way to modify this system screen’s behavior so that it will accept more characters–so that it functions like its normal 5250 counterpart. Here’s how to modify that screen.
In the WDSc–I’m using version 5.1.2.4–open the WebFacing perspective. Expand your WebFacing project and then expand the tree along the following path (your path may vary a little depending on version): WebContent, WebFacing, systemscreens, V5R3, QDDSPEXT, HTML, INQFMT.jsp. This JSP is charged with the task of rendering the system inquiry screen in a browser. Right click on INQFMT.jsp and choose open to start the editor.
Make sure you’re viewing the JSP’s source and then change the size and maxlength attributes of the HTML REPLYIN text box from 4 to 70 to allow additional characters. To increase the actual visible size of the dynamically generated text box, change the width property of the style attribute from 4em to something larger. I arbitrarily chose 34em.
Here is the original HTML to be modified:
<TD NOWRAP colspan="62"
rowspan="2"><input style="overflow-y:auto;
width:4em;"
<% if (isProtected) { %> readonly tabindex="-1" <% }
%> id="l<%=zOrder%>_INQFMT$REPLYIN"
previousValue="<%=INQFMT.getFieldValueWithTransform("REPLYIN",
QUOTED_TRANSFORM)%>"
class="<%=isProtected?"wf_pr":""%> wf_default wf_field"
size="4" maxLength="4"
value="<%=INQFMT.getFieldValueWithTransform("REPLYIN",
QUOTED_TRANSFORM)%>"></TD>
Here is the HTML after the three modifications have been made:
<TD NOWRAP colspan="62"
rowspan="2"><input style="overflow-y:auto; width:34em;"
<% if (isProtected) { %> readonly tabindex="-1" <% }
%> id="l<%=zOrder%>_INQFMT$REPLYIN"
previousValue="<%=INQFMT.getFieldValueWithTransform("REPLYIN",
QUOTED_TRANSFORM)%>"
class="<%=isProtected?"wf_pr":""%> wf_default wf_field"
size="70" maxLength="70"
value="<%=INQFMT.getFieldValueWithTransform("REPLYIN",
QUOTED_TRANSFORM)%>"></TD>
Save the JSP and run your Web-faced application. You should now have a much larger box to work with as shown below. Don’t forget, if you refresh the style of your project this change will be lost, so keep a handy backup copy of the JSP once it’s done. (See Figure 2 below.)
Figure 2: WebFacing system inquiry reply line (click on the image to see a larger view).
While there are some limitations to WebFacing, at least some of the restrictions can be overcome with a little patience and digging.
Michael Sansoterra is a programmer/analyst for i3 Business Solutions, an IT services firm based in Grand Rapids, Michigan. Click here to contact Michael Sansoterra by e-mail.