Update labels created in dynamic components

hello koders
Im having trouble changing label created in dynamic components.
the spinner selection should multiply to the price of item and update the price label
suppose item price 12 quantity 2 that is 12x2=24 therefore label should update to 24 instead of 12

I’m copying original price list to variable tag and replacing original price to multiply it with spinner selection in variable tag. after replacement setting label text to updated list that is variable but price label text its not changing and for reference snackbar is showing correct price after spinner selection its just that label text are not being updated.
please help !

If u have more items than one in the global variable list it will change your label text many time, so outcome must be wrong.

You want to change your label text once, I don’t understand why you need to do it in the loop. Your logic is unclear for me as well. Why do you store one variable in a list?

You should use local variable instead of global I. That case, cause it make a “code” mess.

1 Like

thanks @HeyAveHey
I’ve done this but now there’s one problem.
how can i get when any label clicks get component block to when any spinner after selecting section ?
i want to update label after spinner selection !

Its ok. Global variables in kodular are required to post data across different blocks with event handler. But don’t create global variables where they are not required, instead use local variables.

if you have created label with dynamic components you have to update it’s text using DynamicComponents not by the default blocks in kodular

You are totally wrong.

i dont think let him try once

I ate my teeth using dynamic components.

use this block -

@luv.ak.tech its not working !
i want when any label clicks get component block to when any spinner after selection selection ! thats it

if you want that you have to use dynamic label component instead DynamicComponents

Try this and see if it works

blocks - 2021-02-23T081408.771

1 Like

thanks @dora_paz late reply but i appreciate it.
I’ve solved this problem, cart system done successfully !
this simple block helped me solve this

Video link - cart.mp4 - Google Drive
:heart_eyes: :heart_eyes: :smiling_face_with_three_hearts: :heart_eyes: :heart_eyes:

1 Like