Package com.nexirius.jnex.example.command

Source Code of com.nexirius.jnex.example.command.SortPersonArrayCommand

package com.nexirius.jnex.example.command;

import com.nexirius.framework.htmlview.HTMLCommand;
import com.nexirius.framework.htmlview.HTMLSessionVariable;
import com.nexirius.framework.htmlview.DefaultHTMLCommand;
import com.nexirius.jnex.example.datamodel.MainModel;

public class SortPersonArrayCommand extends DefaultHTMLCommand {
    public boolean requiresMapping() {
        return false;
    }

    public boolean execute(HTMLSessionVariable sessionVariable) throws Exception {
        String attr = sessionVariable.getRequestParameter("sortAttribute");
        MainModel mainModel = (MainModel) sessionVariable.getApplicationModel();

        mainModel.getPersonArray().sortByAttribute(attr);

        return true;
    }


}
TOP

Related Classes of com.nexirius.jnex.example.command.SortPersonArrayCommand

TOP
Copyright © 2018 www.massapi.com. 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.