Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Presence of child objects different to that of parent subform creating a validation error(ES2)?

$
0
0

Hi All,

I've been able to change the mandatory state of an object based on its visibility like:

 

//javascript

//currentObject is passed as a var to this code in a function

if (currentObject.presence == "visible")// if the object is visible then make it mandatory

     {

     currentObject.validate.nullTest = "error"; //make mandarory

     }

     else //else if it's not visible it must not be mandatory

     {

     currentObject.mandatory = "disabled"; //make it non-mandatory

     }

 

 

This is okay if this is applied directly to the object as it's reading just the specific objects presence.

 

The problem I'm experiencing is if there are multiple fields in a subform and using an action I'm hiding the subform based on a condition (also working fine),

but when I go to validate the form on submit or with execValidate(), the presence state of the of the subform (hidden) is not cascading to the child fields in the subform.

 

That is, the subform and all fields contained herein are hidden on screen (works fine), but when I go to submit the form it is failing validation because these fields inside the subform are somehow still maintaing a presence of visible.

I've tested this with a dialogue to show me the value of the presence of the fields contained in the hidden subform and they are still showing "visible".

 

I'm guessing logic wise I would have to read the parent object from the current object to check if the parent is visible or not.  The issue will arise with a subform, in a subform containing the fields.  This indicates I'd have to read the parents visibility up the branch recurrsively but I don't know how.

 

Any suggestions or solutions would be greatly appreciated.

Thank you.

 

Best Regards

Chris 


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>