copy textField value

Well this should be really easy but I have searched the Wiki and the Forums and come up blank.

On a form you have a textField that uses a column as its dataProvider. You want to copy that textField’s value to another textField that does not have a dataProvider.

How is that done?

thanks,

Terry

Both text fields should have a dataprovider.

What are you trying to do? The dataprovider of your second textfield should probably be a form- or scope variable.

Joas,

thanks for your help.

I am just learning a bit about Servoy. Let me put my question another way.

Suppose that I have a textField that has a column dataProvider and that textField has a numerical value for a record of 25.5.

How can I programatically access the textField’s value, multiply it with another number and then display it in another textField?

Terry

Let’s say you have 3 columns: price, amount and total
To calculate the total you want to multiply the price with the amount.
For this you need just one line of code:

total = amount * price;
```Easy, right?

Basically, you don't care about showing the value in the textfield, Servoy handles that for you (automatic data binding)

Here shown in developer where the amount and price fields use the same method on their onDataChange event. So whenever one of them changes, the total is calculated automatically:
[attachment=0]script.png[/attachment]

Joas,

that makes sense - for the first time!

many thanks,

Terry