Thursday, 15 September 2011

Alfresco share worflow form validation -


I am trying to validate my alphasource share workflow form for several days of success. This is what I have to do.

  1. % - ShareConfitch-custom located in TOMCAT_HOME% tomcat \ shared \ classes \ alfresco \ web-extension. IP configured to my workflow in XML>

  2. Set up my transplant handle like this.

      & lt; Barrier-operator & gt; & Lt; Handicap type = "mandatory" verification-handler = "Alfresco.forms.validation.examplestaffnumber" event = "keyup" /> & Lt; / Barrier-operators & gt; & Lt; / Region & gt;  

    I have set this field essentially & lt; Label-id = "employee number" id = "leave: employee number" mandatory = "true">

  3. I created a restriction holder javascript and put it at% ALFRESCO_HOME% The badge \ webapps \ share \ js folder is both js and min.js

  4. Finili to JS%. ALFRESCO_HOME% tomcat \ webapps \ share \ WEB-INF \ classes have been added to form.get.head.ftl. \ Alfresco \ site-webscripts \ org \ alfresco \ components \ form like this folder & lt; @ Script = "text / javascript" src = "$ {page.url.context} /res/js/examplevalidation.js">

When I use my Verlflow form Choose and the main value is nothing in the employee number form. I have checked in firebug but there is no call to js. I assume that you have not added dependencies to your java script.

"post-text" itemprop = "text">

To do this, put the code below into your shared -config-custom.exml% ALFRESCO_HOME% tomcat \ share \ classes \ alfresco \ Web-extension

  & lt; Config & gt; & Lt; Forms & gt; & Lt; Dependency & gt; & Lt; Js src = "/ js / examplevalidation.js" /> & Lt; / Dependencies & gt; & Lt; / Forms & gt; & Lt; / Config & gt;  

and your handlers should be handlers

  & lt; Field id = "leave: staffnumber" label-id = "staff number" mandatory = "true" & gt; & Lt; Control template = "/ org / alfresco / components / form / controls / textfield.ftl" /> & Lt; Handicap operators & gt; & Lt; Handicap type = "mandatory" verification-handler = "Alfresco.forms.validation.examplestaffnumber" incident = "dim" /> & Lt; / Barrier-operators & gt; & Lt; / Region & gt;  

And in your JS the function should be:

  Alfresco.forms.validation.examplestaffnumber = function examplestaffnumber (area, arguments, event, form , Silent, message) {// your code with return code}  

Hope this helps !!!


No comments:

Post a Comment