I'm build a new authentication provider for DNN and I'd like to know if there's any custom attribute that can be applied to the property settings object that is bound to the PropertyEditorControl so that its label shows a different name from the one used on property.
For instance, suppose my classe has a property named ServiceId. Instead of showing that name, I'd like the PropertyEditorControl to show the string "Serv. Identification".
It seems like this can be done through resource files with predefined entries for each property you're interested in changing the label...
Related
I'm writing my custom property type for module 2sxc. I mean I'd added a js file inside my app at path "/system/field-string-my-custom-field/index.js" and I'm writing my code there.
And I need to get id (or guid) and entity type of a current edited/created entity in modal window. I didn't find neither id, nor guid of that entity. The only place I've noticed in the html inside iframe that could tell type of entity is title on top of modal window, but that's also not good to take it from there, since it's actually a label, not the name of the entity, which might be different from the actual entity name. When I checked the code that is executed on submit button click - it has object formBuilderRef, which contains all the listed data I need (current entity's id, guid, type). But I didn't succeed in accessing it from my code for now.
Additional info:
I'm creating a custom property like this one. So on editing entity with my custom property type there's this modal window. Modal image is from internet but it should be enough to get an idea.
iframe's src property contains EntityId, but it looks like a bad place to take id from, since it contains an id of the entity used to open modal window of 2sxc module, but I could go to app settings and start editing totally different entity that is not on a current page at all. So I need an id of that currently edited entity and correct type, not a label.
So how do I get the data I need from there?
You can get them on
context.target.entity.id and context.target.entity.guid
see also: https://docs.2sxc.org/js-code/edit-form/formulas/context.html
while developing formulas, it's best to also watch the console, because on test-runs it will output all relevant objects data and context to the console.
We have a block type in our EpiServer project that can have either specify a video to use (an EPiServer.Url) or a youtube id (string). The thing is that it only makes sense to use either of those, not both. Is there a way of marking one field readonly if the other is filled?
Not using vanilla editors, I'm afraid. But you could fairly easily create a custom editor (dojo widget) for that use case.
Here's an example of a custom editor to display a checkbox list for selecting blocks, instead of the standard editor for ContentArea properties:
https://tedgustaf.com/blog/2016/create-a-custom-editor-for-a-content-area-in-episerver/
However, the same principles apply for any content type.
To be clear: you don't need a custom property type, just a custom editor. The backing property type could still be string, which would contain either the URL or the YouTube ID.
If you want the property to be more developer-friendly, you could create a block type with "YouTube ID" and "URL" properties, and then define a content property of that block type.
You would then use your custom editor to set either the "YouTube ID" or "URL" property of that "VideoBlock" property.
We have created a similar editor before, where the editor would either select a video using a dropdown, or specify a custom video stream URL.
I have created a custom control with new dependency property (TagToSet) of type MyTag(id, name, value).
After adding this control to my window design, and going to the properties to set the value of the new dependency property. Here I want to open a dialog to select the Tag that I want (like the case when the dependency property is collection).
note: the Tag property is not a collection, and the required dialog should connect to a WCF service to list the available tag.
Thanks
Ok, here is the start key Microsoft.Windows.Design.PropertyEditing
for those who are trying to do like me read this
article
In my application's viewport i'm showing the form panel with a list of fields in center region and property-grid in east region.
I need to show the list of properties of the field in the property-grid on selection of the field.
The user is able to change the properties.
Now my requirement is to apply the properties dynamically to the field.
Is there any generic way to achieve this?
Can someone help me?
Some properties have getter and setter functions, but not all of them and I doubt they are consistent enough for what you are trying to do.
My suggestion would be to store the config object for each field, the config object would have each property that you want to be able to change using your property grid. When a property changes, remove the field from the form. Re-create it using Ext.create and passing your config object as the second parameter. Then just insert the object back into the form.
EDIT: You can probably skip using Ext.create by using the insert function on your form panel, it seems to be able to accept a config object directly.
In my JSPX page, I created a search page by drag-n-dropping the View Criteria (VC) to the page. By default the component's are text box. What I want to do is change some of them to use other components, such as the selectOneChoice component, with binding from another Entity Object (EO), or maybe add a date picker to it.
Is this possible? Or do I have to stick with the defaults?
This is all stuff that can be done in your view object under Attributes. For date attributes, make sure that the type is set to date. I've'nt done this one but for the selectOneChoice component, I'm assuming you can define a list of values on the desired attribute that is based on another view object. Also look in the Control Type field of the Control Hints when you edit an attribute. If you are using bind variable with your search I believe you can define these properties there also.