Reputation: 3583
I have a form in Dynamics AX 2009 with an ActionPane on top of it. In this ActionPane, I've got several ActionPaneTabs, each containing a set of ButtonGroup. I have a Button in one of them which I would like to be able to change its label dynamically.
That's the code I used when I have overriden the "clicked" method:
void clicked()
{
;
super();
if(Element.switch())
{
this.text("Go to X");
}
else
{
this.text("Go to Y");
}
}
Note that putting the super(); at the end of the method does not change anything. Element.switch() returns a boolean. Instead of that I also tried this piece of code:
btn_switch.text("...");
...and setting the button's property "Auto-declaration" to true (instead of calling the method with "this"). It still won't work.
Using the debugguer I can see that this piece of code is correctly executed, it just does not do anything to the button's label.
I was wondering if it was even possible to change a button's label when it's located in an ActionPane (I've looked for information in the documentation but I could not find anything related). Changing a button's label located outside of an ActionPane (i.e. a regular button on the form) works like a charm.
Maybe someone can help? I may be doing something wrong here...
Upvotes: 2
Views: 2234
Reputation: 1756
Unfortunately there isn't a way to do this in Dynamics AX 2009 because of the way the buttons are used inside of the ActionPane, however the issue has been fixed in Dynamics AX 2012.
You might be able to fake it by having two buttons, one with each label, and then setting the visibility of each based on which label you want shown.
Upvotes: 3