[SalesForce] Create multiple screen inputs for one VisualForce page

In VisualFlow you can create multiple screens, as many as you like, but at the end it is considered one Flow, and when you create a website from the Flow, its only one website.

How can you create multiple screens for one VisualForce page?

I guess if i want to be more specific, the following opportunity wizard example:

http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_wizard.htm

Has three pages,
If i want to make this a public website,
Then i would need to host three pages instead of one,

So is it possible to host one website that refers to all three pages?

Best Answer

It really depends on what you are trying to accomplish.

The rendered tag can help a lot in these situations. Technically speaking it's all on one page, and you can show and hide sections using the below method. I think you could even use some javascript remoting, but if you're going to go that far then jQuery would probably be just as easy

For example though:

Visualforce:

<apex:page controller="testController">
    <apex:form >
        <apex:commandButton action="{!toggleText}" value="Toggle"/>
    </apex:form>
    <apex:outputText rendered="{!showText}" value="this is some test text"/>
</apex:page>

Controller:

public class testController {
    public void toggleText() {
        showText = !showText;
    }
    public Boolean showText { get; set; }
    public testController() {
        //set default
        this.showText = true;
    }
}

Also, the above is to show it can be done. You might want to handle the button using page references etc, as that's how it's meant to be done.

Related Topic