Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHow to use <dnn:DnnFormEditor>How to use <dnn:DnnFormEditor>
Previous
 
Next
New Post
9/3/2012 1:23 AM
 
Wanted your help,

Can you point me to example as to how to use <dnn:DnnFormEditor>

I simply tried 


<dnn:DnnFormEditor id="extensionForm" runat="Server" FormMode="Short">
<Items>
<dnn:DnnFormTextBoxItem ID="extensionName" runat="server" DataField="Name" Required="true" />
<dnn:DnnFormTextBoxItem ID="extensionFriendlyName" runat="server" DataField="FriendlyName" Required="true" />
<dnn:DnnFormTextBoxItem ID="description" runat="server" DataField="Description" />
<dnn:DnnFormEditControlItem ID="version" runat="server" DataField="Version" 
ControlType="DotNetNuke.UI.WebControls.VersionEditControl, DotNetNuke"/>
</Items>
</dnn:DnnFormEditor>

but it nothing is shown on the page frown

Please help
 
New Post
9/8/2012 1:08 AM
 
I have never seen this control before but I looked at it now.
From reading the file /DesktopModules/Admin/Security/Membership.ascx.cs

It seems that you have to bind an object to that control.
In your case:
protected void Page_Load(object sender, EventArgs e)
{
DotNetNuke.Services.Installer.Packages.PackageInfo Package = new DotNetNuke.Services.Installer.Packages.PackageInfo();
extensionForm.DataSource = Package;
if (!IsPostBack)
{
extensionForm.DataBind();
}
}

Then when someone hits the update button, they get the object back:

DotNetNuke.Services.Installer.Packages.PackageInfo Package = extensionForm.DataSource as DotNetNuke.Services.Installer.Packages.PackageInfo;

And then run insert statements. You could probably load an existing object from the database and bind that to the form too then run update.

Hristo Evtimov
www.packflash.com
 
New Post
9/8/2012 1:18 AM
 

Right,

but can we change the TextBox to DropDownList ?

What about the other functionality? (I can see that we can make it Required but what about other Validators? how to use them ?

I expect some great examples if possible

 
New Post
9/8/2012 10:45 AM
 
For validation you could use a regular expression like so:

<dnn:DnnFormTextBoxItem ID="extensionName" runat="server" DataField="Name" Required="true" ValidationExpression="[a-zA-Z]*" />

I had problems getting the combo box to work.
I added the following to the initial form you had:

<dnn:DnnFormComboBoxItem ID="email" runat="server" DataField="Email" ListTextField="Email" ListValueField="Email"></dnn:DnnFormComboBoxItem>

and then tried to bind that form in the code-behind:
foreach (DnnFormItemBase formItem in extensionForm.Items)
{
if (formItem.ID == "email")
{
((DnnFormComboBoxItem)formItem).ListSource = UserController.GetUsers(0);
if (!IsPostBack)
{
((DnnFormComboBoxItem)formItem).DataBind();
}
break;
}
}

All that works but I was not able to get the value of the drop down once someone clicks the update button. Value is always null. Maybe someone can help with this.

Hristo Evtimov
www.packflash.com
 
New Post
9/9/2012 1:39 PM
 
Hristo Evtimov wrote:
For validation you could use a regular expression like so:



I had problems getting the combo box to work.
I added the following to the initial form you had:



and then tried to bind that form in the code-behind:
foreach (DnnFormItemBase formItem in extensionForm.Items)
{
if (formItem.ID == "email")
{
((DnnFormComboBoxItem)formItem).ListSource = UserController.GetUsers(0);
if (!IsPostBack)
{
((DnnFormComboBoxItem)formItem).DataBind();
}
break;
}
}

All that works but I was not able to get the value of the drop down once someone clicks the update button. Value is always null. Maybe someone can help with this.

 Hi Hristo Evtimov

Thanks for all the help.

Can you please send me the testing-work that you done at indianguru [at] bhattji.com ?


 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHow to use <dnn:DnnFormEditor>How to use <dnn:DnnFormEditor>


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out