1

In AX7, I have a FormStringControl and I want to clear the text-contents while the user has focus on it. I overrode the textChange() method, and in AX2012, this would work, but it does not in AX7:

public void textChange()
{
    this.text("");
    super();
}

What I expect to happen is, while the user keys-in text, it'll clear. This is a proof-of-concept thing I'm trying to accomplish for a bigger task.

EDIT: The actual task is I have a setTimeoutEx() (formerly setTimeout()) that polls a string control every 100ms and attempts to clear it sometimes. It does not work when the focus is on the string control.

Alex Kwitny
  • 11,211
  • 2
  • 49
  • 71
  • What is your task? Hopefully not password entry, as there is a proven way to do that in AX. – Jan B. Kjeldsen Aug 10 '16 at 06:47
  • Why do you want to clear the field? – Jan B. Kjeldsen Aug 10 '16 at 16:22
  • Clear or change the text. It's for high-speed data entry. I might be able to get away without clearing/changing it except on `enter` keypress, but it seemed like something that is possible except I just don't know the correct way to do it. I tried stuff like `element.task(#taskEnter/#taskTab/#taskF5)`. I wasn't sure if there was some new web-refresh or something. – Alex Kwitny Aug 10 '16 at 17:09
  • In the `timeout`, where `entry` is the control I'm keying into and trying to clear. I just tried `randomstringcontrol.setFocus()`, `entry.text("")`, `entry.setFocus()` and that's didn't work. I suspect it's something related to the javascript on the control. This isn't something critical, as I can figure out a work-around, I was just hoping it was something like `datasource.reread()` that as a new AX7 dev, I wouldn't know. – Alex Kwitny Aug 10 '16 at 17:13

1 Answers1

-1

I would assume that textChange is a depricated API, though this is not explicitly stated in that list. The dateTextChange method is for sure.

The reason for deprecation is obvious, it would introduce a server round-trip for each entered key, which does not scale.

I guess you will need to accomplish your task using other methods.

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
  • Why do you assume that `textChange` is depricated? And do you have any information about the other methods you mention? Otherwise this probably should be a comment and not an answer. – FH-Inway Aug 10 '16 at 09:04
  • For the reasons stated in the answer. Also, I recall reading it, though I cannot find it now. Anyhow it would be dead easy to test, whether or not it is the case, but again, it is not my problem. – Jan B. Kjeldsen Aug 10 '16 at 11:18
  • I actually have a `setTimeoutEx()` (formerly `setTimeout()`) that is attempting to clear the string control every 200ms based on entry. It won't clear it if the cursor focus is on the string control. – Alex Kwitny Aug 10 '16 at 15:55
  • Also, `textChange()` does not appear to be depreciated. The issue is around focus on the control. – Alex Kwitny Aug 10 '16 at 15:57