Reputation: 2573
I have been using Kentico without issue for a while until today, here is my issue
I want to use Custom table in uniselector.
How I came into the issue was, I need to use Custom Form Controls, like in SiteManager->Users Advanced filter. We have Add Roles which opens a popup and it shows list of all roles.
This webpart uses Uniselector
<cms:CMSUpdatePanel ID="pnlUpdate" runat="server">
<ContentTemplate>
<cms:UniSelector ObjectType="cms.role" SelectionMode="MultipleTextBox"
OrderBy="RoleDisplayName" ResourcePrefix="roleselect" runat="server"
ID="usRoles" ShortID="s" AllowEditTextBox="true" AddGlobalObjectSuffix="true" />
</ContentTemplate>
</cms:CMSUpdatePanel>
Now if I use
ObjectType="cms.role"
it works fine because it is system table
now if I use
ObjectType="customtable.country"
This will not work
Any help is appreciated. Thanks in advance.
Upvotes: 3
Views: 3173
Reputation: 7696
Since version 7 you can use:
ObjectType="customtableitem.namespace.customtable"
it would be
ObjectType="customtableitem.customtable.SampleTable"
for Sample custom table (from Corporate sample site).
Feel free to contact me if you have any other questions.
Upvotes: 10
Reputation: 482
we have changed uniselector.ascx, keeping in mind that kentico can overwrite it when it gets updated use this CMSAdminControls
I use this approach and get success Created new pages as
Change method Loadobject as give url ~/CMSAdminControls/Mycustomcontrol/CustomSelectionDialog.aspx
than change LoadControls() method in CustomSelectionDialog.ascx.cs
CMSObjectHelper.GetObject() method not get data from custom table so added new method for fetching data from custom table
Upvotes: 0
Reputation: 19
Unfortunately, UniSelector requires Kentico object types by design and it does not work for custom tables.
However, there are basically three possible workarounds:
Upvotes: 1