Umbraco 10 - Surface controllers - Multiple handlers per page
Hi there,
is it possible / is it going to be possible to support multiple handlers per page in Surface controllers for Umbraco version >= 10? I have a form with 2 submit buttons (Save, Delete) and would expect for this simple workflow to be supported.
Its supported in .Net Core out of the box so I would hope Umbraco supports this also.
Anybody from the Umbraco community or from HQ have any thoughts?
Thanks for looking into this for me. Much appreciated. Unfortunately I cannot confirm this. Its still not working for me. Based on your example, DoWorkOne is always called.
Here is my test implementation based on your code snippet. Maybe you can take a look and point out where the issue might be? Thanks!
Add view component to page view:
@await Component.InvokeAsync("TagCloud")
ViewComponent class:
namespace App.Core.ViewComponents
{
public class TagCloudViewComponent : ViewComponent
{
public TagCloudViewComponent()
{
}
public IViewComponentResult Invoke()
{
var tagCloudModel = new TagCloudModel
{
};
return View(tagCloudModel);
}
}
}
Thanks for letting me know. I guess that could be it. I'm on 10.3.2. Though I'm not seeing that particular change in the release notes for 10.4.0. Could you give it a try for 10.3.2? Thanks!
Umbraco 10 - Surface controllers - Multiple handlers per page
Hi there,
is it possible / is it going to be possible to support multiple handlers per page in Surface controllers for Umbraco version >= 10? I have a form with 2 submit buttons (Save, Delete) and would expect for this simple workflow to be supported.
Its supported in .Net Core out of the box so I would hope Umbraco supports this also.
Anybody from the Umbraco community or from HQ have any thoughts?
Thanks a lot.
Hannes
Hi Hannes,
As far as I can tell this should work fine, I just did a quick test and it appears to work.
Example. Form
It called the correct actions when bttons were clicked
Hi Huw,
Thanks for looking into this for me. Much appreciated. Unfortunately I cannot confirm this. Its still not working for me. Based on your example, DoWorkOne is always called.
Here is my test implementation based on your code snippet. Maybe you can take a look and point out where the issue might be? Thanks!
Add view component to page view:
ViewComponent class:
SurfaceController class:
View component partial:
what version of Umbraco are you testing on? It works fine for me (using 10.4.0-rc) each action gets called by the relevant submit button.
Thanks for letting me know. I guess that could be it. I'm on 10.3.2. Though I'm not seeing that particular change in the release notes for 10.4.0. Could you give it a try for 10.3.2? Thanks!
I think I have a 10.3.2 test site so will give it a try if I still have it
OK, I can definitely confirm it doesn't work in 10.3.2 but does in 10.4.0-rc
That's great to know and very helpful. Thanks Huw. I'll upgrade to 10.4.0 as soon as its out. Your help has been much appreciated.
is working on a reply...