Issues when returning values from the server to the client

Hello. I have some questions about returning values from the server to the client.
I have downloaded the UIServerDataTF.fdf that Jo-Anne provided on the topic “GUI and Events issues” (March 11).

1- Issue with integer and float
The UIFunction is attached to the On Exit field for Field1. This works fine when Field1 is a Text type. But when the field type is an integer or a float, context.DataToServer returns on the server side the value “undefined”. How can I solve this issue? I tried to sort of cast the value to text with no success.

2- JavaScript vs TypeScript
The same code does not seem to work on Typescript. The function ‘sender’ is not recognized. Can you tell me what is the problem?

3- Set a field that has no Data Source
Is there a way to set a Form Field that has no Data Source? I just want to display the value received from the server in a Form Field, but not to save it in the database. The setValueByName method does not seem to work when ‘EmptyField’ has no data Source.
sender.dataManager.setValueByName(‘EmptyField’, serverData.ValueFromServer);

Thanks for your help! Jean

Hi Jean,

  1. I have retested this at my end in the release available from our downloads website and it all works correctly for me. Is there another step or something else you have added in your app that is different. I am happy to look at your FDF and check it for you.

  2. The built in editor in Five needs to be updated, however, your function should still be fine. This is a known issue and will be fixed in our next release.

  3. The example that you are using is working for me, I may need to understand more of where you are calling this and in what event. If you simply want a field that is not connected to the database, on the Form Fields form don’t select a field in the Field field (These are the fields from your selected data source on the General page), shown in the image below.

Once again I am happy to look at your FDF to help what you are trying to achieve.

Hi Jo-Anne. My code is all messy after many attempts to resolve my issues. I will do a cleanup and then will send you my fdf file. Thank you!!

Hi Jean,

You’re more than welcome to email it if you don’t want to attach it to the forum.

1 Like