Hi everybody,
Today I'm facing a little issue.
In a form, I have a simple Menu Item Button whith an icon from Embedded ressources and text defined.
In active method of the main datasource, I change the text and the icon based on value. This works well.
In addition, when I click on the button itself, the text and icon have to change too. This works too except the first time I click the button after opening the form, the text change well but the icon dont.
I tried lock/unlock, lockWindowUpdate and even redraw methods on form, but it doesn't work. I tried to execute the sequence in debugger but it doesn't help.
Again, the problem occurs only the first time I click on, if I click multiple time, the icon switch well.
Here's my code :
void clicked() { super(); element.DLZmanageLockedPurchSalesInventButton(); }
public void DLZmanageLockedPurchSalesInventButton() { InventItemInventSetup inventItemInventSetup; InventItemPurchSetup inventItemPurchSetup; InventItemSalesSetup inventItemSalesSetup; #define.inventDimIdBlank("AllBlank") #define.imgLock("12102") #define.imgUnlock("12103") select firstOnly inventItemPurchSetup where inventItemPurchSetup.ItemId == InventTable.ItemId && inventItemPurchSetup.InventDimId == #inventDimIdBlank; if(inventItemPurchSetup.RecId) { if (inventItemPurchSetup.Stopped) { DLZItemLockPurch.text("@DLZ1433"); DLZItemLockPurch.normalImage(#imgUnlock); } else { DLZItemLockPurch.text("@DLZ1434"); DLZItemLockPurch.normalImage(#imgLock); } } select firstOnly inventItemSalesSetup where inventItemSalesSetup.ItemId == InventTable.ItemId && inventItemSalesSetup.InventDimId == #inventDimIdBlank; if(inventItemSalesSetup.RecId) { if (inventItemSalesSetup.Stopped) { DLZItemLockSales.text("@DLZ1435"); DLZItemLockSales.normalImage(#imgUnlock); } else { DLZItemLockSales.text("@DLZ1436"); DLZItemLockSales.normalImage(#imgLock); } } select firstOnly inventItemInventSetup where inventItemInventSetup.ItemId == InventTable.ItemId && inventItemInventSetup.InventDimId == #inventDimIdBlank; if(inventItemInventSetup.RecId) { if (inventItemInventSetup.Stopped) { DLZItemLockInvent.text("@DLZ1437"); DLZItemLockInvent.normalImage(#imgUnlock); } else { DLZItemLockInvent.text("@DLZ1438"); DLZItemLockInvent.normalImage(#imgLock); } } }