How to set a Variable in record producer from a custom widget?

Emmanuel Jay Mu
Tera Contributor

Hi Team,

Can you share how I can achieve moving below custom widget to a record producer variable.

Let's say my variable on the record producer is the Description, I want  to set the description to below format:

Checkbox#: true ; Comment#: User inputted text

example expected result on Description field:

Option1: true ; Comment 1: Text comment 1
Option3: true ; Comment 3: Text comment 3
Option4: true ; Comment 4: Text comment 4

 

HTML Template:

    <table>
      <tr ng-repeat="choice in data.choices track by $index" class="row">
        <td class="col-md-1">
          <input class="form-check-input" type="checkbox" ng-model="checkboxIsChecked" id="checkbox_{{$index}}">
        </td>
        <td class="col-md-5">
          <label class="form-check-label" for="checkbox_{{$index}}">
            {{choice.option}}
          </label>
        </td>
        <td class="col-md-6">
          <input type="text" id="comment_{{$index}}" class="form-control form-text-input" />
        </td>
      </tr>
    </table>

 

Server Script:

(function() {
	data.choices = [
		{"option":"Checkbox label 1"},
		{"option":"Checkbox label 2"},
		{"option":"Checkbox label 3"},
		{"option":"Checkbox label 4"},
		{"option":"Checkbox label 5"},
		{"option":"Checkbox label 6"},
		{"option":"Checkbox label 7"},
		{"option":"Checkbox label 8"},
	];

})();

 

2 REPLIES 2

Mahendra RC
Mega Sage

Hello @Emmanuel Jay Mumar 

Could you please share the details of your custom widget like where it is placed on the portal? is it on the same page were record producer is there? Could you please share some screenshot?

Thanks

Hi Mahendra, the widget is place on a Variable (Custom) on a record producer, see below how it looks.

find_real_file.png

currently I am looking a way maybe to check values using ng-click for the checkboxes and ng-keyup on the textboxes.