Default Nodes and Cursor Positioning

X-Application Version: 3.1.2
Tamino Version : 3.1.1
Platform : Win2k, Solaris, …
WebContainer : iPlanet 6
JDK Version : 1.3.1.01

I’m using multiplicity in my document and need to show three occurrences on my page and then have the ability to add more as necessary.

First, what do I need to do to make sure my 3 initial occurrences are appended as nodes in the BusinessDocument.

Secondly, how to I make the cursor advance to the correct position to enable more occurrences to be added dynamically.

Regards,
Michelle Salazar

Hello Michelle,

sorry, but I do not understand your use case in detail. Let me give you some tips, hopefully I hit your problem.

I assume you work with JSP tags. Or do you program against X-Application´s Java API?

First check the simple samples (http://localhost:8080/simple). The loop examples could help you to get a feeling for the capabilities of multiplicity handling.

If you specify minoccurs=“3” in the schema X-Application will ensuer that always 3 occurrences are available (e.g. create automatically creates 3).

If you want to display the occurences in pagesize 3 you should use the LoopNavigation Tag.

If nothing helps, please give some more details.

Regards, Harald

Thanks Harald,

Minoccurs=3 would be a solution but we don’t want to store empty occurrences.

For the nodes with multiplicity we’d like to display three initial occurrences, which could be left empty on submit.

We’d also like to have the ability to add more occurrences if the 3 already displayed occurences have been filled in by the user.

Thanks,
Michelle

Hello Michelle,

here some more hints on how to solve your problem:

In order to add empty elements, which could be filled by an edit tag, you can use the tag type=‘insert’ (see Docu Tips and Tricks/Adding and Deleting Elements for further details)

If you like to remove empty elements before commit you could change the method updateDocument() in class SingleBusinessDocument in the way that fields within the to-be-committed document tree are checked if they are empty before commit is actually performed. If this is true they could be removed.

The functionality you requesting here is basically the possibility of adding business logic to the action JSP tags perform. This concept is currently not implemented in X-Application (that’s why I recommended to edit the java code directly), but it has a high priority and will be available in a future version for sure.

I hope the hints helped you a bit

Cheers

Stefan Schwalm
Software AG, Darmstadt