How to do in WizzardPager, build a Fragment according to the user's choice?

0

I'm using WizzardPager based on this here . But what I want is basically the user chooses the sex of the person, and goes to another screen of the WizzardPager where in this, will choose the ethnicity of her, according to the choice of sex. For example: if the gender choice was "Male", the ethnicity options will be "black", "brown", "Caucasian"; if you chose "Feminine" sex, the ethnicity options will be "black," "brown," "caucasian."

But the sex screen appears normally, and selects a gender, but does not go to the screen corresponding to the choice of sex, does not appear. Is there an alternative, as I'm using BranchPage from WizzardPager ?

    
asked by anonymous 30.12.2015 / 20:46

1 answer

1

Take a look at the WizardPager sample project: link .

It has a class that calls SandwichWizardModel , which contains the entire Wizard options tree.

I made some modifications and I was able to reproduce your case:

// ...

@Override
protected PageList onNewRootPageList() {
    return new PageList(new BranchPage(this, "Sexo")
            .addBranch("Masculino",
                    new SingleFixedChoicePage(this, "Etnia")
                            .setChoices("Negro", "Pardo", "Caucasiano")
                            .setRequired(true))
            .addBranch("Feminino",
                    new SingleFixedChoicePage(this, "Etnia")
                            .setChoices("Negra", "Parda", "Caucasiana")
                            .setRequired(true))
    );
}

// ...

Just to know, the options for female sex was anyway? Because in your question they were the same as the male.

    
02.01.2016 / 19:28