Serenity: Dialog Template Not Working

Created on 9 Feb 2018  路  5Comments  路  Source: serenity-is/Serenity

I'm re-structuring my current project and cannot seem to get the Dialog templates to work.
I'm going from a 2 level hierarchy design /Modules/SectionA/SectionB/SectionBDialog.ts)
To a three level. (/Modules/Region/SectionA/SectionB/SectionBDialog.ts)

However I'm stumped as to why my SectionBDialog.Template.html isn't working after the restructure. I've even built it from the bottom referencing the "OtherFormInTab" dialog example and still having issues.

Is there a way to test my Template is in the correct location server side?

Most helpful comment

You can override getTemplateName method

All 5 comments

Templates are only loaded from under Modules folder

Sorry @volkanceylan, it was midnight when I wrote this up after trying to get it to work.
It is under Modules and I've corrected my above.

After thinking about it more last night, does it have anything to do with the URL path? My URL patch matches what the file structure is (website.com/Region/SectionA/SectionB) but the example OtherFormInTab example URL is only two levels from the root of serenity (http://serenity.is/demo/BasicSamples/OtherFormInTab)

Your dialog template should be available as Region.SectionBDialog, subfolders are ignored, you can look at page source registered scripts to see if there is a "Template.Region.SectionBDialog" there.

Thank you @volkanceylan. I had my dialog under the namespace ProjectABC.Region.SectionA.SectionB which was causing my issues for the template. After changing it to ProjectABC.Region, it worked.
Today I learned you should not have the same dialog name after the first Module.

Is there any way to have a working template with a dialog under the namespace ProjectABC.Region.SectionA.SectionB? For my design using namespaces to separate out things is easier than having a long DialogName like SectionASectionBDialog since I'll have very similar dialogs for various regions with just minor formatting differences and business logic.

You can override getTemplateName method

Was this page helpful?
0 / 5 - 0 ratings