os11 UI - table record with edit button open modal with form

Hello!

Question about the OS11 UI modal and how to use it.

We have a table record to dispaly some records.

On each line there is a edit button that should open a edit screen.

Normaly whe did this with a popup but now I'm trying to do this with the modal.

On the bottom of the screen I have 1 modal with a webblock that contains a form.

To the webblock the ID is passed by a local var.

When pressing the edit button I set the value of the local var with the ID of the current row.

Then I refresh the webblock in the modal and then togle the modal to show it.


Is this the correct way of doing this?


Hello Freek,

Yes, this seems the correct way to use a modal in the context you explained.

Cheers.

Only then I have a problem, the form in the webblock in the modal is not beeing updated see the screenshots:


Solution

Ah...

You're using a FORM.

Forms copy the information from the SOURCE to its own RECORD ONLY on page LOAD.
So you have to add an Assign node after the aggregate, in the preparation of the web block, and explicitly assign the current of the aggregate to the SOurce of the form. 

Cheers.

Solution

Why didn't I search for this 2 hours ago?  :)


Thank you!

freek wrote:

Hello!

Question about the OS11 UI modal and how to use it.

We have a table record to dispaly some records.

On each line there is a edit button that should open a edit screen.

Normaly whe did this with a popup but now I'm trying to do this with the modal.

On the bottom of the screen I have 1 modal with a webblock that contains a form.

To the webblock the ID is passed by a local var.

When pressing the edit button I set the value of the local var with the ID of the current row.

Then I refresh the webblock in the modal and then togle the modal to show it.


Is this the correct way of doing this?


Hi, Freek!


I'm trying to do exactly like you did for days, but with no success.

Could you please send me an oml file as an example?

It'll centainly help me a lot!

Thanks in advance,


Cheers,

Eduardo


Eduardo Coelho wrote:

freek wrote:

Hello!

Question about the OS11 UI modal and how to use it.

We have a table record to dispaly some records.

On each line there is a edit button that should open a edit screen.

Normaly whe did this with a popup but now I'm trying to do this with the modal.

On the bottom of the screen I have 1 modal with a webblock that contains a form.

To the webblock the ID is passed by a local var.

When pressing the edit button I set the value of the local var with the ID of the current row.

Then I refresh the webblock in the modal and then togle the modal to show it.


Is this the correct way of doing this?


Hi, Freek!


I'm trying to do exactly like you did for days, but with no success.

Could you please send me an oml file as an example?

It'll centainly help me a lot!

Thanks in advance,


Cheers,

Eduardo


Hi Eduardo,


The solution on this page is describing how to do this. In the preparation you for example do a query right? After the query you should do a assign of the query to the form. Only on page load Outsystems assigns the query by default to the form so if the web block is refresh’s it will not update the form by default. By adding a assign it works!

If this doesn’t help just let me know!


Hi again, Freek!

Sorry, I haven't been especific. I was referring to the first part that you did. Opening a modal after clicking on a button that is on a table record.

The point is that the platform doesn't point me errors, but it still doesn't work. I mean, the modal doesn't open by clicking the button.

I have a button, with a link and a screen action that has a server action called toggleModal (it already comes on platform web patterns), but I don't know where do I attach the web block that I've created to show on the modal window.


Best regards,

Eduardo