November Happy Hour will be moved to Thursday December 5th.

DOJO-widget: how trigger publish event?

Vote:
 

Hey guys,

I've created a DOJO-widget. It works fine apart from the fact that it doesn't trigger the Publish event. I can get around it by clicking on different parts of the screen, but it's not an acceptable solution for the editors.

The code basically looks like this:

postCreate: function () {

// create HTML elements: a dropdown, some checkboxes and some textboxes

... }

_getValueAttr: function () {

... }

_setValueAttr: function () {

... }

Is there any way to hook up to some changed-event when creating the HTML elements?

BR
Patrik

#143922
Feb 03, 2016 13:02
Vote:
 

Shameless bump;

the DOJO-widget is used in a block. The only block attribute is the DOJO-widget:

This means, as far as I can tell, that since the editor is never leaving (tabbing out of) the DOJO-widget-property, EPiServer never triggers the Publish Page-event (aka page changed, light up the blue publish page button). The only way to get around this is by clicking somewhere outside the widget, this makes the widget lose focus and the publish button gets enabled (blue).

So, does anyone know how to manually trigger the Publish Page-event?

Thankful for any insights here.

BR
Patrik

#145731
Mar 10, 2016 15:31
Vote:
 

Solved by the following code:

* adding onChange: function () { this._customTrigger(); } when creating the elements

* adding custom trigger: _customTrigger() { this.value = this._getValueAttr(); this.onChange(this.value); }

BR
Patrik

#145754
Mar 11, 2016 8:41
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.