@Override protected void writeErrorSummary( FacesContext context, ResponseWriter w, FormLayout c, ComputedFormData formData) throws IOException { if (!c.isDisableErrorSummary()) { // Should we apply a filter to retain only the message belonging to the controls within the // form? // Easy enough with a FilteredIterator Iterator<FacesMessage> msg = ((DominoFacesContext) context).getMessages(); if (msg.hasNext()) { String id = c.getClientId(context) + NamingContainer.SEPARATOR_CHAR + "popup"; // $NON-NLS-1$ String shadeId = c.getClientId(context) + NamingContainer.SEPARATOR_CHAR + "shade"; // $NON-NLS-1$ writeErrorSummaryShade(context, w, c, shadeId); // TODO: make the addition of js to the component a separate function // center the error dialog on the screen StringBuilder b = new StringBuilder(); b.append("XSP.addOnLoad(function(){"); // $NON-NLS-1$ b.append("XSP.centerNode("); // $NON-NLS-1$ JavaScriptUtil.addString(b, id); b.append(");"); // $NON-NLS-1$ b.append("});"); // $NON-NLS-1$ String script = b.toString(); ExtLibUtil.addScript(context, script); w.startElement("div", c); // $NON-NLS-1$ String style = (String) getProperty(PROP_STYLEERRORSUMMARY); if (StringUtil.isNotEmpty(style)) { w.writeAttribute("style", style, null); // $NON-NLS-1$ } String cls = (String) getProperty(PROP_STYLECLASSERRORSUMMARY); if (StringUtil.isNotEmpty(cls)) { w.writeAttribute("class", cls, null); // $NON-NLS-1$ } if (StringUtil.isNotEmpty(id)) { w.writeAttribute("id", id, null); // $NON-NLS-1$ } writeErrorSummaryContent(context, w, c, msg); writeErrorSummaryButton(context, w, c, id, shadeId); w.endElement("div"); // $NON-NLS-1$ } } }
@Override protected void writeFormLayout(FacesContext context, ResponseWriter w, FormLayout c) throws IOException { ComputedFormData formData = createFormData(context, c); String style = c.getStyle(); String styleClass = c.getStyleClass(); w.startElement("div", c); // $NON-NLS-1$ String styleProp = (String) getProperty(PROP_FORMCONTAINERSTYLE); if (StringUtil.isNotEmpty(styleProp)) { style = ExtLibUtil.concatStyles(style, styleProp); } if (!StringUtil.isEmpty(style)) { w.writeAttribute("style", style, null); // $NON-NLS-1$ } String styleClassProp = (String) getProperty(PROP_FORMCONTAINERSTYLECLASS); if (StringUtil.isNotEmpty(styleClassProp)) { styleClass = ExtLibUtil.concatStyleClasses(styleClass, styleClassProp); } if (!StringUtil.isEmpty(styleClass)) { w.writeAttribute("class", styleClass, null); // $NON-NLS-1$ } w.writeAttribute("id", c.getClientId(context), null); // $NON-NLS-1$ newLine(w); writeErrorSummary(context, w, c, formData); writeHeader( context, w, c); // TODO:this is sort of messed up in how it is placing its divs, needs to be fixed w.startElement("div", c); // $NON-NLS-1$ writeMainTableTag(context, w, c); newLine(w); writeForm(context, w, c, formData); w.endElement("div"); // $NON-NLS-1$ newLine(w); writeFooter(context, w, c); w.endElement("div"); // $NON-NLS-1$ newLine(w); }