Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Unable to see alternative form of bizform View modes: 
User avatar
Member
Member
matt-4hilton - 12/20/2010 3:06:37 AM
   
Unable to see alternative form of bizform
Hi all,

While my last question that I posted yesterday still needs an answer, I tried doing things another way.

Just to recap, I have a cloned bizform web part called ShukiShuk_neighborhoodChecker. I've created a bizform for that webpart called ShukiShuk2, which displays two lables, each with accompanying text boxes, and a button.

I also have an alternative form for ShukiShuk2, called "WithoutFields" which only displays the button.

In the cloned webpart, I have a drop down. If the value of that drop down = "Other", I want the webpart to display the main form, otherwise I want it to display the alternative form.

Here's the code where I make that switch (viewBiz is the ID which I gave to the bizform):

if (neighborhoods.SelectedItem.Text == "Other")
{

viewBiz.AlternativeFormFullName = "ShukiShuk_neighborhoodChecker.shukiSplash2.WithoutFields";
viewBiz.BasicForm.SaveData("");
viewBiz.BasicForm.StopProcessing = true;

}

This is called in the SelectedIndexChanged event handler of the dropdown mentioned above. Unfortunately, when the page reloads, the alternative form does not display. All that displays is the "display text" which I configured in the ShukiShuk2 bizform for after the form is submitted.

How do I get the alternative bizform to display instead of that text. Or better yet, how do I keep the main bizform from submitting its data until the bizform button is pressed (either on the alternative form, or the main form)?

I appreciate your help.

User avatar
Member
Member
kentico_michal - 1/4/2011 4:01:06 AM
   
RE:Unable to see alternative form of bizform
Hi,

Changing alternative form name in SelectedIndexChanged event is too late in page cycle.
I would recommend you to try setting alternative form name in OnInit method of the BizForm web part. You can take the drop-down list selected value from viewstate:

Request.Params[viewBiz.UniqueID];

Moreover, you do no need to execute SaveData method or to set StopProcessing property to true.


Best regards,
Michal Legen