This is a sample method showing how to manually generate a screenable record (J2HODScreenableRecord).
// Example of building a J2HODScreenableRecord with 4 fields: // ID label, ID field, Password label, and Password field public J2HODScreenableRecord buildLogonScreenW4Fields () { J2HODScreenableRecord j2hodScreen = new J2HODScreenableRecord(); // 24, 80 = screen size, 4 = number of fields J2HODScreenInfo screenInfo = new J2HODScreenInfo(24,80,4,false,0x07,0x00,956); // using default field attributes J2HODFieldData fieldData; J2HODFieldAttrInfo fieldAttrInfo = new J2HODFieldAttrInfo(); J2HODTextAttrInfo textAttrInfo = new J2HODTextAttrInfo(); System.out.println ("logonScreen w/ 4 fields generation - begin"); try { j2hodScreen.setScreenId("Logon Screen with 4 fields"); //begin building J2HODScreenableRecord j2hodScreen.beginBuild(screenInfo, true); //if updating a portion of screenable record, false should be used. // (screen width, field label, field text, start row position, start column position) fieldData = new J2HODFieldData(80, "ID_Label", "USERID ===>", 20, 2, 13); fieldAttrInfo.setProtected(true); j2hodScreen.buildField(fieldData, fieldAttrInfo, textAttrInfo); fieldData = new J2HODFieldData(80, "ID_Field", " ", 20, 16, 8); fieldAttrInfo.setProtected(false); j2hodScreen.buildField(fieldData, fieldAttrInfo, textAttrInfo); fieldData = new J2HODFieldData(80, "PW_Label", "PASSWORD ===>", 21, 2, 13); fieldAttrInfo.setProtected(true); j2hodScreen.buildField(fieldData, fieldAttrInfo, textAttrInfo); fieldData = new J2HODFieldData(80, "PW_Field", " ", 21, 16, 8); fieldAttrInfo.setProtected(false); j2hodScreen.buildField(fieldData, fieldAttrInfo, textAttrInfo); //finished building J2HODScreenableRecord j2hodScreen.endBuild(); } catch (com.ibm.connector2.screen.ScreenException se) { System.out.println ("Exception: "+se.toString()); se.printStackTrace(); } System.out.println ("logonScreen w/ 4 fields generation - done"); return j2hodScreen; }
[ Top of Page | Previous Page | Next Page | Table of Contents ]