Multiple Update Form Generator (was:Horizontal, Vertical, inline)

I’m trying to create a multiple update form that basically appears like a table. In my case its a table with the drivers from a race in the first column and their finishing position in the second column. I would like to be able to enter finishing positions beside each driver and then hit Update.

I’ve created a multi update server action and I’m trying to create a page with the generator but each time the form appears the same whether I hit Horizontal, Vertical or Inline. I’m selecting the multi toggle but the generated form does not look like a table. Am I expecting the wrong thing?

Have a look at this video to get the idea https://www.youtube.com/watch?v=yJbjQrJy3Aw

To create the table, use the Bootstrap 4 Table Generator.

After that, use the Bootstrap 4 Form Generator to create the Multiple Update Form.

At this stage you will have a form and a table. The two need to be merged. This is done manually in Code view. The table element needs to be inside the form and the inputs need to be in the table cells.

Because you will not need the formatting of a Bootstrap form, when generating the form, make all of the form inputs hidden. This will ensure that you only get the input fields. Once the form has been generated, change ‘hidden’ to the input type that is required, e.g. ‘text’.

I have had to perform a similar process in this video https://www.youtube.com/watch?v=agvNauJm3xI&list=PLUjqTJN3byC9kK8YZkmGwjo9nrEipl2yb&index=23&t=6s

Thanks again Ben. I haven’t had a chance to look at the videos but given your track record I’m certain this is the solution I am hoping for. Can’t wait to try it out.

1 Like

I’m trying to create the initial multi update server action and when I create it the post-record values all end in .undefined. In the database update window they appear fine
image
image
I can’t even get past the first basic strep of getting the multi update form to work.

Is this the expected behavior?

No, something has gone wrong. Please have a look at part 9 of https://www.youtube.com/playlist?list=PLUjqTJN3byC9kK8YZkmGwjo9nrEipl2yb. Although the video is called ‘Sort Images’, it is in reality a multiple update.

Yea I tried the steps again as described in the video and I’m still getting the “undefined” in the resulting post values. It seems like there is an issue or I am missing a step. I realize this is not your issue is there a separate place I should be posting this?

Yea something is definitely wrong, this thing is broken

I will check it out

any update on this? I would like to work on this project

Couldn’t replicate the issue.

Could you provide step by step instructions with screenshots / video showing the problem from scratch?

image

I start by creating a server action

image
add my database and multi update
image

select my database in the record update step

image

add all the fields in the results column
image

use the default conditions

image

Post records are create with .undefined??

I save the server action

image

in my page I use the generator

when I choose the server action it populates with all of the .undefined post values

When I populate it with the race results It changes all of the fields ad the “undefined” goes away

I haven’t been able to get it to post and I assume it’s because of the difference in fields??

It looks like a problem with case (as in upper case or camel case)

Have a look at the $_POST values and compare that with the names of your database fields.

Thanks Ben , I’m familiar with making sure to match my post values with the form. my issue was trying to figure out why the server connect was creating the .undefined values then the form generator changes the predefined values. I had worked with this previously to create my first multi update form and I kept getting unmatched values using the generator which was frustrating. I had to manually match everything.

I stopped experimenting because it looked like a problem and I wanted to see if it would be corrected. I also wanted to see if there was a unique way I was doing things to break it. I thought that this would be helpful in researching the issue (if it existed)

I guess I’ll just go forward with my work and see if I can get it functioning with just a few fields

What is not obvious to me is the following:

  1. You create an Update Step and some of the fields contain upper case letters. Wappler assigns values that do not contain any upper case letters.
    image
  2. Then we have a look at the $_POST values and these are all lower case. So far so good.
    image
  3. Now we have a look at the completed Form Generator and we see that the upper case letters have returned.
    image

To me what is happening now is that your form input is sending one value, where the server side is expecting another value. For example, the form input with a name of TeamLink is sending its $_POST value ‘TeamLink’, but the server side is expecting a value of ‘teamlink’.

Furthermore, I think that Wappler is to blame for this because it is changing all upper case letters to lower case.

If you want try a test, change all of the datebase table fields to lower case and repeat the exercise. You will be pleasantly surprised. This may also help @George to understand the problem.

1 Like

yea unfortunately that is a legacy issue as the implications of the case of the letters would have implications across numerous pages. Let me see the feasability

OK so to experiment I renamed the fields and exported them to a new table which was all lower case

when I create my multi update server action it is still creating .undefined post records, is this expected behavior?

Using the latest Wappler version (1.9.0), I see what you mean. I am getting the same results which means that there is a bug within Wappler.

As a workaround, after having created the form, go back to Server Connect, choose the Server Action and select Globals. In Global Input Properties, choose the Linked Page and the relevant Form. Click Import From Form and you will get the correct form inputs. Delete the undefined values and you are set to go.

Sorry about the run-around, I was going off my (saturated) memory which was based on earlier versions of Wappler.

1 Like

No problem Ben, I had tried that before but I was also trying to put them into a table (as described at the beginning of the post) When I started having these issues I stopped fearing I was doing something wrong. I had never done a multi update so I wanted to be sure I was doing it right before trying to format it into a table

I will forge ahead and see how it goes. Thanks