3 Replies Latest reply on May 10, 2007 8:56 AM by kukeltje

    Validation of task form fields

    naseem.k

      Hi...

      I have created a process definition where I need to validate task form fields.

      Initially I used default controller for the same task and I also created task variables with read, write and required checked. Now since required is checked so it should give error at the time of task form submission if entries are blank just like struts required validation-rule but still I can submit the form without entering task form fields.

      Why there is no validation is this case when required is set to true? or is this required has some other meaning?

      Secondly if the above approach is not the right way of validation, then can I do the same by writing a custom controller for the same and then validate form fields by java code in the custom controller.

      Please suggest some solution.

      Thanks & Regards

      Naseem

        • 1. Re: Validation of task form fields
          kukeltje

          afaik the current generated form has no 'required=true' on the html elements. By adding that (manually atm) you can achieve the desired result.

          • 2. Re: Validation of task form fields
            naseem.k

            Thanks for your reply.

            But there is no required attribute in that. In variable tag, I specified access="read,write,required".

            Which required attribute you are talking about?

            websale process definition which comes with jbpm have three xhtml file.

            One change which I did is in form.create.xhtml file.. I specified <h:inputText value="#{var['item']}" required="true"/> for item text field and then I redeployed websale par but there is no effect on the browser.

            Thanks once again for all your prompt replies :)

            Rgds

            • 3. Re: Validation of task form fields
              kukeltje

              I mentioned the required attribute on the html element, just like you did. That should result in a jsf validation.... if it does not, something else is wrong but I have no idea what. It works for processes I deployed.