how to recognize input or text?

Use this Forum to post your “How to …” questions about your use of aXes. This is not a technical support forum. Both the aXes Support Team at LANSA and other aXes customers may answer your questions. LANSA cannot guarantee the accuracy of any information posted by customers.

Moderator: jeanmichel

Post Reply
User avatar
Dino
Posts: 88
Joined: 19 May 2017, 08:29

how to recognize input or text?

Post by Dino »

Let's say you have a screen like this:
axes01.png
axes01.png (40.03 KiB) Viewed 5723 times
and you identify the input field as input01, and the text field as txt02.
but sometimes when you get to this screen, txt02 happens to be an input field.

so I want to be able to know from the script in aXes if it is an output text, or an input field.

checking in the developer tools, I can see that this is the code associated with this two fields:

Code: Select all

<div id="ifld602" class="ax-terminal-field x24 ui-widget" title="" style="top: 112px; left: 15px; visibility: visible; width: 26px; height: 21px;">
<input type="text" maxlength="2" size="2" class="ax-terminal-inputField ax_x24i ui-widget-content" style="width: 26px;"></div>

<div id="text607" class="ax-terminal-field x20 ui-widget" title="" style="top: 112px; left: 80px; visibility: visible; width: 117px; height: 21px;">
<span class="ax-terminal-textField ax_x20o" style="">  QPASVRS</span></div>
the input field is inside a div that starts with ifldxxx and the text file is inside a div that start with txtxxx.

Can I read that name from the script in aXes?

I have tried a silly

Code: Select all

alert(FIELDS("txt02").getProperty("id"));
but getProperty do not get me that close. maybe need to indicate some sort of parent. Any ideas?
User avatar
Dino
Posts: 88
Joined: 19 May 2017, 08:29

Re: how to recognize input or text?

Post by Dino »

nevermind, found the solution.... I just ask for the Element in that row and colum... if I find an ifld, then i know is an input field. If I found a text in that row, column, it is an output field.

Code: Select all

var theElement = document.getElementById("ifld607");
if (theElement === null)
{
    var theElement = document.getElementById("text607");
    if (theElement === null)
        alert("nothing here")
    else
        alert("output field");
}
else
    alert("input field");
tim mcentee
Posts: 40
Joined: 26 Jul 2017, 13:20

Re: how to recognize input or text?

Post by tim mcentee »

aXes has a utility for this
FIELD.isInputField
or
FIELDS("myField").isInputField
Post Reply