aikau visibilityConfig for alfButton

cancel
Showing results for 
Search instead for 
Did you mean: 
redraccoon
Established Member

aikau visibilityConfig for alfButton

Jump to solution

Hello,

visibility config is working fine with my textBoxes

**********************************

this.textBox = new TextBox({
label: "label",
fieldId : "textBoxId",
visibilityConfig: {
initialValue: false,
      rules: [
                  {
                     targetId: "statutId",
                     is: ["Rejeté Illisible"]
                  }
               ]
                     }
});

********************************

But it's not working with my alfButton 

*****************************************

var btnIllisible = new AlfButton({

visibilityConfig: {
      rules: [
                  {
                     targetId: "statutId",
                     is: ["En cours", "Rejeté Inexploitable" ],
                     }
               ]
},
label: "label",
onClick: lang.hitch(this, '_onIllisible'),

});

********************************************

Do the alfButtons use different mechanics ?

1 Solution

Accepted Solutions
redraccoon
Established Member

Re: aikau visibilityConfig for alfButton

Jump to solution

I used another technique to do it, implemented a method that create the button depending on my variable

createButton : function com_documentFormEditPropertiesBuilding__createButton(btnLabel, btnOnClick, btnNode ){
var btn = new AlfButton({
label: btnLabel,
onClick: lang.hitch(this, btnOnClick),
});
btn.placeAt(btnNode);
return(btn);
},

Method :

name of the button  = this.createButton("label of the button in i18N",  name of the method to call on click, where I place the button in my template);

Exemple :

btnSave = this.createButton("com.formEditProperties.valider",'_onPublish', this.btnSaveNode);

View solution in original post

1 Reply
redraccoon
Established Member

Re: aikau visibilityConfig for alfButton

Jump to solution

I used another technique to do it, implemented a method that create the button depending on my variable

createButton : function com_documentFormEditPropertiesBuilding__createButton(btnLabel, btnOnClick, btnNode ){
var btn = new AlfButton({
label: btnLabel,
onClick: lang.hitch(this, btnOnClick),
});
btn.placeAt(btnNode);
return(btn);
},

Method :

name of the button  = this.createButton("label of the button in i18N",  name of the method to call on click, where I place the button in my template);

Exemple :

btnSave = this.createButton("com.formEditProperties.valider",'_onPublish', this.btnSaveNode);

View solution in original post