Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

How to access the fields of a subform inside another subform ?

Avatar

Level 9

I got a table( Which is actually a subform not a table but I am using it as a table kind of thing) .Where each cell is wrapped in a subform.Each cell has a numeric field .Where the user has to enter the datas.

I want to compare the values of two columns and basing on that i want to show some alert message .

I have tried everything in both the formcalc as well as in the javascript.But iI could not solve the problem.

Can anybody please find a solution for my problem ??

Thanks in Advance.

5 Replies

Avatar

Former Community Member

My guess is that you are not using the correct expression to indicate which field you want. As a tip you can place the cursor in the

Script editor wher you want the field expression to go then hold down the ctrl key then move the mouse to the field you want to reference on the drawing pale tte then click the mouse. The correct expression will appear in the script editor. Note that it is relative to the location of where the script is executing.  Now you can pick the property or method you want to use (most likely rawValue).

Paul

Avatar

Level 9

@

pguerett

Thanx . But i did exactly the same u told much before . I copied the entire hierarchy which is displayed in the script editor much before .

Still then it shows no O/P .

if(TopmostSubform.Page2.Table.resolveNode.("#Cell[12].L1_ResTotalNumMeters").rawValue < TopmostSubform.Page2.Table.resolveNode.("#Cell[11].L1_ResNumAdvMeters").rawValue)
{
   app.alert("Error");
   }

NOTE :

Here TopmostSubform is the parent form.

        The table lies in Page 2.(Which is not a table created by subforms and text field  rather)

        I have to compare the values of Cell [11] and Cell [12] , the fields are L1_ResNumAdvMeters and L1_ResTotalNumMeters respectively.

        Both the Cell[11] and Cell [12] are subforms (or warpped in subform.)

                 I have tried for last 20 days . Still i am scratching my head .

Avatar

Former Community Member

This is always easier if I can see what is happening ....can you post your form and instructions on how to reproduce the problem to LiveCycle8

@gmail.com?

Paul

Avatar

Level 9

I have no problem in posting the form here . But the client i am working

with has some copy right issues . So i am not allowed to display the form

in a public forum . Any other alternatives ??

Thanks .

Avatar

Former Community Member

That email address is not a public forum ....it is my email address so only I will see it.

Paul