Can we ignore or not display the TypedValue from EditRecord following refresh?

Can we ignore or not display the TypedValue from EditRecord following refresh?

  

Hi,

  please can anyone advise if there is a way to stop the typed value redisplaying in an EditRecord Widget following an AJAX refresh. It is useful following validation but we now have a scenario where it is not helpful.

We have a screen which essentially toggles between View (ShowRecord) and Edit (EditRecord), using  AJAX Refresh 

If we enter data in the EditRecord (which may be invalid i.e. Alpha characters for a numeric field), and then  'Cancel', our Cancel Action basically ignores the input and refreshes/toggles the page back to the 'View (ShowRecord) with the data record reinstated (with no validation)

 If we then toggle back to the EditRecord, the data previously typed is still being displayed (it is still in the TypedValue runtime property), which we don't want to see..

I have noticed that this only happens if the data field bound to the EditRecord is Integer, LongInteger or Currency (i.e. numeric) and the Input Widget Type is set to Text. In addition only happens if there is no data in the field on the source record.  

Thanks in advance.  

Neil

Hi Neil,

Afaik the only way to reset the Edit Record is to rebind its content to the desired content, then AJAX Refresh it.

Kilian Hekhuis wrote:

Hi Neil,

Afaik the only way to reset the Edit Record is to rebind its content to the desired content, then AJAX Refresh it.

Hi Kilian,

  Thanks for the reply. We actually have done that and bound the source record directly to the EditRecord widget, prior to refreshing it, but is still shows the typed value. 

  As mentioned it only seems to happen where the value in the source record (integer) is zero and the data entered on the 'text' input is alpha e.g. 'AAAA'. If the value typed is numeric, say 1111, then it will show as the original zero value (instead of 1111) on AJAX refresh.

  We can work around it with input masks, but we were trying to avoid that.

    


Hi Neil,

I've recreated your problem, and I can confirm it. This seems a Platform bug, or at least a specific feature. Here's what I found:

  • When assigning an entire Record to the Edit Records Widget's "Record" Property, then Ajax Refreshing it, does not reset the invalid input, in case the value is 0. Any other value, and the invalid input is cleared (and the value shown);
  • When explicitly assigning 0 to the Variable that's bound to the Input Widget, the above doesn't hold, and the invalid input is cleared (and "0" is shown).

To check what happens I looked at the C# source code, and from what I can see, this must be a Platform bug with handling the inputs and what has been changed.

So, as a workaround, you can either have a default value that's not 0, or explicitly assign 0 to the Input's underlying Variable.


Kilian Hekhuis wrote:

Hi Neil,

I've recreated your problem, and I can confirm it. This seems a Platform bug, or at least a specific feature. Here's what I found:

  • When assigning an entire Record to the Edit Records Widget's "Record" Property, then Ajax Refreshing it, does not reset the invalid input, in case the value is 0. Any other value, and the invalid input is cleared (and the value shown);
  • When explicitly assigning 0 to the Variable that's bound to the Input Widget, the above doesn't hold, and the invalid input is cleared (and "0" is shown).

To check what happens I looked at the C# source code, and from what I can see, this must be a Platform bug with handling the inputs and what has been changed.

So, as a workaround, you can either have a default value that's not 0, or explicitly assign 0 to the Input's underlying Variable.


Hi Kilian,

  Thanks again for your response, I will have a look at your suggestions and see if we can implement this workaround.