Expand my Community achievements bar.

Conditional layout

Avatar

Level 2

Hello.

I'm a new user and I'm wondering if it's possible to have some "conditional" Layout.

 

I have a form, divided into several section (subforms)

Each "line" may contain 2 or 3 fields (depend on the information requested)

This layout allow to make the form shorter but all is a bit squeezed. It's ok for most of the people, but a bit inaccessible for some.

I'd like to have an "option" (Checkbox for exemple) that change the layout to a 1 field by "line"

 

My idea was to give instruction to each field "If checkbox is checked, have a width of XXX (full width) and a reserve of XXX", (Forcing the next field to go under it)

 

If checkbox is unchecked, "have a width of XXX and a reserve of XXX" (Allowing the next field to place itself on the right)

 

I know it's something possible in a webpage but I have no idea if it is on AEM designer and how to do it.

 

If you have any idea, it will be helpfull

 

Thank you.

3 Replies

Avatar

Employee Advisor

Why would you like to give end user the privileges to change layout on the fly? I assume you are creating PDF?

 

A possible solution can be to have 2 subform, one with 1 field in single line and other with 3 fields in single line. Show these sub-form based on the checkbox selection. 

Avatar

Level 2

The idea is to give the opportunity to the end user to chose the layout he feels more confortable with.

It's a bit unusual I guess.

 

Your solutions is definitely an easy one. However, duplicate each field means double the work (and error) when we need to update it.

Avatar

Employee Advisor
Yes, the design challenge will be there as you to duplicate same field and scripts for a duplicate sub-form. Other than that I do not see any challenge.