Package org.spw.model

Examples of org.spw.model.OptionValue


        // Perform application initialization that must complete
        // *after* managed components are initialized
        list = getSessionBean1().getOptionValueDataProvider();
        // initialize the option in session been
        if (getSessionBean1().getOptionValue() == null) {
            getSessionBean1().setOptionValue(new OptionValue());
            // get the first option to initialize
            String option = (String) optionNameDefaultOptions.
                    getOptions()[0].getValue();
            // set the option as current option
            getSessionBean1().getOptionValue().
View Full Code Here


        optionName.setSelected(event.getNewValue());
    }
   
    public String buttonAdd_action() {
        String option = getSessionBean1().getOptionValue().getOptionName();
        getSessionBean1().setOptionValue(new OptionValue());
        getSessionBean1().getOptionValue().setOptionName(
                option);
        return "new";
    }
View Full Code Here

   
    public String buttonDelete_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            OptionValueController  ctrl = new OptionValueController();
            OptionValue optionValue = (OptionValue)list.getObject(rk);
            ctrl.delete(optionValue);
        }
        list.refreshList((String) optionName.getSelected());

        return null;
View Full Code Here

    }
   
    public String buttonEdit_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            OptionValue optionValue = (OptionValue)list.getObject(rk);
            getSessionBean1().setOptionValue(optionValue);
        }
        return "edit";
    }
View Full Code Here

    }

    public String buttonAdd_action() {
        // Persist the new object
        OptionValueController ctrl = new OptionValueController();
        OptionValue object = getSessionBean1().getOptionValue();
        ctrl.create(object);
       
        return "success";
    }
View Full Code Here

    }

    public String buttonChange_action() {
        // Persist the new object
        OptionValueController ctrl = new OptionValueController();
        OptionValue object = getSessionBean1().getOptionValue();
        ctrl.update(object);
       
        return "success";
    }
View Full Code Here

    /**
     * Creates a new instance of OptionValueDataProvider
     */
    public OptionValueDataProvider() {
        // Put in dummy data for design time
        aList.add(new OptionValue());

        // Wrap the list
        setList(aList);       
    }
View Full Code Here

       
        String option = OptionValueController.CONTRACT_TYPES;;
        String key = "Full time";
        OptionValueController instance = new OptionValueController();
       
        OptionValue result = instance.getOptionValueByLabel(option, key);
        assertNotNull(result);
    }
View Full Code Here

     * @param key key of the option
     * @return The corresponding object
     */
    public OptionValue getOptionValueByLabel(String option, String key) {
        EntityManager em = emf.createEntityManager();
        OptionValue retValue = null;
        try {
            Query query = em.createNamedQuery("OptionValue.findByLabel");
            query.setParameter("name", option);
            query.setParameter("label", key);
            retValue = (OptionValue) query.getSingleResult();
View Full Code Here

        }
    }
   
    public OptionValue read(OptionValuePK key) {
        EntityManager em = emf.createEntityManager();
        OptionValue retValue = null;
        try {
            retValue = em.find(OptionValue.class, key);
        } catch (Exception e) {
            Logger.getLogger(OptionValueController.class.getName()).log(Level.SEVERE, "Error reading " + key, e);
        } finally {
View Full Code Here

TOP

Related Classes of org.spw.model.OptionValue

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.