(877) 224-7768 <>
sales@profoundlogic.com <mailto:sales@profoundlogic.com>

iModernize - The Profound Logic Software Blog

Profound Pro Tip: Using Genie Customizations to Configure Subfiles

Posted by Megan Bond on Jun 25, 2019 12:17:22 PM

Profound Pro Tips is a blog series focused on issues that our support team receives and questions our Profound Logic customers have. Have a topic you’d like to see a Profound Pro Tip for? Please contact our team or leave us a comment below. We’re here to help!

Today’s Topic: Using Genie Customizations to Configure Subfiles

Genie does not contain a built in option to automatically adjust your subfiles, but it is possible to use Genie Customizations to manually configure your subfile. Below is an example on how to modify your subfiles to submit a response when clicking on a row.

In this example, we will use the Work with Active Jobs screen, as the base screen of a subfile with options, but any subfile screen with options should work. The first step is to hide the combo box widgets where you would normally insert your choice:

Subfile 1

Using CTRL+Left Click, you can select all of the combo box widgets at once and change their visibility as a group.

The next step is to add custom JavaScript into the Onrowclick event of the grid widget. When subfile detection is turned on for this screen, Genie will automatically convert the subfile on the screen into a Grid widget. This gives you the advantage of being able to modify the entire subfile as one object, instead of needing to modify each field individually. The Onrowclick event of the grid widget, is an event that will activate some JavaScript code when ever the user clicks on a row of the grid. The following code has been placed inside this event grid:

Subfile 2

Note how the grid widget was first selected so that the drag boxes appeared around the widget. This example is using option 5 (Work With) as the option for submitting the row but any value will work.

Below is the code for easier access:


// First lets get the ID of the combo box we want to change the setting for.
// All widgets in Genie have the ID of the following format: [Letter for type of field]_[row number]_[column number]
// So for the screen all of the combo boxes have the same Letter and column number so we just need to calculate the row number
// This can be done with the row variable of the Onrowclick Event, and the 'starting row' property of the grid.
// The first row will be row 1 in the on row variable so we need to take the starting row -1 and add the row variable

var my5250Row = parseInt(getObj('subfile').grid.dataProps['starting row']) - 1 + row;

// construct our ID with our caluclated row
var comboBoxID = 'I_' + my5250Row + '_2';

// set the value of the combo box (in this example I am using 5 for work with but you can use any value here)
pui.set(comboBoxID, '5');

//submit the screen
pressKey('Enter');

After this you will want to set up a Screen Identifier and saved your screen. If you would like more information on how to save a screen you can find that on our documentation page here:

After saving your screen should look like this:

Subfile 3

 

And when you click on an option you will get the following:

Subfile 4

Because this is a manual solution you would need to manually set it up for every screen that contains a subfile with only 1 selectable option. However, it is possible to set up a custom JavaScript routine in one of Genie's global events that would automatically detect this type of screen and apply the customizations featured above. Contract our Professional Services department to create this type of solution, and other custom Genie solutions. 

 



Thanks for reading this issue of Profound Pro Tips! Please comment below with any questions you might have, or if you have any ideas on the next topic, we should cover. You can also ask questions and find solutions on our Profound Logic Forum.

Topics: RPG Development, Application modernization, IBM i applications, Node.js, Profound.js, IBM i, RPG, AS400 modernization, IBM i Modernization, Agile modernization, iSeries, Legacy Modernization, Profound UI, AS 400, AS_400, Profound Logic

Subscribe to Blog Updates

...and get The 2019 State of IBM i Modernization White Paper FREE!

cover page 2019

Recent Posts