1
0
-1
    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      Hi

      Please try out this app (APP_form_pull_data_from_table.jwa) demonstrating how to pull text template from a list of setup text template (or data from another database table) using a select box and Ajax subform.

      Steps to run the program:

      1. Import the app into your Joget v6 localhost.
      2. Publish and run the app.
      3. Click on "Setup Template" menu, add some records.
      4. Click on "Use Template Text" menu, select the template you want and the description will be populate the form.

      How it works:

      • User selects a list of text template from a select box. The select box use Default Form Options Binder to populate the select box.
      • Joget passes the selected 'id' to the Ajax subform and the subform retrieves the text template description.
      • In the Ajax subform, a small jQuery script then copies the text template description to the parent form 'CopiedDescription' field.
      <script>
      $(document).ready( function(){
          var ajaxValue = FormUtil.getValue('Description');
          var copydesc = FormUtil.getField('CopiedDescription');
      
          if (ajaxValue === '') {
              $(copydesc).val('');
          } else {
              $(copydesc).val(ajaxValue);
          }
      });
      </script>
      

      Hope the above meets your use case.

      References: Javascript API

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi, you can use Bean Shell Programming Guide#UseasFormMultiRowLoadBinder to customize your load binder retrieved data. If you are using spreadsheet element, there is a formula "FORMDATA(formDefId, primaryKey, fieldName)" can help you to load data too.

        1. Azhar Hussain

          Thank you sir for your reply... It will be great if sample application can be shared...requirement is need to populate one specific field value from different table form to another table form

        CommentAdd your comment...