How to do in Wizzardpager, build a Fragment according to user’s choice?

Asked

Viewed 44 times

0

I’m using the Wizzardpager based on this here. But what I want is basically the user chooses the sex of the person, and passes to another screen of Wizzardpager where in this, will choose her ethnicity, 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 gender "Female", the ethnicity options will be "black", "brown", "Caucasian".

But the sex screen appears normally, and selects a gender, but does not pass to the screen corresponding to the choice of sex, does not appear. There is an alternative, because I’m using Branchpage from Wizzardpager?

1 answer

1


Take a look at the sample Wizardpager project: https://github.com/TechFreak/WizardPager/tree/master/sample.

In it has a class that calls SandwichWizardModel, which contains all the Wizard options tree.

I made some modifications and managed 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 so you know, were the options for female sex the same? Because in your question they were the same as male.

  • Thanks for the answer, you helped my problem

Browser other questions tagged

You are not signed in. Login or sign up in order to post.