Actions per container? #2744
Replies: 2 comments
-
I believe you may be thinking of passing more than one parameter in the navigation, one that handles each component independently with logic to handle the different views as needed in the body? Or having header and footer components ignore the Action=Detail/Edit while still keeping the relationship with the body component? |
Beta Was this translation helpful? Give feedback.
-
@markdav-is You can accomplish your goals without using the Action parameter. The "body" component could have multiple different renderings depending on a Url parameter or Querystring parameter. This is the approach used in the Blog module (https://github.com/oqtane/oqtane.blogs/blob/master/Client/Index.razor) to determine whether to render either a list of blogs or a specific blog post. |
Beta Was this translation helpful? Give feedback.
-
If I understand Actions properly, a razor component that inherits from ModuleBase can serve any number of Actions. The Action itself is a page-level property set by navigation. Given a page composed of multiple modules, each module is set with the same action.
I have a scenario where I'd like to have one of the module in the page be in a different action than the others. For simplicity, let's say I have a header module that is only labels, a body that is an edit form that can switch between Action=Detail/Edit and a footer module that is also labels. These are three different modules.
The solution that I'm envisioning is making a container that will override the action on the header and footer to always be Detail, and allow the body to respond to the changing action of the page.
I can think of other ways to handle this using regular razor components and I might do that, but it would be handy to be able to use modules in this way as well.
Maybe I'm missing something about Actions? Any thoughts are welcome!
Beta Was this translation helpful? Give feedback.
All reactions