Package com.nexirius.jnex.example.datamodel

Examples of com.nexirius.jnex.example.datamodel.PersonModel


        //Here we define our possible states where the first argument is the name
        //of this state, the second is the corresponding model to render this state,
        //the third is true if the model should be editable in this state , and the fourth
        //argument is the name of the HTML-Template in the Stream-Map to render the model.
        HTMLState overviewState = new HTMLState("overview", homeModel, true, "overview");
        HTMLState newPersonState = new HTMLState("newPerson", new PersonModel(), true, "newPerson");
        HTMLState editPersonState = new HTMLState("editPerson", null, true, "editPerson");

        //Here we return an array of possible transitions between the HTML-States
        //where the first argument is the state we are at, the third argument is the state we
        //go to and the second argument is the name of the event that takes us there.
View Full Code Here


        return true;
    }
    //Method that defines that actual command and should return true if the transition
    //it could be mapped into should take place.
    public boolean execute(HTMLSessionVariable sessionVariable) throws Exception {
        PersonModel actualPerson = (PersonModel) sessionVariable.getActModel();

        if (actualPerson.isValid()) {
            DataModel item = actualPerson.duplicate(null, null);
            ((MainModel) sessionVariable.getApplicationModel()) .getPersonArray().sortInsert(item);

            actualPerson.clear();

            return true;
        }
        boolean flag = actualPerson.getFlag(ModelFlag.MANDATORY);
        System.out.println("flag = " + flag);
        return false;
    }
View Full Code Here

TOP

Related Classes of com.nexirius.jnex.example.datamodel.PersonModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.