Increase or Decrease integer value by button in editor Screen

Hi Cuba team,

I have an integer attribute named amount, how do i get a user increase or decrease the value by 1 each time an increase or decrease button is clicked in the editor screen

Thanks for your help,

Hi @mabutabee

In CUBA 6:

  • define click handler methods for the buttons using invoke XML attribute
  • use getItem().setAmount(newValue) to update the entity attribute

In CUBA 7:

  • subscribe to button click events using @Subscribe annotation
  • use getEditedEntity().setAmount(newValue) to update the entity attribute

Hi,

Thanks for the help, i get the idea