cancel
Showing results for 
Search instead for 
Did you mean: 

hide form items based on econdition

jmzags
Champ in-the-making
Champ in-the-making
Is it possible to delete  a form item  if a certain condition is met?
I'd like to execute a listener when a task kicks off that would evaluate whether
the said item received input in the previous task. If not, I would like to have it hidden/deleted from the current task
so that the placeholder no longer appears on the form for this input item
6 REPLIES 6

martin_grofcik
Confirmed Champ
Confirmed Champ
I am not sure, but can't you set form property readable flag by expression?

jmzags
Champ in-the-making
Champ in-the-making
The readable property is a pull down selection of True or False
I tried entering an expression, ${ccb_pmo} into the  field.but it will not save.

Could someone help me with the required syntax to use in a java based listener
to be executed when this form is called that would ultimately set this field's isReadtable property  to its desired setting ?

jmzags
Champ in-the-making
Champ in-the-making
any suggestions?

martin_grofcik
Confirmed Champ
Confirmed Champ
Java based listener can be found in the doc:
http://www.activiti.org/userguide/#executionListeners

Usually I use scripts to check something quickly.


<activiti:taskListener event="complete" class="org.activiti.engine.impl.bpmn.listener.ScriptTaskListener" >
  <activiti:field name="script">
    <activiti:string>
      def bar = "BAR";  // local variable
      foo = "FOO"; // pushes variable to execution context
      task.setOwner("kermit"); // test access to task instance
      bar // implicit return value
    </activiti:string>
  </activiti:field>
  <activiti:field name="language" stringValue="groovy" />
  <activiti:field name="resultVariable" stringValue="myVar" />
<activiti:taskListener>

jmzags
Champ in-the-making
Champ in-the-making
Thanks for the reply.
I am already using java task listeners across my project, so I don't have an issue with writing/implementing, however I am particularly interested in knowing if there is a way to code the readable attribute of one of the
form fields to 'false' - as the designer does not allow for an expression which would have been my preferred method.
Any auggestions are appreciated.

iceman20
Champ in-the-making
Champ in-the-making
Hi!

I am curious if this issue has been addressed, and hopefully solved as I am in need of a way to do the same thing.

Thank you!