using $eb.setFieldValue with a fullsubmit

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

User avatar
dvanhussel
Ebase User
Posts: 161
Joined: Fri Oct 19, 2007 12:45 pm
Location: Haarlem, the Netherlands

using $eb.setFieldValue with a fullsubmit

#1

Postby dvanhussel » Thu Sep 24, 2015 6:31 am

Hi,

With functions like $eb.executeFunction it is possible to set 'fullsubmit' to true.
It seems this is not possible with setFieldValue

We have a script that uses setFieldValue on one field. When it does, the selected/filled in values of other fields on the page ar reset. When these fields are set to 'immediate validation', this doesn't happen. This seems logical, because the fields that were changed on the page where not submited to the server when setFieldValue is called.

We do it this way to have a 'progress indicator' that changes value based on the value of a (hidden by js) field. This field is updated by a server side function. The client js checks this value every x seconds to update the progress indicator.

To fix this, we now change the value of the field with a callable function, with fullsubmit=true. This works as we want without setting all fields on the page to 'immediate validation'.

This raises 2 questions:
Is it possible for you to provide a way to do a full submit with 'setFieldValue'?

Is there a way to check, in server side js, what the 'Client accessibility' of a field is? I could not find a way to do this, so we he need to use a 'whitelist' of fields that may be set from client side js.

If it is not clear enough what we are trying to do, I can provide an example form and scripts.

Regards,

David
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Thu Sep 24, 2015 8:00 am

David,

The setFieldValue() was intended only to be used just to transmit a single field value to the server, and not much else. We always thought that executeFunction should be used (as you have done) for anything more complicated. Probably we shouldn't have added the autorefresh option to setFieldValue because this leads to the problem that you've experienced.

In answer to your questions:

Q: Is it possible for you to provide a way to do a full submit with 'setFieldValue'?
A: We probably won't do this as there is an alternative - executeFunction - that works

Q: Is there a way to check, in server side js, what the 'Client accessibility' of a field is?
A: Officially the answer is "no" - this information is not in the API. However, you should find that the following works OK:

Code: Select all

fields.MYFIELD.getFormField().isClientAccessible();
Regards
Jon
0 x


Who is online

Users browsing this forum: No registered users and 7 guests