Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Malformed SOM Expression!!

Avatar

Level 8

Hello

I have developed a interactive form (its name is 'MY_FORM_VISITOR') and its launched on the intranet's portal, fine.

The form's some fields are prepopulated/defaulted from the back end data base/server/SAP's Oracle data base.

But, when the form is launched on the portal browser, a small (JavaScript Debugger) popup is instantly coming and disappearing with in a fraction second.

If i save this form on my local desktop, and then when i opens it on my local desktop, then am getting the same popup and it stayed until i closes it.

So, i saw the below message in the popup,

Acrobat EScript Built-in Functions Version 9.0
Acrobat Annotations / Collaboration Built-in Functions Version 9.0
Acrobat Annotations / Collaboration Built-in Wizard Functions Version 9.0
Acrobat SOAP 9.0

GeneralError: Operation failed.
XFAObject.resolveNode:26:XFA:MY_FORM_VISITOR[0]:docReady
Malformed SOM expression: MY_FORM_VISITOR..


GeneralError: Operation failed.
XFAObject.resolveNode:26:XFA:MY_FORM_VISITOR[0]:docReady
Malformed SOM expression: MY_FORM_VISITOR..

I am making some fields as mandatory (yellow coloring) and some fields as greyed out (grey color and readOnly) DYNAMICALLY by tracking/tracing/finding the field in question using the below JavaScript,

(From this forum, i came to know that by using two periods - .. we can track/trace/point/find a field in question, so am using the same-2 periods)

xfa.resolveNode("MY_FORM_VISITOR.." + myArrayGrey[i]).ui.oneOfChild.border.fill.color.value = "192,192,192"

xfa.resolveNode("MY_FORM_VISITOR.." + myArrayGrey[i]).access = "readOnly";

Pls. let me know why am getting this message? How can i fix it?

Surprisingly, am using the same logic/JavaScript code syntax/statements in another form (Its name is just VISITOR), there i dont see any issue!!

Thank you

7 Replies

Avatar

Level 10

Hi,

While you can use the two dots .. as a token to search for objects, I am not sure you can use it within a SOM expression. If using a SOM Expression, I think you would have to build a reference that included a wildcard instead (*). See here http://assure.ly/kUP02y for a general example on SOM Expressions. 

Niall

Avatar

Level 8

Thank you Niall.

Pls. could you tell me how to do the below,

If using a SOM Expression, I think you would have to build a reference that included a wildcard instead (*).

I am writing my JavaScript code below again, because in my original thread the green color is making blur in visibility,

xfa.resolveNode("MY_FORM_VISITOR.." + myArrayGrey[i]).ui.oneOfChild.border.fill.color.value = "192,192,192"

xfa.resolveNode("MY_FORM_VISITOR.." + myArrayGrey[i]).access = "readOnly";

I have a scenario that: I have around 200 fields on the form, and these field properties/attributes (mandatory, grey, editable, option) are dynamic, meaning, the back end SAP's data base's interface/data view will decide whether its mandatory or optional....meaning, say, for US the field_1 is mandatory , but the same field is optional for Canada, like, they are dynamic.

Thank you

Avatar

Level 10

Hi,

It is a bit difficult as I cannot see what myArrayGrey[i] is referring to. Is this within a loop where i is increasing? What is myArrayGrey[1] referring to or returning?

Niall

Avatar

Level 8

Thank you. Yup, your guess is correct.

I wrote the below code in docReady event at root level, i mean for form level (MY_FORM_VISITOR level), pls. note there are 2 dots after 'MY_FORM_VISITOR' in my JS

// Identify all the non-editable fields and make them grey

var myArrayGrey = new Array();

var greyFields;

greyFields = xfa.resolveNode("MY_FORM_VISITOR.Page1.TMReference.HiddenSub1CustInfo1.GREfields").rawValue

myArrayGrey = greyFields.split(" ");

for (var i = 0; i < myArrayGrey.length; i++)   

{     

xfa.resolveNode("MY_FORM_VISITOR.." + myArrayGrey[i]).ui.oneOfChild.border.fill.color.value = "192,192,192"

xfa.resolveNode("MY_FORM_VISITOR.." + myArrayGrey[i]).access = "readOnly";

};

Avatar

Level 10

Okay,

So I suspect that the GREfields object contains a list of objects that are to be readOnly. Is that correct?

I would not use the double dot (..) after the root node name, just a single dot. Also test to see what myArrayGrey[i] is returning. Are you getting errors with the JavaScript Console (Control+J in Preview or Acrobat)?

Niall

Avatar

Level 8

Thank you. Pls. let me allow to go and pick my daughter from pre-school,

will get back to you ASAP.

Avatar

Level 8

Hello Niall,

"So I suspect that the GREfields object contains a list of objects that are to be readOnly. Is that correct?"

==> Yup, your guess is correct, the 'GREYfields' is a invisible text field on the form, holds a string data type and its prepopulated with below value, just for for example, say

NAME1 NAME2 STREET CITY ZIPCODE STATE COUNTRY so on....

"I would not use the double dot (..) after the root node name, just a single dot. Also test to see what myArrayGrey[i] is returning. Are you getting errors with the JavaScript Console (Control+J in Preview or Acrobat)? "

==> So, you mean, even i can use a single dot (.) and i can do a TOKEN search for my wanting object/field on the form, okay, i will change my code from 2 dots to a single dot. And also i will do app.alert for myArrayGrey[i] and will check the holding values and let you know

 

Thank you