docx-stamper icon indicating copy to clipboard operation
docx-stamper copied to clipboard

displayParagraphIf() inside repeatDocPart()

Open NNowakowski opened this issue 4 years ago • 1 comments

I'm having some issues getting displayParagraphIf() to work inside of a repeated part of my document. Overall the repetition of elements works, aswell as expressions being replaced with a list elements values. However when trying to add comments to only display paragraphs inside the repeated part based on the elements value, the library seems to try to evalute the comments expression against the root object, not the current lists object.

Am I doing something wrong or is this simply not a feature and if so, is there a workaround for this?

Demonstration Code:

public class ObjectA {
  public List<ObjectB>children;
}

public class ObjectB {
  public String value;
}

While inside the template I'd then use repeatDocPart(children) and displayParagraphIf(value != null) inside the repeating part. I'll then get an error saying it can't find the property "value" on type ObjectA.

NNowakowski avatar Oct 15 '20 14:10 NNowakowski

It’s still a bug and was requested a couple of times. We had the same issue and couldn’t solve it. Comments also disappear in repeating parts as they get deleted after the first time they get resolved.

It’s a great library but still has some bugs.

JohannesWi avatar Nov 23 '20 19:11 JohannesWi