Is it possible to create my own AddinParameterEditor Control?
If so, any documentation on this anywhere?
Is it possible to create my own AddinParameterEditor Control?
If so, any documentation on this anywhere?
Hi John,
Maybe this link can help you: https://doc.dynamicweb.dev/documentation/extending/extensibilitypoints/configurable-addins.html
However, you’re limited to the editors that are already available. What exactly is it that you’re missing?
BR Rasmus Sanggaard
Hi John
That is not possible.
What are you trying to build - we might have another editor you can use or extend.
BR Nicolai
I wanted to create a filter control which can generate the correct filter string for BC, but it's hard because the addin provider gets re-instantiated on every update to the fields on the page... See attached of what I was trying to accomplish.
Hi John
Yes, I am afraid that is currently a little difficult right now. Each editor on a screen in DW10 can have "Reload on change" set - that triggers that the screen is doing a post back kind of round trip. Maybe you have that enabled somehow?
We do have a control that can make a list like the one you have - looks like this:
[AddInParameterGroup("Notification e-mails")]
[AddInParameter("NotificationMails"), AddInLabel("Notification e-mails"), AddInParameterEditor(typeof(EditableList), $"LabelProperty={nameof(MailInfo.Subject)};")]
public List<MailInfo> NotificationMails { get; set; } = new();
And in this case the MailInfo (which is the listed object) looks like this:
public sealed class MailInfo
{
/// <summary>
/// The recipient
/// </summary>
public string Recipient { get; set; } = "";
/// <summary>
/// The subject
/// </summary>
public string Subject { get; set; } = "";
/// <summary>
/// The template
/// </summary>
public string Template { get; set; } = "";
/// <summary>
/// The template path
/// </summary>
public string TemplatePath { get; set; } = "";
/// <summary>
/// The template path
/// </summary>
public string RedirectType { get; set; } = "Template";
/// <summary>
/// The template path
/// </summary>
public string RedirectPage { get; set; } = "";
/// <summary>
/// The Id of the page selected as notification template
/// </summary>
public int RedirectPageId { get; set; }
/// <summary>
/// The sender name
/// </summary>
public string SenderName { get; set; } = "";
/// <summary>
/// The sender mail
/// </summary>
public string SenderMail { get; set; } = "";
/// <summary>
/// The is customer
/// </summary>
public bool IsCustomer { get; set; }
/// <summary>
/// The is delivery
/// </summary>
public bool IsDelivery { get; set; }
/// <summary>
/// The encoding code page
/// </summary>
public int EncodingCodePage { get; set; } = Encoding.UTF8.CodePage;
/// <summary>
/// The attachment
/// </summary>
public string Attachment { get; set; } = "";
/// <summary>
/// The attachment path
/// </summary>
public string AttachmentPath { get; set; } = "";
/// <summary>
/// Use order or user field for email address
/// </summary>
public bool IsCustomField { get; set; }
/// <summary>
/// The order or user field for email address to send to
/// </summary>
public string RecipientCustomField { get; set; } = "";
}
Feel free to provide all of your code - then we can have a look.
BR Nicolai
Thanks Nicolai, I looked at this, but it's fixed. I need something which can add fields dynamically.
I'm still very new to the platform, so it could be something I'm doing, but here are a couple of other issues I'm having:
- There is no way to clear the CheckListParameterEditor it tried to populate the old selection when I load a new field list. I have tried every way to clear it, but it doesn't work.
- In the function GetHiddenParameterNames the Dropdown parameter will sometime be the last selection, not the current one.
- The sorting by key does SQL sorting, so I have to pad all my keys with zeros to be able to sort correctly by field number.
I will email you a dropbox link to my current code.
You must be logged in to post in the forum