Page 1 of 1

Documents within Todo's

Posted: Tue Jun 26, 2012 2:35 pm
by Byron Glueck
Within a HumanActivity form of a Process/Todo, a New Document Button exists.

If the user clicks this button, he is taken to a new Document belonging to different Model. When submitted, that document instantiates a new process/todo.

Does there exist a mechanism/strategy to navigate the user back to the parent form/todo after submitting child document? If not, is it best practice to have child process integrated/called from within the parent process in the model (rather than invoking the child via a new document)?

Additionally, when navigating to the new document form, the parent form's todo becomes inherently locked. Please offer thoughts on how/if this should be handled.

Thanks as always!

Re: Documents within Todo's

Posted: Thu Jun 28, 2012 12:59 pm
by Maros Bajtos
First of all, if you don't want a todo from new process instance to be shown to user, you just need to instantiate the model instance asynchronously.

About the navigation - if you want to have stack like navigation (after submiting or cancelling document or todo, you want to get back to the previous one), you need to do the following steps:

1. Open todo_form.xhtml and document.xhtml and replace string

<script>var sessionId = "#{sessionBean.sessionId}";</script>

with

<script>lsps.sessionId = "#{sessionBean.sessionId}";</script>

in both files.

2. Place attached file lsps.js into webapp/js directory and adjust the template.xhtml so that it loads this file instead of js file "resources/js/lsps.js?v=4"


If you need to unlock todo in certain circumstances, I suggest using TodoService.unlock todo method. Then you can bind unlocking to different event, such as user leaving page, etc.

Re: Documents within Todo's

Posted: Thu Jun 28, 2012 1:00 pm
by Maros Bajtos
Btw in 2.6.1+, the stack like navigation will be the default behavior.

Re: Documents within Todo's

Posted: Mon Jul 02, 2012 2:48 pm
by Byron Glueck
Thank you very much for the patch files.

This work great. However, I have observed the following behavior:

After creating a child record via the submit button and navigating back to the parent form, the collection control that displays the children is not updating to show the newly added record. After closing and reopening the parent todo form, the record is displayed.

Do you have any suggestions on how to force the collection control to reload upon returning from the child creation document? The 'refresh upon todo display' is set.

Thanks again.