Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

How to create two columns of data?

Avatar

Level 3

I am making a dynamic form and I want my data to appear in two columns. Right now I have a subform container set to flowed and western text. It contains two subforms instructions and tools side by side. Like so:

The problem is when the data is sent, the instructions are first so they are in a column down the left side. Once the instructions are finished, the tools are in a column on the right side. Like this:

instruction

instruction

instruction

instruction

                     tool

                     tool

                     tool

                     tool

How can I get them to be drawn at the same time, in two columns side-by-side?

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Use a table like the one I showed in my example to you. In fact you can simply use that form, import your sample XML into a data connection then simply bind the fields and data together.

paul

View solution in original post

11 Replies

Avatar

Former Community Member

Can you post your form so we can see what you have done?

Paul

Avatar

Level 3

I keep getting an error when I try to upload. Here is the basic structure. Summary page is flowed western text. and each element subform is flowed top to bottom.

Avatar

Level 3

Sorry, I should have been more specific. I am getting the data from XML and it needs to follow the format I showed in the previous image. None of this is user-entered.

<summaryPage>

     <instructionSummary>

          <instruction>

               <instruction_item>

                </instruction_item>

          </instruction>

     </instructionSummary>

</summaryPage>

Avatar

Former Community Member

Ok Now I get it ......If you are limiting the display to one page then I can make it work .....if it is more than one page then your only option is to reorder the data. The subforms will be laid down based on the order in the data. Once I am past a page I cannot go back to an earlier layout.

Paul

Avatar

Level 3

The data is variable, so yes, it can go past one page. Is this not possible with a table as well?

Could I perhaps make 2 one-column tables? Can a table read in the XML. I've tried, but I couldn't get it to work.

Avatar

Former Community Member

The layout of the form will follow the structure and order in the XML data file. You cannot go back in teh XML file or in the layout. If you layout all of the column 1 data and it spans across two pages, well once you are on the 2nd page you cannot go back to the previous page to continue the layout. Your only option is to reorder the data into a structure like this:

<Row>

     <Column1>value</Column1>

     <Column2>value</Column2>

</Row>

<Row>

     <Column1>value</Column1>

     <Column2>value</Column2>

</Row>

Paul

Avatar

Level 3

OK, I have it set up like this now, but the rows are not repeating. It prints out the first row elements and then stops.  Here is my element hierarchy and a sample XML. Any suggestions?

<summaryPage>

<row>
<instruction>
<instruction_item>instruction one</instruction_item>
</instruction>
<tool>
<tool_item>tool one</tool_item>
</tool>
</row>
<row>
<instruction>
<instruction_item>instruction two</instruction_item>
</instruction>
<tool>
<tool_item>tool two</tool_item>
</tool>
</row>

</summaryPage>

Avatar

Correct answer by
Former Community Member

Use a table like the one I showed in my example to you. In fact you can simply use that form, import your sample XML into a data connection then simply bind the fields and data together.

paul

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] ----