Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Problem masterpage hide text based on data (LC Output)


Level 4


(This is a combined LC Designer and LC Output problem - but post it in Designer because most clever head in this forum.. most heads that is

I have great trouble creating a form with a variable header on my MasterPage. I use LC Designer and LC Output

I create a flowing header block subform that contains 3 subforms on my Masterpage =
subform 1: contains date > allways visible

subform 2: contains label and text stating salesperson > visible if data, hidden otherwise

subform 3: contains label and text stating contractnumber > visible if data, hidden otherwise

All 3 subforms are in a flowable container subform, so subforms flow nicely up if salesperson subform has no data and is hidden

First I tried with 'repeat subform for each data element' - but only works on first page the masterpage is used and NOT 9 other pages if 10 pages total - no go!

Second I tried with script code that hide the subform if no data. Works fine when testing the rendering in Acrobat but NOT when merged with LC Output.There will just be an empty space if salesperson subform is hidden - as the layout is fixed and will not flow nicely. Tried all possible events but nothing works with LC Output.

There must be someone how had a similar challenge and nailed it - so please share your insights. Thanks in advance

Please ask if questions if something is not clear


Thomas Groenbaek

1 Reply


Level 10

Hi Thomas,

I can't say in relation to LC Output, but in relation to Master Page objects, there are a few things to bear in mind.

While you may only have one Master Page with the subforms, when the form is rendered there are 10 instances of that Master Page. So it depends on how you are referencing the presence of the subforms and in what event. For example if you have the script in the textfield pointing out to the subform it may not work. Try having the script in the subform looking into the .rawValue of the textfield. That way it will work for all of the subforms in their own instance of the Master Page. You may have to use the layout:ready event, which is my least favourite.

See how you get on,