Additional Core Functions in Javra IDE
Get Current screen ID:
This function will give current screen id. The obtained id can further be used to pass any value or to identify particular screen when multiple screens are opened in dashboard.
ReturnType: Integer
AppliesTo: Program
Syntax: f-get-currentxpsen ().
Add Action:
Used to add action such as running program (runxeprog), setting focus (set-focus) etc.
ReturnType: Logical
AppliesTo: Program
Syntax:
v-ok = f-addaction(input sessionID,input action,input parameter).
Input Parameters:
Parameters | Data Type | Description |
---|---|---|
sessionID | Integer | ID of Program session |
Action | Character | Name of action to run |
parameter | Character | Parameter if needed |
Used as:
v-ok = f-addaction(0, ‘NEWWIDGET’, v-xwidinfo[v-cnt]).
v-ok = f-addaction(v-frame-id, ‘s-refresh’, “”).
v-ok = dynamic-function(‘f-addaction’ in v-xe-sourceprocedure, input integer(f-get-xsest(‘dboard_xpsen’)),input ‘runxeprog’, input ‘o/oordm.p’)
Create Next Event:
If another event created in the xevent is needed to be run internally this function can be used.
Syntax: v-ok = f-createnextevent(input eventRowID, input frameID, input parameter).
Input Parameters:
Parameters | Data Type | Description |
---|---|---|
eventRowID | character | Rowid of the event |
frameID | Integer | Container/frame id where event is present |
parameter | Logical | true/false |
Used as:
v-ok = f-createnextevent(input vChooseRefreshEvent, input v-frame-id , input false).
Add attributes:
This function can be used to set attribute of widget such as enabling/disabling/show/hide. List of attributes can be found here.
ReturnType: Logical
AppliesTo: Widget
Syntax:
v-ok = f-addattrib-xaml(input sessionID, input File, input Field , input Attribute, input Value).
Input Parameters:
Parameters | Data Type | Description |
---|---|---|
sessionID | Integer | ID of Program session |
File | Character | Name of file |
Field | Character | Name of field |
Attribute | Character | Name of attribute to set |
Value | Character | Value to the attribute |
Example:
v-ok = f-addattrib-xaml(input 0, input “ttdecoprice”, input “v-button” , input “sensitive”, input “true”) .
Add Result:
This function can be used to set value of widget from any event either at the beginning of any program or in any intermediate actions using events.
ReturnType: Logical
AppliesTo: Widget
Syntax:
v-ok = f-addresult(input sessionID,input RowID, input File, input Field ,input Value).
Input Parameters:
Parameters | Data Type | Description |
---|---|---|
sessionID | Integer | ID of Program session |
RowID | Rowid | Rowid of file |
File | Character | Name of file |
Field | Character | Name of field |
Value | Character | Value to the attribute |
Used as:
v-ok = f-addresult(0,?,””,v-labelfield,v-label).
v-ok = f-addresult(input v-xpsen, input v-rowid, input v-xfilc, input v-xwidc, input v-value).
Find Node Value:
To get the value of any widget that is drawn dynamically in a screen this function can be used. This function can be used with responsive screen where same widget can be repeatedly drawn using nested structure.
Syntax:
Run p-findnode (Input targetName, output targetValue).
Input Parameters:
Parameters | Data Type | Description |
---|---|---|
targetName | Character | Target name |
Output Parameters:
Parameters | Data Type | Description |
---|---|---|
targetValue | Character | Target value |
Used as:
Run p-findnode (input “targetwidget”, output v-targetwidget).
Get Container Program ID:
When multiple programs are opened and child program wants to modify parent program’s widget value then it can be done from child program itself. In order to do that, session id of the parent program (container) is needed which can be retrieved using this function.
Syntax:
Run p-get-container-id (input SessionID, output ContainerSessionID).
Input Parameters:
Parameters | Data Type | Description |
---|---|---|
SessionID | Integer | SessionId of program |
Output Parameters:
Parameters | Data Type | Description |
---|---|---|
ContainerSessionID | Integer | sessionID of container |
Used as:
Run p-get-container-id (input v-SessionID, output v-ContainerSessionID).
Get Frame ID:
When working with different frames sometimes action or widget value can be passed using frame id which can be obtained using p-get-frameid.
Syntax:
Run p-get-frameid(input containerID , input programFrameName , output frameID).
Input Parameters:
Parameters | Data Type | Description |
---|---|---|
containerID | Integer | SessionId of Container |
programFrameName | Character | Program Frame Name |
Output Parameters:
Parameters | Data Type | Description |
---|---|---|
frameID | Character | Frame Id |
Used as:
Run p-get-frameid(input v-containerID , input “x/xusem.p”, output v-frameID).
Get Tab Program ID:
This function can be used to get the session id of the previous tab screen from current program.
Syntax:
Run p-get-xpsentab (input sessionID, output tabSessionID).
Input Parameters:
Parameters | Data Type | Description |
---|---|---|
SessionID | Integer | SessionId of program |
Output Parameters:
Parameters | Data Type | Description |
---|---|---|
tabSessionID | Integer | sessionID of previous tab screen |
Used as:
Run p-get-xpsentab (input v-sessionID, output v-tabSessionID).
Get EventData:
This function returns the data that has been sent from the frontend to the event.
ReturnType: Character
AppliesTo: Widget
Syntax:
f-get-eventdata().
Used as:
v-eventdata = f-get-eventdata().
Check event triggered through commit button:
This function can be used to check if any event is getting triggered on commit of a record.
ReturnType: Logical
AppliesTo: Program
Syntax:
f-iscommit().
Used as:
l-isCommit = f-iscommit\(\).
Get the value from the browse row:
This functions returns the value of the particular cell of the browse of the selected row.
ReturnType: Character
AppliesTo: Widget
Syntax:
f-browseColumnScreenValue(input screenID,input browseName,input columnName).
Input Parameters:
Parameters | Data Type | Description |
---|---|---|
screenID | Integer | program session id |
browseName | Character | Name of the browse widget |
columnName | Character | Name of the browse column. It should always be in the format of field_name. In case the browse field is local variable the name of the column should be .field_name |
Used as:
v-variable = f-browseColumnScreenValue(v-xpsen,’v-browse01′,’xuser.xusec’).
Check if the value of the Browse Column has been changed:
This functions returns the logical value if the particular column of the browse of the selected row has been modified or not.
ReturnType: Logical
AppliesTo: Widget
Syntax:
f-browseColumnHasChanged (input screenID,input browseName,input columnName).
Input Parameters:
Parameters | Data Type | Description |
---|---|---|
screenID | Integer | program session id |
browseName | Character | Name of the browse widget |
columnName | Character | Name of the browse column. It should always be in the format of field_name. In case the browse field is local variable the name of the column should be .field_name |
Example:
f-browseColumnHasChanged (v-xpsen,’v-browse01′,’xuser.xusec’).
Get rowid of the selected records from specified screen:
This function returns the rowid of the main buffer of the selectedrecord from the specified screen.
ReturnType: Rowid
AppliesTo: Data
Syntax:
f-getrowid-xpsen (screen id)
Used as:
f-getrowid-xpsen (v-xpsen)