As you will see from below, I have a page which I need to generate multiple buttons based on the returned rows from an MS SQL query.
If the amount button data returned from the query is for example 6 buttons, then I need to show six buttons with the ‘value’ and ‘name’ set from the database query? If there was only 5 buttons, then I should only show 5.
As I am trying to perform all actions via Wappler, any help would be much appreciated.
You firstly need a repeat region based on the server connection to generate 1 column per result then set the text of the buttons via the dynamic attributes => Inner Text (or Inner HTML) to the values of the monetary values returned by each row
So, OK I now have a column created for all the returned rows in the data view, however, now I have two new problems to overcome or maybe I just implemented what you suggested incorrectly?
As you can see for the screenshot all the columns are repeated to the right, where I wanted rows of 3, and secondly, each button is being populated with the values of the first row.
Please try not to use any custom javascript when it is not needed and you don’t fully understand what it does.
You can do all the click actions with the app connect dynamic events. Choosing the action you want - there is absolutely no reason for custom scripting here.
I know the example JS doesn’t actually do much other than fire up a message of that value, but I was using it to validate an issue I am having with some JS I was planning(though I would need) to sum the value from the button each time they were pressed and inserting it into the total input field.
Believe me, if I knew how to perform the same intended action via Wappler alone I would.
I’ll see if I can figure out how to create a running total from each of the buttons clicks as per your information on the “click actions with the app connect dynamic events”, but if you know how to do it easily, then I would be grateful.