I have some problems about the form builder and workflow parameter:

1. From the tutorial in BeanShell Plugin, can you explain clearer about how to set value to a workflow variable? I can't really understand the example.

2. For the form variable, can it be used to stored and display a single value at the form? Or it can only be used to display list for dropdown list, checkboxes and radio buttons?

3. I wish to have a simple checking on the form that, if I checked on a checkbox, the date picker will disappear or disable. But the checking for the checkbox just can't work. Below is the javascript:

<script type="text/javascript" src="http://localhost:8080/wflow-wfweb/js/jquery/jquery-1.2.6.pack.js"></script>
<script type="text/javascript" src="http://localhost:8080/wflow-wfweb/js/json/util.js"></script>
<script>
  $(document).ready(function(){
    var oneway = document.getElementsByName('one_way')[0];
    var returndate = document.getElementsByName('return_date')[0];
    $(oneway).change(function() {
      if(oneway.checked==true)
        returndate.style.visibility ="hidden";
    });
  })
</script>

   I have checked that the change() function is working, so the problem should be on the if statement. Do you know what is the cause?

4. As I try to hide or disable the date picker, only the text box will be hidden or disabled, but the label and the date picker link is still there. Is it anyway to hidden or disable the whole date picker?

5. Is it any place that I can check for the debug or error log that I print out in Beanshell plugin for easier debuging process?

  • No labels

3 Comments

  1. 1. If you have already declared a workflow variable in Workflow Designer, you would just need to modify the 3rd statement (with reference to the example script), changing the variableId to reflect the targeted workflow variable name, and a value that you are setting.

    2. No. Form Variable is designed for form elements with multiple options - select box, check boxes, radio buttons. If you are looking at the possibility of populating other types of form element with data queried from database, you could take a look at this thread.

    3. You could try to replace $(document).ready() with function formbuilderOnReady(). Also, take a look at this page - "Sample Custom JavaScript in Form Builder", for your reference.

    4. How to you hide / disable the date picker?

    5. Error or debugging messages are printed on the Joget Workflow console

    1. Hi,

      All this function like function formbuilderOnReady() is it custom made?

      Where can I refer all these functions?

      Thanks

      1. formbuilderOnReady() will be called after everything (layout, form elements, form data etc.) is loaded in the formbuilder.

        $(document).ready() won't work in this case because at the point of execution, your form elements (one_way, return date etc.) is not in the document object yet.