Custom presenter doesn't trigger callback

Has anyone used a custom presenter that triggers a fragment callback?
We have an input box that stores an address ID, after the address is pulled from OS places and stored in the address object.

When the value is set using frontend.js this does not trigger the fragment callback. If I manually add a number in this input box and lose focus from the box it does trigger.

Does anyone know how to resolve this and force the vue.js to treat adding a value to this box as a change? The field is bound to the model value.

Hi,

So you have a custom CS presenter that on value changed should trigger a fragment callback on some other input?
Can you share some of your code specifically how you have defined your input in the main.htm and the frontend.js code where it is setting the value for the input.

Hi,
Yes, the code which defines the field in main.htm is:

<input id="address_search_addressID" v-model="selectedAddressID" v-bind="input_attributes({value: selectedAddressID})" class="col-form-value form-control vsmall" autocomplete="no">

This is using the selectedAddressID as the model and input_attribute.

In the frontend.js. after the address is stored and the ID known the selectedAddressID is updated with the ID. This is a relation selector presenter.

var SELF = this;
SELF.selectedAddressID = e.response.id

Not sure if it has worked before, but you can dispatch your own change event on the CS presenter which will get picked up and will trigger fragment callbacks.

Here is a working example:

main.js

return {
	get_template_data: function() {
		return {
			someValue : 'ABC'
		}
	},

	get_settings: function() {
		return {
		};
	},
}

main.htm

<input @click="setVal" class="btn btn-primary" type="button" value="Set value to 123" />
<input ref="someInput" v-bind="input_attributes({value: someValue})" />

frontend.js

export default {
	methods: {
		setVal: function () {
			this.someValue = 123;
			var event = new Event('change');
			this.$refs.someInput.dispatchEvent(event);
		}
	}
}

Thats perfect. That worked. Thank you.