Creating a microflow to increase or decrease a value of a label

0
I have a label and two buttons. Plus and Minus.  I want to be able to increase the number inside the label or decrease it by click on the buttons.  THis is my domain Model:       And now when I click on the category, the products appear of this category. I wan to be able to add quantity for this product as the product has this attribute in products_order table.   Sorry I am just a starter in Mendix. 
asked
2 answers
0

Place the label and buttons inside of an dataview pointed to an entity with an integer attribute.  Create 2 nanoflows or microflows, depending on your use case.  Both microflows will have a parameter that matches the entity of the dataview.  The first microflow will have a change action that adds one to the attribute.  The second microflow will have a change action that substracts one from the attribute.  In the label (text widget), have a parameter for the text value that points to the integer attribute.

**EDIT**

you may need to change your domain model.  Each Product can be associated with multiple Product_Orders.  Since you want to update the quantity in Product_Orders, this means you don’t know which one you should update.  You can either change the association to a 1-1 or (my recommendation) put the quantity field in the Product entity, eliminate the Product_Orders entity and make a 1-* association between Product and Orders.  With that structure, you will be able to update the quantity attribute on the Product entity with microflows as I described previously.

answered
0

 

I have created a microflow and I call it when I click on the button. And I set the quaintity + 1,  Can you check what is wrong?

answered