Forums
Hi,
We're trying to create a link from one program to another. So we have the screen below, and on the text in row 6 column 18, we'd like to have a link to another program.
AA110 XX - Company Ltd USER TESTUSR 12/02/13
Stockroom Test One 13:13:46
Warehouse Enquiry - Range of Locations
By Item........ AAABBBCCC112233 Product Description
Lot number.....
We've tried to use both vtSetMetaData() and emlAddMetaField() but haven't been able to do it. Can you advise how we could do this?
Also is it possible for us to view the source of the above procedures? This would help us to understand how they work and what options they accept within the JSON string
Thanks,
Craig
You can put the following code into the USEREMUL program
Hi Craig
You can put the following code into the USEREMUL program:
if vtWinTitle(pVts) = 'My display';
The item number field must be an input field, so the vtGetValueFor function works.
I use an existing IceCap javascript funtion "IceCap.runPco" to fire the click event. The function take following parameter:
In this example "Work with Spooled files" opens in a new Portfolio tab
Class="iceCap-output-field iceC..." to format the link text.
Tips: I found the x & y position (126.9 & 57) by using Firefox/Firebug "Inspect Element with Firebug" function on the existing item number field. You see the position (top & left) in the element style.
Suggestion
Thanks Claus, we will try that.
Is there no icecap function we can use to calculate the x & y position of a field from the RPG? If not then can I request this be added to the roadmap?
Also is there anywhere we can view the source to procedures like vtSetMetaData() and emlAddMetaField()?
Thanks,
Craig
ICEBREAK/QASPHDR(ICECAP & ICECAPEML)
Hi Craig
The calculation of x & y position happens on the client today ! I will make a change to the next release, so you can use 5250 linie -and column number in the emlxxx functions, instead of pixels position.
You can see the prototypes for the vtxxx -and emlxxx functions in source file: ICEBREAK/QASPHDR(ICECAP & ICECAPEML).
Thanks
Thanks Claus that's great
eml... vt..
Hi Craig;
Just to let You know the differens between vtXXX and emlXXX API's:
vtXxxxx. functions:
Are the IceCap Virtual 5250 terminal which is the foundation and is wrapping all the 5250 functionality.
The prototypes a found in ICEBREAK/QASPHDR/ICECAP.
These API 's are NOT rescricted to the IceCap break out program. You even can use these API in both IceBreak and normal RPG programs to automate 5250 application. i.e. if you want to make IceBreak SOAP services ( I can post you some examples if you like)
emlXxxx function:
Are the IceCap Emullator herlper functions. They give you the features to manipulate the look and behaviour of ExtJs panels produced by the IceCap emulator.
Prototypes are fund in ICEBREAK/QASPHDR/ICECAPEML
There API's are bound to the IceCap.aspx emulator and have no much use outside the breakout environment.
Regards
Niels
Thanks Niels
Thanks Niels,
We eventually reached that assumption, but it's great to have some clarity on it from you.
We did find the prototypes for those api's, but we were hoping to dig deaper into the source code to see how they work, and what options we can put in the json for example.
Do you have a timeline for the next release when we can except the line/column options for emlAddMetaField()?
Thanks again,
Craig
IceCap API as a SOAP service
Hi Craig;
Here is a good sample of how to use IceCap as an SOAP service. A new IceCap build is ready within a coupple of weeks.... :)
<%@ language="RPGLE" pgmtype="webservice" %>
<%
/* ---------------------------------------------------------------------------------------- */
/* Copyright [2009] [System & Method Technologies] */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* ---------------------------------------------------------------------------------------- */
/* */
/* Project . . . : IceBreak */
/* Design . . . : Niels Liisberg */
/* Function . . : Websservice using the Icecap Virtual Terminal */
/* */
/* This simmple webserver will return the current system status by using the WRKSYSSTS */
/* IBMi command */
/* */
/* assume you put this into a file icecapw.asmx in the IceBreak server root. */
/* Then open SoapUI and enter the url http://myibmi:port/icecapws.asmx?WSDL */
/* */
/* */
/* By Date Task Description */
/* -------- ---------- ------- ------------------------------------------------------------ */
/* NLI 11.01.2008 0000671 New program - Subproject IceCap */
/* ---------------------------------------------------------------------------------------- */
h nomain
H bnddir('ICECAP')
/include qasphdr,iceCap
//' ----------------------------------------------------------------------------------------
//' getSysSts - Get System Status webservice method
//' ----------------------------------------------------------------------------------------
p*name++++++++++..b...................keywords++++++++++++++++++++++++++comments++++++++++++
p getSysSts B export
d getSysSts pi
d cpuUsed 5 2 output
d sysAspSize 7 2 Output
d sysAspUsed 9 4 Output
d panelFound s n
d decp s 1 inz(',')
d pVts s * inz(*null) static
d vtSessoin ds likeds(vtsDS) based(pVts)
d vtField ds likeds(vtFieldDS)
//' ----------------------------------------------------------------------------------------
/free
//' Open IceCap Virtual Terminal Session if not open yet.
if (pVts = *null);
pVts = vtOpen();
endif;
//' Locate the "Work with System Status" panel
PanelFound = *OFF;
dou (PanelFound);
select;
//' logon if the signon is displayed
when vtSaaTitleContains(pVts:'Sign On');
vtSetFieldNo(pVts: 1 : 'DEMO'); // First field is the userprofile
vtSetFieldNo(pVts: 2 : 'DEMO'); // Second field is the password
vtSetFieldNo(pVts: 3 : 'QCMD'); // Program to run - QCMD
vtPressKey(pVts: vtENTER);
when vtSaaTitleContains(pVts:'Display Program Messages');
vtPressKey(pVts: vtENTER);
//' run wrksyssts if command entry is displayed
when vtSaaTitleContains(pVts:'Command Entry');
vtSetFieldNo(pVts: 1 : 'wrksyssts');
vtPressKey(pVts: vtENTER);
//' Refresh statistics in the system status is displayed
when vtSaaTitleContains(pVts:'Work with System Status');
vtPressKey(pVts: vtF10);
PanelFound = *ON;
other;
// !! TODO - invalid screen
return;
endsl;
enddo;
cpuUsed = num(vtGetScreen(pVts: 3: 33 : 7 ): decp); // session/line/column/len
sysAspSize = num(vtGetScreen(pVts: 4: 70 : 8 ): decp); // session/line/column/len
sysAspUsed = num(vtGetScreen(pVts: 5: 70 : 10 ): decp); // session/line/column/len
return;
/end-free
p getSysSts e
%>
IceCap Virtual Terminal
Hi Niels,
That's great, and we've written a few of these now to replace our old screen scraping programs.
We do have a question though. If after calling vtPressKey() the next screen takes some time to load, it appears the code does not wait for it.
Is there a setting somewhere we can use to make vtPressKey() block until the screen returns?
Thanks,
Craig
Wait on KeyPress
Hi Craig;
If you take a closer look at Vertual Terminal Session structure (the VTS) you will find at timeout field: This the the number of seconds IceCap waits before returning the a response:
try to change that to a huge number like 1000 ...
Thanks very much Niels,
Thanks very much Niels, that's great