How to assign the value in a custom widget?

Good afternoon community!

I developed a widget in Bonita 7.5.4 community version but when assigning the value to the BDM variable it seems empty.

That is, in the value property I have formInput.solicitudInput.Site but when I send it to call in another form it appears empty, check the json at the time of creating the case and from there it goes empty.

My question is if they know how to connect or how can I send the value of a custom widget?

Then I leave the widget code.

Template

<!doctype html>
<html>
<body>
    <div ng-class="{
    'form-horizontal': properties.labelPosition === 'left' && !properties.labelHidden,
    'row': properties.labelPosition === 'top' && !properties.labelHidden || properties.labelHidden
    }">
    <div class="form-group">
        <label
            ng-if="!properties.labelHidden"
            ng-class="{ 'control-label--required': properties.required }"
            class="control-label col-xs-{{ !properties.labelHidden && properties.labelPosition === 'left' ? properties.labelWidth : 12 }}">
            {{ properties.label | uiTranslate }}
        </label>
        <div class="col-xs-{{ 12 - (!properties.labelHidden && properties.labelPosition === 'left' ? properties.labelWidth : 0) }}" >
    <select class="form-control" ng-model="selectedTypeName" ng-options="option.type as option.text for option in properties.typeNames">
        <option style="display:none" value="">
        </option>
    </select>
    <select class="form-control" ng-model="selectedName" ng-options="item.id as item.text for item in properties.filterValues|filter:{type:selectedTypeName}">
         <option style="display:none" value="">
        </option>
    </select>
    </div>
    </div>
    </div>
</body>
</html>

Controller

function($scope){
         function selectOptions(name,optionIndex)
{
    var changeEvent = new Event('change', { bubbles: true});
    var inputByName = document.getElementsByClassName(name);
    productInput = inputByName[2];
    productInput.selectedIndex = optionIndex;
    productInput.dispatchEvent(changeEvent);
    

 selectOptions('form-control',1);
}

It is a select that filters data based on the first selection, 

Does anyone know how I can get the selected value from that select? 

Hello,

Could you give us more information?

Normally, in a custom widget, you would have a input. And using AngularJS, you link this value to a properties

Something like

<  input  ng-model="properties.myValue"  >

Using -{{properties.myValue}} you just DISPLAY the value, user can't change it.

Have a look to the standard widget Input. Type this URL in the browser (replace 52085 by the UI Designer port number if needed), then you access the standard input widget.

http://localhost:52085/bonita/#/en/widget/pbInput

Hi! 

I could already solve my problem it was something very simple in the end, I provide more information in the question but I copy and paste mi code and is HTML and JavaScript for that reason nothing is seen and only that part of the code came out.

But thank you very much anyway for taking the time to answer my question!

I created two select widgets, the second select widget show the values based in the option selected in the first select, but when I ran the process the widget value was not saved in my BDM variable but I can solved my problem :D