How do I get the "Edit action URL" of the Edit/UIForm of a Kentico Custom Module UI?

Patrick Taylor asked on March 22, 2018 15:18

I'm creating a custom module for Kentico 11, and I have two fully-functioning Object Listing template implementations using custom UniGrid XML definitions and ControlExtenders. How do I get the Edit action URL of the Edit/UIForm for the second Object Listing as seen in the screenshot below? The Kentico Documentation shows one example of setting the URL to an ASPX template in CMSModules, but that seems to only apply to Web Forms manually created specifically for that custom module. Is there a native Kentico ASPX file I should be referencing or some other URL I can use to resolve this issue?

Screenshot of the Custom Module's UI Tab for reference

Correct Answer

Dragoljub Ilic answered on March 22, 2018 16:23

Hi Patrick,

If you add simple 'Edit' element under your listing UI element in modules, select page template as 'New/Edit object' and set 'Object type' on property tab to your object, then should work without setting edit url at all.

You must have something like this in your data grid xml: <action name="edit" caption="$General.Edit$" fonticonclass="icon-edit" fonticonstyle="allow" />

Best regards, Dragoljub

1 votesVote for this answer Unmark Correct answer

Recent Answers

Patrick Taylor answered on March 22, 2018 16:51

Dragoljub, Thanks! That did exactly what I was looking for. Alex Golebiewski provided a similar answer via the Kentico-Community Slack Channel. I had my Edit page named after the object it was being used to Edit, but I now see how that is redundant because the Object type is already defined elsewhere.

Alex Golebiewski also directed me to this article by Martin Hejtmanek where he provides some more detailed insight into module development including the following quote:

"I also created two additional UI elements for New and Edit using the New/Edit object page template (with corresponding prefixes in the element code name so the system automatically picks them up for the given actions)."

I've also confirmed that one could add anything after the initial Edit prefix in the CodeName and still have the edit action automatically redirect.

Screenshot of Alex Golebiewski's answer in the Kentico-Community Slack Channel for reference

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.