Task : field validation


I would like to know if the following behaviour is “as expected” or if there is a problem / particular set up to make to achieve it.

In a task form, when I set up a field to be required I encounter the following problem :

  • When I push the “accept” button of a task, the validation is triggered > This means I get a validation error and the task is not accepted.
  • To accept the task I need to fill the field, accept the task (the field is reset when I accept the task) and then I can finally work.

Shouldn’t the validation be triggered only when the “Complete” button of a task is pushed ? (maybe on the “Submit” one too).

Is there any way to select the button with which we want to perform the validation ?

I understand that I can use a custom validator or a java function to achieve the validation but I then think that the “validation set up” supplied would be meaningless.

PS : I use webMethods 8.0.1.


I think you can set the “Immediate” property on the button to ‘true’. That will bypass any client side validation.


Thx for your reply.

I just tried to change the value of “Immediate” and “Use Client-side Validation” properties.

The behavior is still the same regardless of the values I set for both properties (false / true, false / false, true / true, true / false).

The only change is when the “Use Client-side Validation” propertie is set to “false”, then the label of the error message isn’t the same but the result is.


Attached is the sample portlet application i was using. Could you have a look at how it is configured please and see if it behaves the way you expected?

I’ll also build out a sample task application and see if the results are different.
ImmediateTest.zip (8.86 KB)

I’ve attached a sample task application as well, and the same technique seems to apply.

Let me know if you find something different.
ImmediateTaskApp.zip (29.6 KB)

Hello mimel,

First, thank you for the time you spend helping me.

It seems that I cannot import your project into my workspace.
It keeps telling me the following message :

The project was not built since its build path is incomplete. Cannot find the class file for javax.servlet.http.HttpSessionBindingListener. Fix the build path then try building this project	ImmediateTest


This project needs to migrate WTP metadata	ImmediateTest		P/ImmediateTest

Do you have any specific jar added to the java build path for your project ?

Even if I’m not able to deploy it because I can’t build the project I can check some of the configuration.
For the portlet application I think all is good. In fact, I’m not having any problem regarding “portlet application”.
I’m having problem regarding “Task portlet application”.
My point is : In a task, when I push the button “Accept” in order to gain the ownership of the task for processing it > The validation is triggered and in my opinion it shouldn’t be.

I’m sorry, I could not test your task application either since I cannot build it for the same problem. So I could not check if it had the behaviour I expect (which might be different from the developped behaviour by software AG).

PS : Except for the regexp validators, I have done the same set up.
PS2 : I found the “portlet.jar” file and add it to the build path but no luck.


I tried an other approach.

I have import only your task in one of my existing project.
(source / set up of portlet.xml and wm-portlet.xml).

It seems fine so far. I’ll try to deploy it and let you know.

Edit: I deployed it but couldn’t access the task (make an exception in task list management and all page that show the task).
I had to delete manually in the database all information regarding the task ^^

I could not test.


as a workaround to this issue, I would put a Disableable Panel to contain all fields (except the task buttons, of course), and set its disabled property to

#{not YourTaskViewDefaultviewView.YourTaskData.currentUserAccepted}

At least like this you can avoid the “Accept” button issue.
Other options could be to validate the field with a custom validator that is only triggered when you click on submit or complete. Let me know if you need more info on this.

hope this helps,

Sorry for the late notice but I was not at work the last two days.
Thanks for the tips.
Is a disabled panel visible (never tried that component) ? (> I need to show the field).

I opted for the custom validator in the mean time.


Set the Client Side validation to true and declare a boolean variable and bind it to the required property of the control.
In the beforeRenderResponse method of the view you can set this to false if the task is not accepted else true.


I will try later but it should do the trick.

Edit : It does the trick for the accept button but once the task is accepted, the same problem is faced. You can’t close the task (return button) or release it like before because the field is required (the task is accepted > boolean is at ‘true’).

I think I’ll go with the custom validator after all.

Edit 2010-10-28 :
I have tested the disabled panel and it works fine again for the “Accepted” button. For release / return button a small modification is needed to disabled the panel again.