How to re-render the preparation of a web block

Hi, I know it's a lot of info, I would appreciate if you go through it and try to understand my challenges. So I have a scenario whereby  I click button on the main screen "Add Tow button", it then opens a pop up screen and shows a web block with a list of records (1,2,3). However when I click on search, searching for record .4 which I know should be on the list it doesn't show it the first time. When I close the pop up and click "Add tow button" again it then shows me record 4 because it re-renders the web block preparation.

I would like to re-render my web block preparation on search. How do I achieve this?

Here is my preparation


 here is the web block the table is populated from the list in the preparation

My table properties (The one above)





when I click the search button it does the following logic, which I still need help,  there is no need for me to refresh that aggregate because the table above is populated from a list, how then do I refresh the list? Also I think most of my records are hidden because I am using a list and on navigation I don't have count so I am using length, I can't use an aggregate because there is data I need first in the preparation in a function above called "Allow Customer Invoice". 

So the refresh button called by search is below


Search button

Also I feel not all of my records are  showing because I am using length. I can't use an aggregate to get the length like you saw on the preparation there. There is info I need to get first a list of booleans that I am now using to filter the aggregate and compile a list


Anyone willing to assist me I will appreciate even if it means scheduling a zoom call I will be glad. I can't send an oml its a big module. Thank you

Solution

Hi RUDO MURIEL MUNYAVI !

I'm not sure what is causing the 3 records being displayed initially then 4 records after clicking on search. It would be great to provide oml.

However, I think this has something to do with the different implementation when retrieving the records for the 1st time and retrieving it again during "Search". During preparation, you are iterating through your aggregate and populating the list of records. On the other hand, during your RefreshTowingInstructionTable, you are just refreshing the aggregate and not repopulating the local list variable. I think you should have an additional input parameter in your screen action (like "RetrieveNewList" boolean parameter) to identify if it is going to clear the list of record and populate it with new data just like below:

Also, you are correct that there's no need to refresh aggregate when paginating. You just need to refresh the container of the table with the navigation web block.

Provided sample oml and this link for your reference


Hope this helps
Cheers!

TableUsingLocalVar.oml

Hi @RUDO MURIEL MUNYAVI,

Can you check after ajax refresh the web block before ending the "Search"  button's action?

Thaks, Aadhavan S

Solution

Hi RUDO MURIEL MUNYAVI !

I'm not sure what is causing the 3 records being displayed initially then 4 records after clicking on search. It would be great to provide oml.

However, I think this has something to do with the different implementation when retrieving the records for the 1st time and retrieving it again during "Search". During preparation, you are iterating through your aggregate and populating the list of records. On the other hand, during your RefreshTowingInstructionTable, you are just refreshing the aggregate and not repopulating the local list variable. I think you should have an additional input parameter in your screen action (like "RetrieveNewList" boolean parameter) to identify if it is going to clear the list of record and populate it with new data just like below:

Also, you are correct that there's no need to refresh aggregate when paginating. You just need to refresh the container of the table with the navigation web block.

Provided sample oml and this link for your reference


Hope this helps
Cheers!

TableUsingLocalVar.oml

@Marco Mateo Thank you so much you brought to my attention something I had not thought of. So on refresh I am now repopulating the list and that solves the issue to a certain extent, thank you. Now the only thing left is on the navigation panel I feel because I am using .length maybe that's why the other records are hidden but only visible after I search. eg

When I click add tow this is what I get, A list with 2 records

 As you can see there are only 2 records when I search for the 3rd customer record which I know must be here then it shows

This record should also show by default when I click add tow, not only after searching. I realized if I was using an aggregate and I use the count property on Total Row Count property of the List Navigation it shows everything but  now when I use length some things are hidden

I have managed to fix this, line count was set to 10, so I just put the list.length instead of limiting it to 10.

It then shows all hidden records. However the initial 10 was for it to have at least 10 records per page 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.