Skip to content

Commit

Permalink
Merge pull request #53 from mendix/fix/deprecation-in-name-widget
Browse files Browse the repository at this point in the history
Remove deprecation from name, update logger to console
  • Loading branch information
HedwigAR authored Jan 18, 2023
2 parents 6e98f5a + 6bad6a4 commit 91ef0c0
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "RadioButtonList",
"version": "7.1.2",
"version": "7.1.3",
"description": "",
"license": "Apache Version 2.0",
"author": "Mendix",
Expand Down
2 changes: 1 addition & 1 deletion src/RadioButtonList/AttrRadioButtonList.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<widget id="RadioButtonList.widget.AttrRadioButtonList" needsEntityContext="true" xmlns="http://www.mendix.com/widget/1.0/">
<name>Attribute Radiobutton List (Deprecated)</name>
<name>Attribute Radiobutton List</name>
<description>Creates a radiobutton list based on an enumeration or boolean attribute.</description>

<icon>iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
Expand Down
40 changes: 20 additions & 20 deletions src/RadioButtonList/widget/AssocRadioButtonList.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*jslint browser: true, devel:true, nomen:true, unparam:true, regexp: true, plusplus:true*/
/*global require, define, logger, mx, mendix*/
/*global require, define, console, mx, mendix*/
define([
"dojo/_base/declare",
"mxui/widget/_WidgetBase",
Expand Down Expand Up @@ -58,13 +58,13 @@ define([
},

postCreate: function () {
logger.debug(this.id + ".postCreate");
console.debug(this.id + ".postCreate");
this._assocName = (typeof this.entity !== "undefined" && this.entity !== "") ? this.entity.split("/")[0] : "";
this.entity = this._assocName;
},

update: function (obj, callback) {
logger.debug(this.id + ".update");
console.debug(this.id + ".update");

this._contextObj = obj;
this._resetSubscriptions();
Expand All @@ -79,7 +79,7 @@ define([
},

_setupWidget: function (callback) {
logger.debug(this.id + "._setupWidget");
console.debug(this.id + "._setupWidget");

if (this.readOnly || this.get("disabled") || this.readonly) {
//this.readOnly isn't available in client API, this.get("disabled") works correctly since 5.18.
Expand Down Expand Up @@ -134,7 +134,7 @@ define([
},

_setRadiobuttonOptions: function (callback) {
logger.debug(this.id + "._setRadiobuttonOptions");
console.debug(this.id + "._setRadiobuttonOptions");

if (this._contextObj) {
if (this.dataSourceType === "xpath") {
Expand All @@ -151,7 +151,7 @@ define([
},

_updateRendering: function (callback) {
logger.debug(this.id + "._updateRendering");
console.debug(this.id + "._updateRendering");
if (this._contextObj !== null) {
dojoStyle.set(this.domNode, "display", "");
this._createRadiobuttonNodes(callback);
Expand All @@ -167,7 +167,7 @@ define([
},

_handleValidation: function (validations) {
logger.debug(this.id + "._handleValidation");
console.debug(this.id + "._handleValidation");
this._clearValidations();

if (this._isReadOnly || this._contextObj.isReadonlyAttr(this.entity)) {
Expand All @@ -183,14 +183,14 @@ define([
},

_clearValidations: function () {
logger.debug(this.id + "._clearValidations");
console.debug(this.id + "._clearValidations");
dojoConstruct.destroy(this._alertDiv);
this._alertDiv = null;
dojoClass.remove(this.radioButtonContainer, "has-error");
},

_showError: function (message) {
logger.debug(this.id + "._showError");
console.debug(this.id + "._showError");
if (this._alertDiv !== null) {
dojoHtml.set(this._alertDiv, message);
return true;
Expand All @@ -204,15 +204,15 @@ define([
},

_addValidation: function (message) {
logger.debug(this.id + "._addValidation");
console.debug(this.id + "._addValidation");
if (message) {
this._showError(message);
}
dojoClass.add(this.radioButtonContainer, "has-error");
},

_resetSubscriptions: function () {
logger.debug(this.id + "._resetSubscriptions");
console.debug(this.id + "._resetSubscriptions");
// Release handles on previous object, if any.
this.unsubscribeAll();

Expand Down Expand Up @@ -242,7 +242,7 @@ define([
},

_getDataFromXPath: function (callback) {
logger.debug(this.id + "._getDataFromXPath");
console.debug(this.id + "._getDataFromXPath");
if (this._contextObj) {
mx.data.get({
xpath: "//" + this.RadioListObject + this.Constraint.replace(/\[%CurrentObject%\]/g, this._contextObj.getGuid()),
Expand All @@ -267,14 +267,14 @@ define([
},

_getDataFromDatasource: function (callback) {
logger.debug(this.id + "._getDataFromDatasource");
console.debug(this.id + "._getDataFromDatasource");
this._execMF(this._contextObj, this.datasourceMf, lang.hitch(this, function (objs) {
this._populateRadiobuttonOptions(objs, callback);
}));
},

_populateRadiobuttonOptions: function (objs, callback) {
logger.debug(this.id + "._populateRadiobuttonOptions");
console.debug(this.id + "._populateRadiobuttonOptions");
var mxObj = null,
i = 0,
value;
Expand All @@ -293,7 +293,7 @@ define([
},

_createRadiobuttonNodes: function (callback) {
logger.debug(this.id + "._createRadiobuttonNodes");
console.debug(this.id + "._createRadiobuttonNodes");

var mxObj = null,
i = 0,
Expand Down Expand Up @@ -352,7 +352,7 @@ define([
},

_createLabelNode: function (key, value, index) {
logger.debug(this.id + "._createLabelNode");
console.debug(this.id + "._createLabelNode");
var labelNode = dojoConstruct.create("label", {
"for": this.entity + "_" + this.id + "_" + index,
"innerHTML": value
Expand All @@ -362,7 +362,7 @@ define([
},

_createRadiobuttonNode: function (key, value, index) {
logger.debug(this.id + "._createRadiobuttonNode");
console.debug(this.id + "._createRadiobuttonNode");
var radiobuttonNode = null;

radiobuttonNode = dojoConstruct.create("input", {
Expand All @@ -387,7 +387,7 @@ define([
},

_addOnclickToRadiobuttonItem: function (labelNode, rbvalue) {
logger.debug(this.id + "._addOnclickToRadiobuttonItem");
console.debug(this.id + "._addOnclickToRadiobuttonItem");

this.connect(labelNode, "onclick", lang.hitch(this, function () {

Expand All @@ -411,7 +411,7 @@ define([
},

_execMF: function (obj, mf, callback) {
logger.debug(this.id + "._execMF");
console.debug(this.id + "._execMF");
var params = {
applyto: "selection",
actionname: mf,
Expand Down Expand Up @@ -439,7 +439,7 @@ define([
},

_executeCallback: function (cb, from) {
logger.debug(this.id + "._executeCallback " + (typeof cb) + (from ? " from " + from : ""));
console.debug(this.id + "._executeCallback " + (typeof cb) + (from ? " from " + from : ""));
if (cb && typeof cb === "function") {
cb();
}
Expand Down
32 changes: 16 additions & 16 deletions src/RadioButtonList/widget/AttrRadioButtonList.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*jslint browser: true, devel:true, nomen:true, unparam:true, regexp: true, plusplus:true*/
/*global require, define, logger, mx, mendix*/
/*global require, define, console, mx, mendix*/
define([
"dojo/_base/declare",
"mxui/widget/_WidgetBase",
Expand Down Expand Up @@ -48,11 +48,11 @@ define([
},

postCreate: function () {
logger.debug(this.id + ".postCreate");
console.debug(this.id + ".postCreate");
},

update: function (obj, callback) {
logger.debug(this.id + ".update");
console.debug(this.id + ".update");
this._contextObj = obj;
this._resetSubscriptions();
this._setRadiobuttonOptions();
Expand All @@ -67,7 +67,7 @@ define([
},

_setupWidget: function (callback) {
logger.debug(this.id + "._setupWidget");
console.debug(this.id + "._setupWidget");

if (this.readOnly || this.get("disabled") || this.readonly) {
//this.readOnly isn"t available in client API, this.get("disabled") works correctly since 5.18.
Expand Down Expand Up @@ -128,7 +128,7 @@ define([
},

_updateRendering: function (callback) {
logger.debug(this.id + "._updateRendering");
console.debug(this.id + "._updateRendering");

if (this._contextObj !== null) {
dojoStyle.set(this.domNode, "display", "");
Expand All @@ -143,7 +143,7 @@ define([
},

_handleValidation: function (validations) {
logger.debug(this.id + "._handleValidation");
console.debug(this.id + "._handleValidation");
this._clearValidations();

var validation = validations[0],
Expand All @@ -158,14 +158,14 @@ define([
},

_clearValidations: function () {
logger.debug(this.id + "._clearValidations");
console.debug(this.id + "._clearValidations");
dojoConstruct.destroy(this._alertDiv);
this._alertDiv = null;
dojoClass.remove(this.radioButtonContainer, "has-error");
},

_showError: function (message) {
logger.debug(this.id + "._showError");
console.debug(this.id + "._showError");
if (this._alertDiv !== null) {
dojoHtml.set(this._alertDiv, message);
return true;
Expand All @@ -179,15 +179,15 @@ define([
},

_addValidation: function (message) {
logger.debug(this.id + "._addValidation");
console.debug(this.id + "._addValidation");
if(message) {
this._showError(message);
}
dojoClass.add(this.radioButtonContainer, "has-error");
},

_resetSubscriptions: function () {
logger.debug(this.id + "._resetSubscriptions");
console.debug(this.id + "._resetSubscriptions");
var validationHandle = null,
objectHandle = null,
attrHandle = null;
Expand Down Expand Up @@ -221,7 +221,7 @@ define([
},

_setRadiobuttonOptions: function () {
logger.debug(this.id + "._setRadiobuttonOptions");
console.debug(this.id + "._setRadiobuttonOptions");
if (this.entity !== "" && this._contextObj) {
//get enumeration for current attribute
if (this._contextObj.getAttributeType(this.entity) === "Enum") {
Expand All @@ -239,7 +239,7 @@ define([
},

_createRadiobuttonNodes: function (callback) {
logger.debug(this.id + "._createRadiobuttonNode");
console.debug(this.id + "._createRadiobuttonNode");
var labelNode = null,
radioButtonNode = null,
i = 0,
Expand Down Expand Up @@ -298,7 +298,7 @@ define([
},

_createLabelNode: function (key, value, index) {
logger.debug(this.id + "._createLabelNode");
console.debug(this.id + "._createLabelNode");
var labelNode = dojoConstruct.create("label", {
"for": this.entity + "_" + this.id + "_" + index,
"innerHTML": value
Expand All @@ -308,7 +308,7 @@ define([
},

_createRadiobuttonNode: function (key, value, index) {
logger.debug(this.id + "._createRadiobuttonNode");
console.debug(this.id + "._createRadiobuttonNode");
var radiobuttonNode = null;

radiobuttonNode = dojoConstruct.create("input", {
Expand All @@ -335,7 +335,7 @@ define([
},

_addOnclickToRadiobuttonItem: function (radiobuttonNode, rbvalue) {
logger.debug(this.id + "._addOnclickToRadiobuttonItem");
console.debug(this.id + "._addOnclickToRadiobuttonItem");
this.connect(radiobuttonNode, "onclick", lang.hitch(this, function () {

if (this._isReadOnly ||
Expand Down Expand Up @@ -381,7 +381,7 @@ define([
},

_executeCallback: function (cb, from) {
logger.debug(this.id + "._executeCallback " + (typeof cb) + (from ? " from " + from : ""));
console.debug(this.id + "._executeCallback " + (typeof cb) + (from ? " from " + from : ""));
if (cb && typeof cb === "function") {
cb();
}
Expand Down
2 changes: 1 addition & 1 deletion src/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="RadioButtonList" version="7.1.2"
<clientModule name="RadioButtonList" version="7.1.3"
xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="RadioButtonList/AttrRadioButtonList.xml"/>
Expand Down
Binary file modified test/Test.mpr
Binary file not shown.

0 comments on commit 91ef0c0

Please sign in to comment.