Custom module backend insert view doesn't show the toolb

Posted by Community Admin on 05-Aug-2018 22:50

Custom module backend insert view doesn't show the toolbar

All Replies

Posted by Community Admin on 16-Feb-2011 00:00

Hi,

I have created a custom module called "Employees" based on the products module. I implemented everything in the same way as in the products module. However when I go to create a new item scree (attached), it is not showing the complete toolbar containing Publish, Draft buttons and More Action link is not poping up. When i enter this page I get two allerts with only "undifined" as the text. Can someone please tell me what I have done wrong?

The sample module project is uploded to sendspace.com and can be downloaded using the link below.

http://www.sendspace.com/file/vfxea4

Thanks!
Duneel

Posted by Community Admin on 17-Feb-2011 00:00

Hi Duneel,

I got the same error as you. This bug is caused by workflows, the workflow is not found. You can see this using firefug and firecookie. I resolve this rebuilding my custom module because I don'k know where exactly to search the bug.

Hope it helps you!

Jocelyn

Posted by Community Admin on 17-Feb-2011 00:00

Hi Joeclyn,

Could you please tell me the steps you followed to fix this workflow issue?

Thanks!
Duneel

Posted by Community Admin on 17-Feb-2011 00:00

Hi,

I create my module again using one module which works. I don't know exactly what was my error, maybe in the name I gave to the workflow file or anywhere in the module where the workflow is references.

I'm sorry not to tell more.

How custom modules work are still strange to me regardings some features...

Jocelyn

Posted by Community Admin on 17-Feb-2011 00:00

Thanks Joeclyn!

Can Ivan or Radoslav please help us to get over this workflow issues we are facing with custom modules?

Thanks,
Duneel

Posted by Community Admin on 21-Feb-2011 00:00

Hello Duneel,

We examined the project you provided us and we found that your EmployeesWorkflow.xamlx is incorrect. There are a few unescaped quotes in the markup around the word ContentType:

<p1:Variable x:TypeArguments="tsfa:IAnyDraftFacade" Default="[App.Prepare().SetContentProvider(providerName).WorkWith().AnyContentItem(contextBag("ContentType"), itemId)]" Name="masterFluent" />

A xamlx file with fixed markup is attached.

Greetings,
Ivan Pelovski
the Telerik team

Posted by Community Admin on 22-Feb-2011 00:00

Hi Ivan,

Thanks for examining the module project and locating the error. Wow the module works like charm with the new workflow file. So then it was a problem with the workflow.

Thanks,
Duneel

Posted by Community Admin on 22-Feb-2011 00:00

Hi Ivan,

Just a quick thing. I changed my custom module and got-rid-of the Title field. And now I cannot publish the new items. A validation with the URL field fails everytimes I hit on publish since now I dont have the Title input field on create new form. How do I fix this issue? Is it a must to have a Title field in every module?

Thanks,
Duneel

Posted by Community Admin on 23-Feb-2011 00:00

Hello Duneel,

The problem you have described comes from the fact that the field control for UrlName is MirrorTextField which mirrored field is Title. Here is the code:

var urlName = new MirrorTextFieldElement(moreOptionsSection.Fields)
    Title = Res.Get<EmployeesResources>().UrlName,
    ID = "urlName",
    MirroredControlId = titleField.ID,
    DataFieldName = "UrlName",
    DisplayMode = displayMode,
    RegularExpressionFilter = DefinitionsHelper.UrlRegularExpressionFilter,
    WrapperTag = HtmlTextWriterTag.Li,
    ReplaceWith = "-"
;
To fix this you have to set the MirroredControlId property to the id of the field control you want to be used for generating the UrlName of the employee. Or you can use another field control for UrlName like TextField.

Best wishes,
Ivan Pelovski
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!

Posted by Community Admin on 23-Feb-2011 00:00

Thanks Ivan P! It resolved the my issue. I set the MirroredControlId to another field in my module.

Posted by Community Admin on 02-Sep-2011 00:00

Hi Ivan,

Along the same lines, is there a way to use two fields and still automatically mirror for the URL field? For instance, we have a firstname and lastname field and it would be great if the url field was automatically created like firstname-lastname.

Posted by Community Admin on 07-Sep-2011 00:00

Hi Kmac,

Our MirrorTextField supports only one mirrored field. You will have to implement a custom field if you want such functionality but it's not so difficult. Your field will have to listen for the JavaScript events of several fields and will need some sort of pattern or format for populating its value.

All the best,
Ivan Pelovski
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Posted by Community Admin on 07-Sep-2011 00:00

Thanks Ivan,

Do you happen to have some sample code to get started? I'm not sure where to begin.

Posted by Community Admin on 13-Sep-2011 00:00

Hi Kmac,

Here is a sample you can use for your development. It is based on the MirrorTextField and overwrites several methods in order to support more than one mirrored text field.

Best wishes,
Ivan Pelovski
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Posted by Community Admin on 14-Sep-2011 00:00

Thanks for the code. Pretty straightforward once you look at it. Of course now I have another question. When building a custom module, the definitions file needs a MirrorTextFieldElement. What do I need to do in order to actually add this MultiMirrorTextField to a backend section.

I tried this but it doesn't like that when I try to add it in the moreOptionsSection.Fields.Add(urlName);

var urlName = new MultiMirrorTextField()
    
        Title = "UrlName",
        ResourceClassId = typeof(PeopleResources).Name,
        ID = "urlName",
        MirroredControlId = firstNameField.ID,
        MirroredControlIds = new string[] firstNameField.ID, lastNameField.ID ,
        DataFieldName = (displayMode == FieldDisplayMode.Write) ? "UrlName.PersistedValue" : "UrlName",
        DisplayMode = displayMode,
        RegularExpressionFilter = DefinitionsHelper.SeoRegularExpressionFilter,
        WrapperTag = HtmlTextWriterTag.Li,
        ReplaceWith = "-"
    ;

Posted by Community Admin on 14-Sep-2011 00:00

Hello Kmac,

In order to use this field in module definitions, you will have to implement a field definition config element and a field definition. To do this just override the MirrorTextFieldElement and MirrorTextFieldDefinition classes and add the extra properties from the multi mirror text field. You will also have to override the Configure method in MultiMirrorTextField to set the properties coming from the definition. Look at the UrlMirrorTextFieldElement, UrlMirrorTextFieldDefinition and UrlMirrorTextField as a reference for your code.

Kind regards,
Ivan Pelovski
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

This thread is closed