Selectonemenu始终在数据库中保存相同的值

时间:2017-06-22 07:15:33

标签: spring primefaces

这是我的控制器! 控制器:

public void updateUserdocOrgScnd(RowEditEvent event){         尝试{             LOG.info(" \ n \ n \ nINSIDE \ n CLASS == DocumentController \ n METHOD == updateUserdocOrgScnd();");

        Dmsuserdocorgscndry dmsuserdocorgscndry = (Dmsuserdocorgscndry) event.getObject();
        apexManagerService = ServiceManagerFactory.getServiceManager(getServletContext());
        final DocumentService documentService = apexManagerService.getDocumentService();
        DocumentBean documentBean = (DocumentBean) getControllerObject(ApexManagedBean.DOCUMENTBEAN.getName(),
                DocumentBean.class);

        if (dmsuserdocorgscndry.getUdostatus().equals("true")) {
            dmsuserdocorgscndry.setUdostatus("A");
        } else {
            dmsuserdocorgscndry.setUdostatus("I");
        }

        if (dmsuserdocorgscndry != null) {
            if (dmsuserdocorgscndry.getDoclevel().equals("C")) {
                dmsuserdocorgscndry.setDoclevel("C");
            } else if (dmsuserdocorgscndry.getDoclevel().equals("A")) {
                dmsuserdocorgscndry.setDoclevel("A");
            } else if (dmsuserdocorgscndry.getDoclevel().equals("P")) {
                dmsuserdocorgscndry.setDoclevel("P");
            } else if (dmsuserdocorgscndry.getDoclevel().equals("S")) {
                dmsuserdocorgscndry.setDoclevel("S");
            } else if (dmsuserdocorgscndry.getDoclevel().equals("U")) {
                dmsuserdocorgscndry.setDoclevel("U");
            } else if (dmsuserdocorgscndry.getDoclevel().equals("G")) {
                dmsuserdocorgscndry.setDoclevel("G");
            }

            documentBean.setDoclevelscndry(dmsuserdocorgscndry.getDoclevel());
        }

        dmsuserdocorgscndry = documentService.updateOrgScnd(dmsuserdocorgscndry);

        if (dmsuserdocorgscndry != null) {
            addMessageToFacesContext(SUCCESS_UPDATE);

        } else {
            addMessageToFacesContext(ERROR_UPDATE);
        }
    } catch (Exception ex) {
        LOG.error(ex.getMessage(), ex);
        addMessageToFacesContext(ERROR_UPDATE);
    }
    LOG.info("EXITING THIS METHOD \n\n\n");
}

0 个答案:

没有答案