I am working on a project with a lot of number inputs, and the UI is like below (this is a part of it) :
2 rows and 5 number inputs in each row, using a submit button to write the data into SQL. the inputs names are 1 -5 from left to right for the first row and 6-10 for the second one:
the database has the same structure, and i d like to write the data row by row into it.
code for the button:
SubmitButton.OnSelect =
Patch( datasourceName,
lookup( use a row number to find the record, row1 ),
{
Year1: numberInput1.Value,
Year2: numberInput2.Value,
Year3: numberInput3.Value,
Year4: numberInput4.Value,
Year5: numberInput5.Value,
});
Patch( datasourceName,
lookup( use a row number to find the record, row2 ),
{
Year1: numberInput6.Value,
Year2: numberInput7.Value,
Year3: numberInput8.Value,
Year4: numberInput9.Value,
Year5: numberInput10.Value,
});
To retrieve the data from sql, the Value of the inputs is set as:
take the 1st input as example:
Lookup(datasourceName, Rowid = 1, Year1 )
And when i update the data on the inputs, the first row is updated correctly, but the second row isn't. (keeping the same number in SQL). I think the pb is, in the traditional one, we have 2 attributes to host the data, "Default" for data retrieving, and "Text" for the real value, which are separated; but here in the modern ones we have only the "Value" for both, so when we patch the 1st row, it runs a hidden refresh on the page so the Value is not we input before hitting the button but back to the data looked up from the data source.
The issue isn't happen to the traditional text inputs, but we will need a Cast for the data type. Value( textinput1.text) instead of using numberinput1.Value. And I am expecting an upgrade on the modern number inputs.