ASPX templates
Version 5.x > ASPX templates > Specifying an alternate bizform from a BizForm control View modes: 
User avatar
Member
Member
evanmcd - 3/8/2010 11:01:40 AM
   
Specifying an alternate bizform from a BizForm control
Hi, I have a BizForm (named DictionaryItems) for which I've specified an alternate form (named DictionaryItemFormPublic). However, I've not having any luck specifying the alternate form from a CMS control. This works :

<cms:BizForm ID="bizFormDictionary" FormMode="Insert" FormName="DictionaryItems" UseColonBehindLabel="false" runat="server" />

But this doesn't:

<cms:BizForm ID="bizFormDictionary" FormMode="Insert" FormName="DictionaryItems.DictionaryItemFormPublic" UseColonBehindLabel="false" runat="server" />

I've also tried a bunch of other options for FormName, but haven't found one that works.

Thanks for any help.

Evan

User avatar
Member
Member
evanmcd - 3/9/2010 3:15:45 PM
   
RE:Specifying an alternate bizform from a BizForm control
Funny that the reply I got in my email didn't show up here.

Here it is for anyone following the full thread.

Hello. So, you want to use a bizform as inline control and call it with alternativeform property? If so, this is not support by default, but you can modify code-behind of bizform inline control in <solution>\CMSModules\Bizforms\InlineControls\BizFormControl.ascx.cs and add this property here: public string AlternativeFormFullName { get { return ValidationHelper.GetString(this.GetValue("AlternativeFormFullName"), null); } set { this.SetValue("AlternativeFormFullName", value); this.Bizform1.AlternativeFormFullName = value; } }

Then you can use this macro to put that inline control on your page together with requested parameter: {^controlname|(property1)value1|(property2)value2|...^}

In code-behind of \CMSModules\BizForms\InlineControls\BizFormControl.ascx.cs, please make sure that your SetupControl() method looks like: protected void SetupControl() { this.Bizform1.FormName = this.FormName; this.Bizform1.AlternativeFormFullName = this.AlternativeFormFullName; }

When you call that bizform with alternative form on it, you need to use full path, since Alternative form full name = (ClassName.AlternativeFormName).

So, you need to call it classnameOfYourBizform.AlternativeFormName.

For default ContantUs bizform, the classname is bizform.ContantUs. So, I am calling it this way: {^BizFormControl|(FormName)ContactUs|(AlternativeFormFullName)bizform.ContactUs.Test^}

Best Regards, Radek Macalik

User avatar
Member
Member
evanmcd - 3/9/2010 3:18:22 PM
   
RE:Specifying an alternate bizform from a BizForm control
Hi Radek,

Thanks for the response. I'm referencing the BizForm not as an inline control, but as a User Control from an ASPX template.

How would I reference it given that setup?

Thanks

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 3/11/2010 2:16:42 AM
   
RE:Specifying an alternate bizform from a BizForm control
Hello,

The FormName property specify the BizForm name (as "ContactUs"). You can choose the alternative form by this property: AlternativeFormFullName.

Please note that the format of this property is <class name>.<alternative form name>, for example: CMS.User.DisplayProfile

Best regards,
Helena Grulichova


User avatar
Member
Member
evanmcd - 3/15/2010 1:58:01 PM
   
RE:Specifying an alternate bizform from a BizForm control
Hi Helena,

Thanks for that. However, using the AlternativeFormFullName property I'm not able to get any result.

Again, I have an alternate form in a bizform. I've tried referencing a CMS.BizForms.AlternateFormName, CMS.BizForm.AlternateFormName, BizForms.AlternateFormName

I don't get an error, just nothing rendered for the form. Is there a reference for deriving full class paths from web parts?

Thanks.

User avatar
Kentico Support
Kentico Support
kentico_radekm - 3/16/2010 10:36:01 AM
   
RE:Specifying an alternate bizform from a BizForm control
Hello.

My e-mail you have mentioned above was for case if you want to use it as inline control. If you want to use it on aspx page template, please see example for default Corporate site ASPX web site and bizform page.

I am using following bizform on my page with following "AlternativeFormFullName" property: <cms:BizForm runat="server" ID="BizForm" FormName="ContactUsASPXForm" EnableViewState="false" AlternativeFormFullName="BizForm.ContactUsASPXForm.test"/>

BizForm is className (and also ID of this particular bizform), ContactUsASPXForm is codename of particular bizform defined under CMSDesk -> Tools -> BizForms and test is code name of my alternative form.

Could you please set it according to this example? Thank you.

Best Regards,
Radek Macalik