Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > How are BizForm "macros" resolved View modes: 
User avatar
Member
Member
paul - 1/27/2010 8:19:30 AM
   
How are BizForm "macros" resolved
I've created my own version of a repeater control that uses

CMSAbstractDataProperties.LoadTransformation(this, Transformation, false);

To load the correct transformation.

This is working nicely but one thing we are seeing is that BizForm expressions are not being parsed correctly. The user entered:

control:BizFormControl?contactForm
(surrounded by 2 percent signs at each side, your forums do process the syntax which is why I can't enter the syntax literally because the post will say "Required form 'contactForm' does not exist." :-)

And it just gets displayed like this on the web page. It seems these are not actually macros, because running CMSContext.CurrentResolved.ResolveMacros on the expression doesn't work either.

My question: what method do I call to make sure the expression gets transformed into an acutal form. Also: where do you recommed calling this method in the ASP.NET lifecyle?

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 1/28/2010 4:23:07 AM
   
RE:How are BizForm "macros" resolved
Hello,


you may use the method:

ControlsHelper.ResolveDynamicControls(Panel or Control)

You could add this code into Page_Init or Page_PreInit method


Best regards,
Helena Grulichova

User avatar
Member
Member
paul - 1/29/2010 5:04:29 AM
   
RE:How are BizForm "macros" resolved
Thanks Helena. A call to ControlsHelper.ResolveDynamicControls did the trick. I ended up putting the call in OnContentLoaded because (Pre)Init is too soon for what I'm doing. I get the feeling many of the controls in Kentico don't follow the best-practices around page lifecycle management but luckily I haven't run into any problems that I wasn't able to fix yet.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 2/1/2010 6:04:44 AM
   
RE:How are BizForm "macros" resolved
Hi,

You are right with the life cycle, but portal engine development model is very complex system and in some cases we had to modify the life cycle so it will fit to this approach of web site development. We are sorry for this inconvenience.

Best Regards,
Juraj Ondrus