cancel
Showing results for 
Search instead for 
Did you mean: 

Form Customization

hmartim
Champ in-the-making
Champ in-the-making
Hi,

How could I customize a form associated with a User Task?

Supose I want to execute some fields validation before complete the task, or I want to add a button that, when clicked, shows a support information to the user. Is form event model based  on JSF, so I should customize the associated class with event handlers?

Will the Explorer recognize this customization?

Sorry for my english.

regards,
Hudson
9 REPLIES 9

erikwinlof
Confirmed Champ
Confirmed Champ
Hi,

This is currently not supported in the Activiti webapps in a "proper" way but sure sure is something that we need to provide.
You could do the following hack for and put the following html & inline-javascript code in your form:

<div>
   <a href="#" onclick="javascript: var si = document.getElementById('support-info'); si.style.display = (si.style.display == 'none' ? 'inline' : 'none');">Support Information</a>
</div>
<div id="support-info" style="display: none;">
   Here comes the the support information
</div>

You could also include a <script> block in your form template that "might" get triggered, the reason I say "might" is because some browsers will execute the <script> code and some will not. I will add the possibility to use the <script> blocks in all browsers to my things to do.

To hook into the validation mechanism on the client is not possible without performing a serious hack which I wont even try, it is however also something that we should take a look at.

Cheers,

:: Erik

PS. We are NOT using JSF as the web framework which we have built the Activiti webapps on, instead Spring Surf is used: http://www.springsource.org/extensions/se-surf

davidcognite
Star Contributor
Star Contributor
See also this topic for more information on JavaScript limitations and other solutions: http://forums.activiti.org/en/viewtopic.php?t=223

David.

hmartim
Champ in-the-making
Champ in-the-making
Thanks for the client example.

There is also a need on server validation and suplementary server bussiness processing. So is possible in Explorer a pluggable rendering service that could be implemented with JSF, Wicket, …, or it is not the right way?

Hudson.

limcheekin
Champ on-the-rise
Champ on-the-rise
Hi,

Is using JSF is mandatory? You may consider Grails with Activiti plugin project at http://code.google.com/p/grails-activiti-plugin/.

Regards,
Chee Kin
P. S.: I am project owner of the project.

jbarrez
Star Contributor
Star Contributor
Explorer does not have a pluggable rendering service.
However, Explorer (and Probe), use a REST-API that you can use in your own application: http://activiti.org/userguide/index.html#N10B1F

limcheekin
Champ on-the-rise
Champ on-the-rise
Hi,

You may want to find out more for sample application I just release with the Grails Activiti plugin at http://forums.activiti.org/en/viewtopic.php?f=3&t=279

Regards,
Chee Kin

hmartim
Champ in-the-making
Champ in-the-making
Thanks for all info.

I will analyze each suggestion to identify the faster way to adopt Activiti as our BPM suite.

Hudson.

mghb2009
Champ in-the-making
Champ in-the-making
Who can help me?
hmartim?
about render form(defining form properties on a start event or a user task) to jsf page …
http://forums.activiti.org/content/how-set-formfrom-xml-file-properties-jsf-pages

jbarrez
Star Contributor
Star Contributor
Ressurecting a thread from 2010 … wont probably trigger an answer.

The idea is simple: Activiti  has a formService. In JSF, get the form properties through the FormService. Put them on a backing bean or whatever it is called in JSF (been 6 years since JSF for me luckily). Have a dynamic form rendering based on the types in the properties. When clicking the button, pass the values again in the formService.submit