Expand my Community achievements bar.

Positioning subform choice sets disregarding of data occurrence order.

Avatar

Level 3

Hi, I'm facing an issue,

let say I have the following subform structure (simplified):

- subform set

   - form A (Checking)

   - form B (Saving)

   - form C (Credit Card)

Now, the subform set is a choice subform set, in the alternatives expression panel I have something like this:

form A: productCategory == "Checking";

form B: productCategory == "Saving";

form C: productCategory == "Credit Card";

And this is my (simplified) xml data:

<root>

    <account>

        <prodcutCategory>"Saving"<prodcutCategory>

        <productName>"Saving Account 2.0"<productName>

        <statuts>"Active"<statuts>

    </account>

    <account>

        <prodcutCategory>"Credit Card"<prodcutCategory>

        <productName>"Mastercard"<productName>

        <statuts>"Inactive"<statuts>

    </account>

    <account>

        <prodcutCategory>"Checking"<prodcutCategory>

        <productName>"Checking Account Plus"<productName>

        <statuts>"Active"<statuts>

    </account>

</root>

As you can see, the order in wich the data elements appear is not the same as the order I have my hierarchy formed. This results in having my hierarchy following the data order, and not the order I set in the first place, which I think it's a normal behavior.

However, I need to follow my hierarchy, disregarding the data ocurrence order.

I've tried to find some sort of index attribute in the subforms (there is actually an "index" attribute, but I couldn't work with it), but I had no luck.

If anyone knows how to achieve this, I'd appreciate it!.

Thanks.

4 Replies

Avatar

Level 10

Hi,

I think I might have been the one that headed you off down the subformset path but I don't think you can rearrange the order of subformsets in this way.

However, you can do what you wish with normal subforms.  Your "form A (Checking)" subform should be bound to;

$.account.[productCategory == """Checking"""]

"form B (Savings)" to;

$.account.[productCategory == """Saving"""]

"form C (Credit Card)" to;

$.account.[productCategory == """Credit Card"""]

Here is a sample form/data I used to check the escaping of the double quotes, https://workspaces.acrobat.com/?d=zxyQBrlMWSLFxd9WqKA4Jw

I hope it helps

Bruce

Avatar

Level 3

Hi Bruce, thanks for answering, I will chek your example and report back!.

Avatar

Level 3

Hi Bruce, it worked nicely!, however, I found a new problem:

I'm not actually using productCategory to match those types of checking accounts, but their actual names, so, the espression would be more like this:

$.account.[accountDetails.productDescription == """Basic Checking Account"""];

^ This works also just fine.

The problem is, I have several of those subforms inside a main or general subform of checking accounts.

So, when the client does not have any checking account, I still see the main container there, which shouldn't happen, and if I try to do something like this:

$.account.[productCategory == """Checking"""];

Then I cant see the subforms (actual products) anymore.

It is like when I read the xml data, there is only one pass, and that's all, I cannot bind the same node to children inside the container which is also binded to the same parent node.

Long story short, the parent form of these product subforms, needs to completely dissapear when their children are not found in the data. Maybe using some code?, setting the visibility to false when other componentes are also not there?.

Thanks!.