I am implementing a search using the 'like' to do a search but I want to reset the search text using a reset button. I try input a blank ie " " and then using ajax to rest the input widgets. But I don't know how to return the table record to the original data before the search. I try using Ajax to refresh the the table but it cannot? How am I going to do this

Hi Theow,

To understand how to implement a reset on a search I  want to suggest the following:

  1.  Drag the entity on which you want to search on a UI Flow.
  2. A list screen is scaffolded with build-in search and reset logic.
  3. Open the screen and click on the Search button, see that it has a Refresh<EntityName>Table action with a  ResetFilters and a ResetPagination input parameter
  4. Click on the Reset button, see it calls the same action as the Search button does, with different inputs.
  5. Open the Refresh<EnityName>Table action, the code generated by OutSystems looks like this, but then with your entity name:

If you build additional filters on your screen and use them in the aggregate to get the entity records, then in the above code on the ClearFilters assign widget you will have to put an additional assign to reset your extra filter.

Regards,

Daniel

How many I going to reset the index of a table record

Hi again,

In the Refresh<entityname>Table action there is the ResetStartIndex action, which will be executed if the ResetPagination property is set to true. To see the effect of the pagination reset and/or filter reset, first the Refresh of the aggregate defined in the Preparation is executed and then an AjaxRefresh of the TableRecords. 

Hopefully, this answers your question.

Regards,

Daniel


I am new to outsytem, if I am using a table record to contain the Person Entity, after the search, it show the result, how many I going to reset the table record show that it show all the person records in the table

Maybe it is time to share your code by upload an .OML or .OAP file to this thread, then I have a look at it. 

Here my code. It in the candidate screen

Solution

Hi Theow,

PFA - includes the updated .oml file

I found that while resetting the SearchText Variable value - You assigned with a " " (Space) value --- It should be "" (no space in between the double quotes)

Because of the SearchText = " " filter value the Aggregate returned the empty list of records.

Hope this helps you.


Regards,

Benjith Sam

Solution