Add webblocks on runtime
Application Type

Hi community,

We have developed an application where sales representatives and order processors can easily view the product catalog. Only a few filters are now available in the product grid (product group, product subgroup, brand, price, etc.). I made a quick sketch to give you an idea of what it looks like. 

All the filters are using the same webblock as you can see in the image below. The data is retrieved outside of the webblock and being filled with a input parameter. An event eventually returns which filter items have been selected. An event handler on the page then ensures that this is translated to the product grid, so the correct products are being shown.

In the next phase they want to add specific product subgroup filters. Each subgroup has specific filters for that product subgroup. In the application it is now possible to select different product subgroups. This can lead to many different product subgroup filters being added. In my experience, this will make the user experience worse, because there are dozens of filters to select. A solution could be to set this up differently, so that you always end up in the product grid at subgroup level and therefore only have an x number of specific subgroup filters (this is my preferred solution because this will lead to overall better user experience).

If the product owner still wants to stick to the current way, this means that in the extreme case 100+ filters can be added. We do not want to define all these filters in advance in the screen and make use of the visibility options. There is a synchronization mechanism which ensures that these filters can be added and removed in the database (based on ETIM classes).

The above provides a brief summary. Does anyone have an idea how best to add these filters dynamically? Is it even possible to add and remove webblocks at runtime?

Thanks in advance,




You cannot add blocks dynamically in OutSystems you can only do this design time. You could use a list and each block in a list as a list item, you can setup your datamodel to steer the list entries (blocks) and conditionally show each block. Hope this makes sense to you.



Hi Daniël,

Thanks for your reply! Good to know it is not possibile to add blocks dynamically at runtime.

Thanks for letting me know a possibile solution to overcome this challenge. I will mark this as a solution :-)

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