Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 73760

AX2012 - Add buttons to Action Pane by code

$
0
0

Hi

I'm trying to add buttons dynamically on a button group which resides in an ActionPaneTab. I managed to display the buttons correctly (label & image) however I cannot toggle the value on form startup. Even setting the property "ToggleButton" to Radio by code doesn't work either. The toggle doesn't work when you have 2 button groups - clicking a button in the first group will untick the selected button in the second group!

I created a form from the AOT (manually adding buttons and setting the properties manually) and everything works as expected. You can set the toggleValue() on the run() and it works.

Is this a bug or I'm doing something wrong?

This is a snippet of my form code:

public void init()

{

FormButtonControl     btnQty, btnPrice, btnNone, btnOnHand; 

super();

PrimaryGroup.caption('Input');

btnQty = PrimaryGroup.addControl(FormControlType::Button, 'inputGroup');

btnQty.text('Qty');

btnQty.imageLocation(SysImageLocation::EmbeddedResource);

btnQty.big(NoYes::Yes);

btnQty.toggleButton(ToggleButtonStyle::Radio);

 

btnPrice = PrimaryGroup.addControl(FormControlType::Button, 'inputGroup');

btnPrice.text('Price');

btnPrice.big(NoYes::No);

btnPrice.toggleButton(toggleButtonStyle::Radio);

btnPrice.toggeValue(NoYes::Yes);                         // Should in theory mark button as ticked.

 

SecondaryGroup.caption('Display');

btnNone = SecondaryGroup.addControl(FormControlType::Button, 'displayGroup');

btnNone.text('None');

btnNone.toggleButton(ToggleButtonStyle::Radio);

btnNone.toggleValue(NoYes::Yes);                         // Should in theory mark button as ticked.

 

btnOnHand = SecondaryGroup.addControl(FormControlType::Button, 'displayGroup');

btnOnHand.text('On hand');

btnOnHand.toggelButton(ToggleButtonStyle::Radio);

}

 

Thanks!

Kevin 


Viewing all articles
Browse latest Browse all 73760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>