javascriptlivecycle

Dynamic tables within tables do not preserve their values over a save / load


Using Livecycle Designer - now Adobe Experience Manager v 6.4.0.xxx, I'm trying to allow my users to create tables within tables in a form. I'm comfortable with non-nested tables - they work fine. The problem is that when I nest tables they lose information over a save. The first row is saved fine, but subsequent rows are not saved.

These are non-trivial tables. An outer row has, say 5 text fields, some radio buttons, subforms that hide/show based on logic, etc. The nested table only shows under certain logic - it also has multiple text fields and check boxes. However, I've simplified this down below - still fails.

Based on Nested tables in livecycle fall apart on email, I decided to toss out tables and nest subforms to gain the same look and feel as tables. Again, one 'table' built this way works fine, but the subsequent nesting breaks - in interesting/crazy ways - the subform nested in row one gets more rows (instanceManager.count) and subsequent rows lose their textfield information - but radio buttons keep their information.

What I've done

Pre-Save Pre Save

Post-Save Totally whacky. Kept second row (unlike tables) but lost the information in fields. First row somehow gained another nested row. Post Save

I call this from a button 'click'

function fAddSfRow(oSfTable) {
  oSfRow = oSfTable.sfRow;
  oSfRow.instanceManager.addInstance(1);
}

And, to remove a row - in another button 'click'

var oSfRow = $.parent;
if (oSfRow.instanceManager.count > oSfRow.instanceManager.occur.min ) {
  oSfRow.instanceManager.removeInstance(oSfRow.index);
}

Example PDF

What I'd like is a nested table with text fields in each that saves/loads.

Thanks!!


Solution

  • Okay, the best answer I've found is...

    Wrap only the table with inner tables with a 'pre-save' and 'initialize'.

    Presave

    Initialize

    Ughh.