Portal Engine
Version 3.x > Portal Engine > FormEngine in custom module View modes: 
User avatar
Member
Member
Geert - 9/23/2008 4:17:45 AM
   
FormEngine in custom module
Hello,

I am trying to use the formengine in a custom module like this:

<cms:FormEngineUserControl runat="server" ID="formEngine" />

The DataDR property seems likely to accept the data in the form of a datarow. This datarow should have information on the correct document type class so I create a treenode:

CMS.TreeEngine.TreeNode node = new CMS.TreeEngine.TreeNode("xx.y");

And tried to use the DataRow property from this node as a value for the formEngine control. This action gives me an exception:

Type 'System.Data.DataRow' in Assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.

Could someone point me in the right direction to create a document type based form using the build in form engine?

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 9/24/2008 11:52:46 AM
   
RE:FormEngine in custom module
Hi Geert,

The FormEngineUserControl cannot be used this way. You could use DataForm or CMSForm for the document-type based form in a construction like this below:

<cms:DataForm ID="formMyCustom" runat="server" ClassName="cms.mydocument" />

You could also use CMSForm (creation and editing of documents, adds publish from/to fields, uploaded files stored in DB and/or file system as attachments) instead of DataForm (common form control to edit the data, uploaded files stored in file system).

Best Regards,
Zdenek Cetkovsky

User avatar
Member
Member
Geert - 9/25/2008 1:41:35 AM
   
RE:FormEngine in custom module
How do I use these controls for insert and update actions?

User avatar
Member
Member
Geert - 9/25/2008 4:29:42 AM
   
RE:FormEngine in custom module
I found an example and the DataForm now automaticaly loads the node data. I was giving it the node id, but it requires an id from the custom class record.

User avatar
Certified Developer v7
Certified  Developer v7
kenticonewbie - 6/11/2009 11:13:34 AM
   
RE:FormEngine in custom module
Can you show me the url of the example you found?

User avatar
Kentico Developer
Kentico Developer
kentico_zbysekn - 6/29/2009 3:40:02 AM
   
RE:FormEngine in custom module
Hi,
you can take inspiration for example in code we are using. Examples of using cms:DataForm control are located at :

~\CMSModules\Ecommerce\Content\Product\Product_Edit_XX.aspx.cs

example of using cms:CMSForm is located at ~\CMSAdminControls\UserContributions\EditForm.aspx and related code file.
Best Regards,
Zbysek Nemec.