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.
SOLVED

How do I make a subform dynamic so that a textfield which is empty will be considered non-existing.

Avatar

Level 2

Hello,

I have the following subform:

qdzdwdd.PNG

What I want to accomplish is that, when P2 and/or P3 is empty, that the space between "nrEntrepriseClient" (Ondernemingsnummer) and the text block at the bottom will be gone in PDF view. There are conditions bound to P2 and P3, so when these are not met, the field will not appear.

Right now, my PDF view is the following:

qdazeg132.PNG

It's that whitespace between "Ondernemingsnummer" and the text block that I want gone.

The subform is in Flowed and Western text, putting it in Top to Bottom did not work.

Kind regards,

Jens

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Maybe you can help hiding objects:

data.#subform[0].#subform[2].P2::ready:form - (FormCalc, client)

if ($.isNull) then

    $.presence = “hidden”

endif

The same can be done for the P2 field.

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

Maybe you can help hiding objects:

data.#subform[0].#subform[2].P2::ready:form - (FormCalc, client)

if ($.isNull) then

    $.presence = “hidden”

endif

The same can be done for the P2 field.

Avatar

Level 2

I used something similar (by building it in the action builder) but it works !

It's something like this:

((this.resolveNode("$").rawValue == null || this.resolveNode("$").rawValue == "")) {

          this.resolvenode("$").presence = "hidden";

}


Thanks for pointing me in the right direction!

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----