Updating local variables on keypress

A Score Level 2

What I want is for the input field to take in the value, and as soon as it does I want to capture it, and then clear the input. I have the following code for a barcode reader. As you can see, I'm setting the value of my local back to null at the end of all saves. I've checked the value in it and it seems it is setting the value to null. However, the value on the input field itself does not disappear unless I remove focus from it. So if I enter something new into it will append it to instead of replacing it. Is this behavior expected? if so, is there a way to accomplish what I'm trying to do?

a!barcodeField(
label: "Scan Badge",
placeholder: "Badge Number",
value: local!badgeNumber,
saveInto: {
local!badgeNumber,
a!save(ri!briefings, 
append(ri!briefings,
'type!{urn:com:appian:types:HRA}HRA_Briefings'()
)
),
a!save(local!badges, append(local!badges, local!badgeNumber)),
a!save(local!badgeNumber, null)
},
refreshAfter: "KEYPRESS",
showWhen: local!entryMode = cons!HRA_TXT_ENTRY_MODE_SCAN,

)

Parents
  • Hi,

    This is the expected behavior of text field which cannot be changed as the value entered in it will stay there until you remove focus from it. The last thing which I tried doing to achieve your expectation was setting the value to null but this also did not helped still it did reduce the lines of code by removing the need of setting the value of the local back to null at the end of all saves. Maybe a custom picker would help you to achieve what you are trying to do.

    Regards, 

    Harshit

Reply
  • Hi,

    This is the expected behavior of text field which cannot be changed as the value entered in it will stay there until you remove focus from it. The last thing which I tried doing to achieve your expectation was setting the value to null but this also did not helped still it did reduce the lines of code by removing the need of setting the value of the local back to null at the end of all saves. Maybe a custom picker would help you to achieve what you are trying to do.

    Regards, 

    Harshit

Children

 Discussion posts and replies are publicly visible