Custom Widget to do a multiplication

Hello ! 

I'm trying to find how I can do this : inside a table be able to multiply 2 variables together and display them on a new column of the table

https://zupimages.net/viewer.php?id=22/23/e6eo.png

Thanks 

Thomas 

Hello bakc dibyajit.Roy

The idea is it make it on a form so with instant modification and be able to see it change directly ! Of course by fetching information from database it will work, but not on my form isn't it ? I will need to send my form to see modification

That's why I was asking if it's possible to do a custom widget to directly do the multiplication :)

Thanks

Regards,

Thomas 

How to make a fragment to multiple 2 numbers.
1) In the UI designer , drag a container from left pane to the page.
2) Drag 3 textbox from left pane inside the container.
3) from the Top right hand side, click the 3 dots and save the container as a fragment.
4) Once fragment is created , just edit/ open the fragment.

5) Inside the fragment , create 3 variables ,as firstval , secondVal and thridVal. keep the type as string.

6) Assign firstVal to value of 1st Textbox , SecondVal as value of second Textbox

7)Write a simple Javascript to convert the values to interger and then multiply them.
8) Assign the output to the thirdVal.

To make fragment as repeatable , just put the fragment inside a container and use Buttons to add to collection.

regards

 

Hello
you should definitely use a fragment.
With Fragments you can fetch Information from database like product name , product price and then perform some calculation on those values.
If you make the fragment as repeatable, then you can have as many rows as you want.

Regards 

Hello,

First of all, thanks for your answer !

I'll try it and let you know :)

Thanks :)

Hello back Dibyajit.Roy

The idea is it make it on a form so with instant modification and be able to see it change directly ! Of course by fetching information from database it will work, but not on my form isn't it ? I will need to send my form to see modification

That's why I was asking if it's possible to do a custom widget to directly do the multiplication :)

https://www.hosting-images.net/image/RN2L

 

Thanks

Regards,

Thomas

The Image that you have shared is Custom widget not fragment.

Could you explain your Use case in more detail.Why do need custom widget and not fragment ?

 

If I refer to the image that you shared earlier, best solution is using Fragments , not widget. You can achieve the result with fragments.
For getting the total calculation , you need to write a simple javascript to loop through and add the amounts.

DId you follow the below steps to create a fragment ?

First drag a container on the UI designer. On the Top right click the three dots to save the container as Fragment.
Now open/ edit the fragment and start adding UI elements inside the fragments. You can make API calls inside fragment.
You can also write JavaScript inside fragment.

Take another container and now put this fragment inside the second container. Give a collection name. this will make the fragment as repeatable.

Hello,
 I think I expressed myself badly: I'm trying to make a widget with 2 variable inputs which allows you to multiply the two inputs and display the result

Regards

Thomas

Hi Thomas

Please refer to this image  https://imgur.com/a/BiPLo3m
this was made using fragments.

Is this what you are looking for ?

Hi  Dibyajit.Roy ! 

Yes it's exactly this ! 

But how did you do to do the multiplication ? 

Or could you just send me the page so I can check by my self ? 

Thanks

Thomas

 

Thank you for your help, it's working !!!!

Best Regard !

Thomas 

 

Thank you for your feedback. Happy to Help. smiley


Inside fragment , you can make API calls to database to fetch values  and perform complex calculations using JavaScript.

Regards