+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / Custom module backend insert view doesn't show the toolbar

Custom module backend insert view doesn't show the toolbar

16 posts, 2 answered
  1. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    16 Feb 2011
    Link to this post
    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
  2. jocelyn payneau
    jocelyn payneau avatar
    51 posts
    Registered:
    07 Dec 2009
    17 Feb 2011
    Link to this post
    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
  3. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    17 Feb 2011
    Link to this post
    Hi Joeclyn,

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

    Thanks!
    Duneel
  4. jocelyn payneau
    jocelyn payneau avatar
    51 posts
    Registered:
    07 Dec 2009
    17 Feb 2011
    Link to this post
    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
  5. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    17 Feb 2011
    Link to this post
    Thanks Joeclyn!

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

    Thanks,
    Duneel
  6. Ivan Pelovski
    Ivan Pelovski avatar
    43 posts
    Registered:
    24 Sep 2012
    21 Feb 2011
    Link to this post
    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
    Answered
  7. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    22 Feb 2011
    Link to this post
    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
  8. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    22 Feb 2011
    Link to this post
    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
  9. Ivan Pelovski
    Ivan Pelovski avatar
    43 posts
    Registered:
    24 Sep 2012
    23 Feb 2011
    Link to this post
    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!
    Answered
  10. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    23 Feb 2011
    Link to this post
    Thanks Ivan P! It resolved the my issue. I set the MirroredControlId to another field in my module.
  11. KMac
    KMac avatar
    133 posts
    Registered:
    15 Dec 2008
    02 Sep 2011
    Link to this post
    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.
  12. Ivan Pelovski
    Ivan Pelovski avatar
    43 posts
    Registered:
    24 Sep 2012
    07 Sep 2011
    Link to this post
    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 >>

  13. KMac
    KMac avatar
    133 posts
    Registered:
    15 Dec 2008
    07 Sep 2011
    Link to this post
    Thanks Ivan,

    Do you happen to have some sample code to get started? I'm not sure where to begin.
  14. Ivan Pelovski
    Ivan Pelovski avatar
    43 posts
    Registered:
    24 Sep 2012
    13 Sep 2011
    Link to this post
    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 >>

  15. KMac
    KMac avatar
    133 posts
    Registered:
    15 Dec 2008
    14 Sep 2011
    Link to this post
    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 = "-"
        };
  16. Ivan Pelovski
    Ivan Pelovski avatar
    43 posts
    Registered:
    24 Sep 2012
    14 Sep 2011
    Link to this post
    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 >>

16 posts, 2 answered