Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding custom properties in Text widget does not apply the entered value #235

Open
sreekumar1267 opened this issue Jun 2, 2020 · 3 comments

Comments

@sreekumar1267
Copy link

Hi, I have a custom property on a Text widget which will open a pop-up of values that can be multiselected. And on closing the popup, i am trying to update the value of text field with the value selected. But the UI is not reflecting that value.

In config I have defined the widget as below:

widgets: {
...InitialConfig.widgets,
text: {
...InitialConfig.widgets.text,
customProps: {
id: 'MYTEXT7999',
onClick : (e) => this.onClickText(e)
}
}
}

onClickText = (e) => {
// this opens the pop-up with values that can be multi selected
let item = lookupFieldsConf.find( ({ field }) => field === 'CCMSECTYPE' );
if (item !== undefined)
item.lookupFunction(this, 'CCMSECTYPE', '=', e.currentTarget.id);
}

//this is called on close of the pop-up and selected values are sent as parameter
handleOkLookupDialog = selectedValues=> {
console.log('handleOkLookupDialog selectedValues:: ', selectedValues);
console.log('handleOkLookupDialog componentID :: ', componentID);

console.log(' -- document.getElementById(componentID) --', document.getElementById(componentID));
 document.getElementById(componentID).value = selectedValues;

};

console log show the component and values correctly, but after assigning the values, Text onChange is never invoked i believe.

Is there a way to identify the uid of the widget when it is clicked ?

@ukrbublik
Copy link
Owner

Is there a way to identify the uid of the widget when it is clicked ?

See this PR
#503
Now id prop (id of rule in result query value) is passed into widget

@ukrbublik
Copy link
Owner

Sorry for late response. If you have other issues or want to resolve this one, please let me know

@ukrbublik
Copy link
Owner

Also now you can programmatically change value of rule by id path
See example:

this._actions.setValue(firstPath, 0, 2, "number");

Probably need to pass path prop instead of id for easy use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants