Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h:outputText value="Add a Source System:"> </h:outputText><h:outputText value="*"
- styleClass="errors"></h:outputText>
- <h:inputText label="New Source System" id="NewSource"
- value="#{intakeParametersMBean.newSourceSystemName}"
- required="true">
- <f:validateLength minimum="1" maximum="50" />
- </h:inputText> <h:outputText value=" " />
- <h:outputText value=" " /> <h:outputText value=" " /></td>
- <a4j:commandButton id="save"
- value="Submit"
- action="#{intakeParametersMBean.addNewSourceSystem}"
- oncomplete="if (!ajaxRequestContainsErrors()) #{rich:component('addpopup')}.hide(); return false;">
- </a4j:commandButton> <h:outputText value=" " /> <h:outputText value=" " />
- <h:commandButton value="Cancel"
- onclick="#{rich:component('addpopup')}.hide(); return false;">
- </h:commandButton></td>
- ConfigType config = new ConfigType();
- config.setConfigDescription(newSourceSystemDesc);
- config.setConfigName(newSourceSystemName);
- config.setConfigType(ConfigTypeEnum.DATA_SRC.getType());
- config.setConfigStatus(true);
- FacesContext context = FacesContext.getCurrentInstance();
- String viewId = context.getViewRoot().getViewId();
- ViewHandler handler = context.getApplication().getViewHandler();
- UIViewRoot root = handler.createView(context, viewId);
- try {
- ipService.addNewConfigType(config);
- // Set the list to null so it can be reloaded
- errormessages = "";
- this.setConfigTypeList(null);
- } catch (Exception e1) {
- if (e1 instanceof ConstraintViolationException){
- context.addMessage(null,
- new FacesMessage(FacesMessage.SEVERITY_ERROR,
- "Source System Name Exists", "This will not allow to add new souce system"));
- errormessages = "Source System Name Exists";
- }
- }
- function ajaxRequestContainsErrors() {
- return document.getElementById("maximumSeverity").value >= 2;
- }
Add Comment
Please, Sign In to add comment