/*
处理renderType
gridCompColumn对象，index为第几列
begin为起始行，length为行数（增加行数时使用）
550719
function(gridCompColumn,i,begin,length, isFixedColumn){
			var oThis = this,renderType = gridCompColumn.options.renderType,
				sumCol = gridCompColumn.options.sumCol,
				sumRenderType = gridCompColumn.options.sumRenderType,
				dataType = gridCompColumn.options.dataType,
				precision = gridCompColumn.options.precision,
				format = gridCompColumn.options.format,field = gridCompColumn.options.field,
				end = begin,idSuffix = isFixedColumn === true ? '_content_fixed_tbody' : '_content_tbody',
				idStr = isFixedColumn === true? 'fixed_' : '';
			if(length >0){
				end = parseInt(begin + length - 1);
			}
			this.realtimeTableRows = document.getElementById(oThis.options.id + idSuffix).children;
			// 记录role不是row的行
			var notRowIndex = -1;
			for(var k = 0;k < oThis.realtimeTableRows.length;k++) {
				if(oThis.realtimeTableRows[k].getAttribute("role") != "row") {
					notRowIndex = k
				}
			}
			$.each(oThis.dataSourceObj.rows, function(j) {
				if((begin >= 0 && j >= begin && j <= end) || isNaN(begin)){
					var trIndex = j;
					if(notRowIndex != -1 && j >= notRowIndex) {
						trIndex++;
					}
					var tr = oThis.realtimeTableRows[trIndex],td = tr.children[i];
					if(td){
						if(td.children[0].innerHTML.indexOf('u-grid-content-tree-span')   !=  -1){
							var span =  td.children[0].children[1];
						}else{
							var span =  td.children[0];
						}
						if(span){
							var v = $(this.value).attr(field);
							if(typeof renderType == 'function' || dataType == 'Date' || dataType == 'Datetime' || dataType == 'Int' || dataType == 'Float'){
								span.innerHTML = '';
								if(typeof renderType == 'function'){
									v = oThis.getString(v,'');
									var obj = {};
									obj.value = v;
									obj.element = span;
									obj.gridObj = oThis;
									obj.row = this;
									obj.gridCompColumn = gridCompColumn;
									obj.rowIndex = j;
									renderType.call(oThis,obj);
								}else if(dataType == 'Date' || dataType == 'Datetime'){
									if(v == null || v == undefined || v == 'null' || v == 'undefined' || v == ""){
										v = "";
									}
									if (dataType == 'Date'){
										v = u.dateRender(v);
									}else{
										v = u.dateTimeRender(v);
									}
									span.innerHTML = v;
									td.title = v;
								}else if(dataType == 'Int'){
									v = parseInt(v);
									span.innerHTML = v;
									td.title = v;
								}else if(dataType == 'Float'){
									if(precision){
										var o = {};
										o.value = v;
										o.precision = precision;
										v = oThis.DicimalFormater(o);
									}else{
										v = parseFloat(v);
									}
									span.innerHTML = v;
									td.title = v;
								}else{ //此处逻辑放到渲染处，减少render执行次数。
									v = oThis.getString(v,'');
									var v1 = v.replace(/\</g,'\<');
									v1 = v1.replace(/\>/g,'\>');
									td.title = v;
									v = v.replace(/\</g,'&lt;');
									v = v.replace(/\>/g,'&gt;');

									span.innerHTML = v;
								}
							}else{
								v = oThis.getString(v,'');
								var v1 = v.replace(/\</g,'\<');
								v1 = v1.replace(/\>/g,'\>');
								td.title = v;
								v = v.replace(/\</g,'&lt;');
								v = v.replace(/\>/g,'&gt;');

								span.innerHTML = v;
							}
						}

					}
				}
			});
			this.renderTypeSumRow(gridCompColumn,i,begin,length, isFixedColumn);
		}
185669
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WDefinitionList list = (WDefinitionList) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("ui:definitionlist");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");

		switch (list.getType()) {
			case FLAT:
				xml.appendAttribute("type", "flat");
				break;

			case COLUMN:
				xml.appendAttribute("type", "column");
				break;

			case STACKED:
				xml.appendAttribute("type", "stacked");
				break;

			case NORMAL:
				break;

			default:
				throw new SystemException("Unknown layout type: " + list.getType());
		}

		xml.appendClose();

		// Render margin
		MarginRendererUtil.renderMargin(list, renderContext);

		for (Duplet<String, ArrayList<WComponent>> term : list.getTerms()) {
			xml.appendTagOpen("ui:term");
			xml.appendAttribute("text", I18nUtilities.format(null, term.getFirst()));
			xml.appendClose();

			for (WComponent data : term.getSecond()) {
				xml.appendTag("ui:data");
				data.paint(renderContext);
				xml.appendEndTag("ui:data");
			}

			xml.appendEndTag("ui:term");
		}

		xml.appendEndTag("ui:definitionlist");
	}
19215
protected function renderFilterCellContent()
    {
        if (is_string($this->filter)) {
            echo $this->filter;
        } else {
            if ($this->filter !== false && $this->grid->filter !== null && $this->name !== null && strpos(
                    $this->name,
                    '.'
                ) === false
            ) {
                if ($this->filterInputOptions) {
                    $filterInputOptions = $this->filterInputOptions;
                    if (empty($filterInputOptions['id'])) {
                        $filterInputOptions['id'] = false;
                    }
                } else {
                    $filterInputOptions = array();
                }
                if (is_array($this->filter)) {
                    $filterInputOptions['prompt'] = '';
                    echo TbHtml::activeDropDownList(
                        $this->grid->filter,
                        $this->name,
                        $this->filter,
                        $filterInputOptions
                    );
                } else {
                    if ($this->filter === null) {
                        echo TbHtml::activeTextField($this->grid->filter, $this->name, $filterInputOptions);
                    }
                }
            } else {
                parent::renderFilterCellContent();
            }
        }
    }
559815
private int renderStructured() {
        if(LOGGER.isDebugEnabled() && _padContext != null)
            LOGGER.debug("\ncurrentIndex: " + _currentIndex + "\n" +
                    "checkMaxRepeat: " + _padContext.checkMaxRepeat(_currentIndex) + "\n" +
                    "checkMinRepeat: " + _padContext.checkMinRepeat(_currentIndex) + "\n");

        if(_renderState == INIT) {
            _renderState = HEADER;
            return EVAL_BODY_AGAIN;
        }

        if(_renderState == HEADER) {
            assert _renderedItems == 0;

            /* this would only happen if Pad.maxRepeat == 0 */
            if(_padContext != null && _padContext.checkMaxRepeat(_renderedItems)) {
                _renderState = FOOTER;
                return EVAL_BODY_AGAIN;
            }

            if(_currentItem == null && _ignoreNulls) {
                advanceToNonNullItem();

                /* no non-null item was found; render the footer */
                if(_currentItem == null) {
                    doPadding();
                    // render the header
                    _renderState = FOOTER;
                }
                /* non-null item found; it's not the 0th item; render it */
                else _renderState = ITEM;
            }
            /* 0th item is non-null; render it */
            else _renderState = ITEM;

            return EVAL_BODY_AGAIN;
        }

        if(_renderState == ITEM) {
            _renderedItems++;

            /* check that the maximum number of items to render has *not* been reached */
                if(_iterator.hasNext() && (_padContext == null || (_padContext != null && !_padContext.checkMaxRepeat(_renderedItems)))) {
                _currentIndex++;
                _currentItem = _iterator.next();

                if(_ignoreNulls && _currentItem == null) {
                    advanceToNonNullItem();

                    /* last item */
                    if(_currentItem == null) {
                        doPadding();

                        /* render the header */
                        _renderState = FOOTER;
                        return EVAL_BODY_AGAIN;
                    }
                }

                /* if _ignoreNulls is false, the _currentItem may be null here */
                return EVAL_BODY_AGAIN;
            }
            /*
             have finished rendering items for some reason:
              1) there isn't a next item
              2) reached the maximum number of items to render
              So:
              1) pad if necessary
              2) render the footer
             */
            else {
                doPadding();

                _renderState = FOOTER;
                return EVAL_BODY_AGAIN;
            }
        }

        if(_renderState == FOOTER) {
            _renderState = END;
            return SKIP_BODY;
        }

        return SKIP_BODY;
    }
383761
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WShuffler shuffler = (WShuffler) component;
		XmlStringBuilder xml = renderContext.getWriter();
		boolean readOnly = shuffler.isReadOnly();

		// Start tag
		xml.appendTagOpen("ui:shuffler");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", shuffler.isHidden(), "true");
		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			xml.appendOptionalAttribute("disabled", shuffler.isDisabled(), "true");
			xml.appendOptionalAttribute("toolTip", shuffler.getToolTip());
			xml.appendOptionalAttribute("accessibleText", shuffler.getAccessibleText());
			int rows = shuffler.getRows();
			xml.appendOptionalAttribute("rows", rows > 0, rows);
		}
		xml.appendClose();

		// Options
		List<?> options = shuffler.getOptions();

		if (options != null && !options.isEmpty()) {
			for (int i = 0; i < options.size(); i++) {
				String stringOption = String.valueOf(options.get(i));
				xml.appendTagOpen("ui:option");
				xml.appendAttribute("value", stringOption);
				xml.appendClose();
				xml.appendEscaped(stringOption);
				xml.appendEndTag("ui:option");
			}
		}

		if (!readOnly) {
			DiagnosticRenderUtil.renderDiagnostics(shuffler, renderContext);
		}
		// End tag
		xml.appendEndTag("ui:shuffler");
	}
485014
public function render()
	{
		/**
		 * Check whether datagrid has set some columns, initiated data source, etc
		 */
		if (!($this->dataModel instanceof DataModel)) {
			throw new DataGridException('You have to set a data source first.');
		}

		if (empty($this->columns)) {
			throw new DataGridException('You have to add at least one column.');
		}

		$template = $this->getTemplate();
		$template->setTranslator($this->getTranslator());

		/**
		 * Invoke possible events
		 */
		$this->onRender($this);

		/**
		 * Prepare data for rendering (datagrid may render just one item)
		 */
		$rows = [];

		if (!empty($this->redraw_item)) {
			$items = $this->dataModel->filterRow($this->redraw_item);
		} else {
			$items = Nette\Utils\Callback::invokeArgs(
				[$this->dataModel, 'filterData'],
				[
					$this->getPaginator(),
					$this->createSorting($this->sort, $this->sort_callback),
					$this->assembleFilters(),
				]
			);
		}

		$callback = $this->rowCallback ?: null;
		$hasGroupActionOnRows = false;

		foreach ($items as $item) {
			$rows[] = $row = new Row($this, $item, $this->getPrimaryKey());

			if (!$hasGroupActionOnRows && $row->hasGroupAction()) {
				$hasGroupActionOnRows = true;
			}

			if ($callback) {
				$callback($item, $row->getControl());
			}

			/**
			 * Walkaround for item snippet - snippet is the <tr> element and its class has to be also updated
			 */
			if (!empty($this->redraw_item)) {
				$this->getPresenter()->payload->_datagrid_redraw_item_class = $row->getControlClass();
				$this->getPresenter()->payload->_datagrid_redraw_item_id = $row->getId();
			}
		}

		if ($hasGroupActionOnRows) {
			$hasGroupActionOnRows = $this->hasGroupActions();
		}

		if ($this->isTreeView()) {
			$template->add('tree_view_has_children_column', $this->tree_view_has_children_column);
		}

		$template->rows = $rows;

		$template->columns = $this->getColumns();
		$template->actions = $this->actions;
		$template->exports = $this->exports;
		$template->filters = $this->filters;
		$template->toolbar_buttons = $this->toolbar_buttons;
		$template->aggregation_functions = $this->getAggregationFunctions();
		$template->multiple_aggregation_function = $this->getMultipleAggregationFunction();

		$template->filter_active = $this->isFilterActive();
		$template->original_template = $this->getOriginalTemplateFile();
		$template->icon_prefix = static::$icon_prefix;
		$template->icon_prefix = static::$icon_prefix;
		$template->items_detail = $this->items_detail;
		$template->columns_visibility = $this->getColumnsVisibility();
		$template->columnsSummary = $this->columnsSummary;

		$template->inlineEdit = $this->inlineEdit;
		$template->inlineAdd = $this->inlineAdd;

		$template->hasGroupActions = $this->hasGroupActions();
		$template->hasGroupActionOnRows = $hasGroupActionOnRows;

		/**
		 * Walkaround for Latte (does not know $form in snippet in {form} etc)
		 */
		$template->filter = $this['filter'];

		/**
		 * Set template file and render it
		 */
		$template->setFile($this->getTemplateFile());
		$template->render();
	}
325393
function renderTypeFun(obj) {
    if (!this.isGridShow()) return;
    if (typeof obj == 'undefined') {
        var begin = null,
            length = null,
            field = '';
    } else {
        var begin = typeof obj.begin == 'undefined' ? null : obj.begin,
            length = typeof obj.length == 'undefined' ? null : obj.length,
            field = typeof obj.field == 'undefined' ? '' : obj.field;
    }
    var oThis = this,
        begin = parseInt(begin),
        length = parseInt(length),
        end = begin;
    if (length > 0) {
        end = parseInt(begin + length - 1);
    }
    if (field == '') {
        if (this.gridCompColumnFixedArr) $.each(this.gridCompColumnFixedArr, function (i) {
            oThis.renderTypeByColumn(this, i, begin, length, true);
        });
        $.each(this.gridCompColumnArr, function (i) {
            oThis.renderTypeByColumn(this, i, begin, length, false);
        });
    } else {
        var rendered = false;
        if (this.gridCompColumnFixedArr) $.each(this.gridCompColumnFixedArr, function (i) {
            if (this.options.field == field) {
                oThis.renderTypeByColumn(this, i, begin, length, true);
                rendered = true;
                return;
            }
        });
        if (!rendered) $.each(this.gridCompColumnArr, function (i) {
            if (this.options.field == field) {
                oThis.renderTypeByColumn(this, i, begin, length, false);
                return;
            }
        });
    }
}
296341
function() {
            var n_components = 0;
            var componentRendered = _.bind(function() {
                n_components = n_components + 1;
                if (n_components >= this.countComponents) {
                    this.ready();
                }
            }, this);

            if (_.size(this.components) == 0) { this.ready(); return this; }

            var addComponent = _.bind(Q.fbind(function(component) {
                this.$("component[data-component='"+component.cid+"']").replaceWith(component.$el);
                component.defer(_.once(componentRendered));

                return Q.try(function() {
                    component.update();
                }).fail(function(err) {
                    logging.exception(err, "Error rendering component:");
                })
            }), this);

            _.each(this.components, function(value, cid) {
                if (_.isArray(value)) {
                    _.each(value, addComponent);
                } else {
                    addComponent(value);
                }
            });

            this.trigger("components:render");
            return this;
        }
544510
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WPanel panel = (WPanel) component;
		XmlStringBuilder xml = renderContext.getWriter();
		GridLayout layout = (GridLayout) panel.getLayout();
		Size hgap = layout.getHorizontalGap();
		String hgapString = hgap == null ? null : hgap.toString();
		Size vgap = layout.getVerticalGap();
		String vgapString = vgap == null ? null : vgap.toString();
		int rows = layout.getRows();
		int cols = layout.getCols();

		xml.appendTagOpen("ui:gridlayout");

		xml.appendAttribute("rows", rows > 0 ? String.valueOf(rows) : "0");
		xml.appendAttribute("cols", cols > 0 ? String.valueOf(cols) : "0");
		xml.appendOptionalAttribute("hgap", hgapString);
		xml.appendOptionalAttribute("vgap", vgapString);

		xml.appendClose();

		int size = panel.getChildCount();

		for (int i = 0; i < size; i++) {
			xml.appendTag("ui:cell");
			WComponent child = panel.getChildAt(i);
			child.paint(renderContext);
			xml.appendEndTag("ui:cell");
		}

		xml.appendEndTag("ui:gridlayout");
	}
1310837
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WPanel panel = (WPanel) component;
		XmlStringBuilder xml = renderContext.getWriter();
		FlowLayout layout = (FlowLayout) panel.getLayout();
		Size gap = layout.getSpace();
		String gapString = gap != null ? gap.toString() : null;
		FlowLayout.Alignment align = layout.getAlignment();

		xml.appendTagOpen("ui:flowlayout");

		switch (align) {
			case RIGHT: {
				xml.appendAttribute("align", "right");
				break;
			}
			case CENTER: {
				xml.appendAttribute("align", "center");
				break;
			}
			case LEFT: {
				xml.appendAttribute("align", "left");
				break;
			}

			case VERTICAL:
				xml.appendAttribute("align", "vertical");
				break;

			default:
				throw new IllegalStateException("Unknown layout type: " + layout.getAlignment());
		}

		if (layout.getContentAlignment() != null) {
			switch (layout.getContentAlignment()) {
				case TOP: {
					xml.appendAttribute("valign", "top");
					break;
				}
				case MIDDLE: {
					xml.appendAttribute("valign", "middle");
					break;
				}
				case BASELINE: {
					xml.appendAttribute("valign", "baseline");
					break;
				}

				case BOTTOM:
					xml.appendAttribute("valign", "bottom");
					break;

				default:
					throw new IllegalStateException("Unknown content alignment type: " + layout.
							getContentAlignment());
			}
		}
		xml.appendOptionalAttribute("gap", gapString);

		xml.appendClose();

		int size = panel.getChildCount();

		for (int i = 0; i < size; i++) {
			xml.appendTag("ui:cell");
			WComponent child = panel.getChildAt(i);
			child.paint(renderContext);
			xml.appendEndTag("ui:cell");
		}

		xml.appendEndTag("ui:flowlayout");
	}
887423
function ()
	{
		var that = this;
		var dt = this.s.dt;

		// Find how many columns are hidden
		var hiddenColumns = dt.columns().indexes().filter( function ( idx ) {
			var col = dt.column( idx );

			if ( col.visible() ) {
				return null;
			}

			// Only counts as hidden if it doesn't have the `never` class
			return $( col.header() ).hasClass( 'never' ) ? null : idx;
		} );
		var haveHidden = true;

		if ( hiddenColumns.length === 0 || ( hiddenColumns.length === 1 && this.s.columns[ hiddenColumns[0] ].control ) ) {
			haveHidden = false;
		}

		if ( haveHidden ) {
			// Show all existing child rows
			dt.rows( { page: 'current' } ).eq(0).each( function (idx) {
				var row = dt.row( idx );

				if ( row.child() ) {
					var info = that.c.details.renderer( dt, row[0] );

					// The renderer can return false to have no child row
					if ( info === false ) {
						row.child.hide();
					}
					else {
						row.child( info, 'child' ).show();
					}
				}
			} );
		}
		else {
			// Hide all existing child rows
			dt.rows( { page: 'current' } ).eq(0).each( function (idx) {
				dt.row( idx ).child.hide();
			} );
		}
	}
677229
public void render() throws IOException, JspException {

        boolean isNewFunctionType = OpenCms.getResourceManager().matchResourceType(
            CmsResourceTypeFunctionConfig.TYPE_NAME,
            m_element.getResource().getTypeId());
        if (isNewFunctionType) {
            CmsFunctionFormatterBean function = getFormatterBean(m_cms);
            if (function != null) {
                CmsUUID jspId = function.getRealJspId();
                if (jspId != null) {
                    CmsJspTagInclude.includeTagAction(
                        m_context,
                        m_cms.getRequestContext().removeSiteRoot(function.getRealJspRootPath()),
                        null,
                        m_cms.getRequestContext().getLocale(),
                        false,
                        m_cms.getRequestContext().getCurrentProject().isOnlineProject(),
                        function.getParameters(),
                        CmsRequestUtil.getAttributeMap(m_request),
                        m_request,
                        m_response);
                } else {
                    m_context.getOut().print(defaultHtml(m_request));
                }
            } else {
                m_context.getOut().print(defaultHtml(m_request));
            }
        } else {
            CmsDynamicFunctionBean.Format format = getFunctionFormat();
            if ((format != null) && m_cms.existsResource(format.getJspStructureId())) {
                try {
                    CmsResource jspResource = m_cms.readResource(format.getJspStructureId());
                    Map<String, String[]> params = new HashMap<>();
                    for (Entry<String, String> paramEntry : format.getParameters().entrySet()) {
                        params.put(paramEntry.getKey(), new String[] {paramEntry.getValue()});
                    }
                    CmsJspTagInclude.includeTagAction(
                        m_context,

                        m_cms.getSitePath(jspResource),
                        null,
                        m_cms.getRequestContext().getLocale(),
                        false,
                        m_cms.getRequestContext().getCurrentProject().isOnlineProject(),
                        params,
                        CmsRequestUtil.getAttributeMap(m_request),
                        m_request,
                        m_response);
                } catch (CmsException e) {
                    LOG.error(e.getLocalizedMessage(), e);
                }
            } else {
                m_context.getOut().print(defaultHtml(m_request));
            }
        }
    }
346604
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WMultiTextField textField = (WMultiTextField) component;
		XmlStringBuilder xml = renderContext.getWriter();

		boolean readOnly = textField.isReadOnly();

		String[] values = textField.getTextInputs();

		xml.appendTagOpen("ui:multitextfield");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", textField.isHidden(), "true");

		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			int cols = textField.getColumns();
			int minLength = textField.getMinLength();
			int maxLength = textField.getMaxLength();
			int maxInputs = textField.getMaxInputs();
			String pattern = textField.getPattern();
			xml.appendOptionalAttribute("disabled", textField.isDisabled(), "true");
			xml.appendOptionalAttribute("required", textField.isMandatory(), "true");
			xml.appendOptionalAttribute("toolTip", textField.getToolTip());
			xml.appendOptionalAttribute("accessibleText", textField.getAccessibleText());
			xml.appendOptionalAttribute("size", cols > 0, cols);
			xml.appendOptionalAttribute("minLength", minLength > 0, minLength);
			xml.appendOptionalAttribute("maxLength", maxLength > 0, maxLength);
			xml.appendOptionalAttribute("max", maxInputs > 0, maxInputs);
			xml.appendOptionalAttribute("pattern", !Util.empty(pattern), pattern);
			// NOTE: do not use HtmlRenderUtil.getEffectivePlaceholder for placeholder - we do not want to echo "required" in every field.
			String placeholder = textField.getPlaceholder();
			xml.appendOptionalAttribute("placeholder", !Util.empty(placeholder), placeholder);
			xml.appendOptionalAttribute("title", I18nUtilities.format(null, InternalMessages.DEFAULT_MULTITEXTFIELD_TIP));
		}
		xml.appendClose();

		if (values != null) {
			for (String value : values) {
				xml.appendTag("ui:value");
				xml.appendEscaped(value);
				xml.appendEndTag("ui:value");
			}
		}

		if (!readOnly) {
			DiagnosticRenderUtil.renderDiagnostics(textField, renderContext);
		}
		xml.appendEndTag("ui:multitextfield");
	}
857781
public void addColumn(final WTableColumn column) {
		columns.add(column);
		WDataTableRowRenderer renderer = (WDataTableRowRenderer) repeater.getRepeatedComponent();
		renderer.addColumn(column, columns.getChildCount() - 1);
	}
20351
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WDialog dialog = (WDialog) component;
		int state = dialog.getState();

		if (state == WDialog.ACTIVE_STATE || dialog.getTrigger() != null) {
			int width = dialog.getWidth();
			int height = dialog.getHeight();
			String title = dialog.getTitle();
			XmlStringBuilder xml = renderContext.getWriter();

			xml.appendTagOpen("ui:dialog");
			xml.appendAttribute("id", component.getId());
			xml.appendOptionalAttribute("class", component.getHtmlClass());
			xml.appendOptionalAttribute("track", component.isTracking(), "true");
			xml.appendOptionalAttribute("width", width > 0, width);
			xml.appendOptionalAttribute("height", height > 0, height);
			xml.appendOptionalAttribute("modal", dialog.getMode() == WDialog.MODAL, "true");
			xml.appendOptionalAttribute("open", dialog.getState() == WDialog.ACTIVE_STATE, "true");
			xml.appendOptionalAttribute("title", title);

			DialogOpenTrigger trigger = dialog.getTrigger();
			if (trigger != null) {
				xml.appendOptionalAttribute("triggerid", trigger.getId());
				if (dialog.hasLegacyTriggerButton()) {
					xml.appendClose();
					trigger.paint(renderContext);
					xml.appendEndTag("ui:dialog");
				} else {
					xml.appendEnd();
				}
			} else {
				xml.appendEnd();
			}
		}
	}
1073024
@Override
	protected void renderContent(HttpServletRequest req, HttpServletResponse res)
			throws ServletException, IOException {
		log.trace("renderContent");

		Map<String, String> pageProps = new HashMap<String, String>();
		pageProps.put("message", "");
		pageProps.put("searchAllChecked", "");
		pageProps.put("resourceType", "");

		ComponentBindingsProviderFactoryImpl factoryImpl = (ComponentBindingsProviderFactoryImpl) factory;

		if ("true".equals(req.getParameter("reloadCache"))) {
			factoryImpl.reloadCache();
			pageProps.put("message", "Cache Reloaded");
		}
		List<ServiceReference> bindingProviders = new ArrayList<ServiceReference>();
		String resourceType = req.getParameter("resourceType");
		if (!StringUtils.isEmpty(resourceType)) {
			log.debug("Searching for resource type: {}", resourceType);
			pageProps.put("resourceType", resourceType);
			bindingProviders = factoryImpl.getReferences(req
					.getParameter("resourceType"));
		} else if ("true".equals(req.getParameter("searchAll"))) {
			pageProps.put("searchAllChecked", "checked");
			log.debug("Searching for all binding providers");
			for (String rt : factoryImpl.getLoadedResourceTypes()) {
				log.debug("Searching for resource type: {}", rt);
				for (ServiceReference reference : factoryImpl.getReferences(rt)) {
					if (!bindingProviders.contains(reference)) {
						bindingProviders.add(reference);
					}
				}
			}
		}

		renderBlock(res, "header.html", pageProps);
		renderBlock(res, "search.html", pageProps);

		for (int i = 0; i < bindingProviders.size(); i++) {
			Map<String, String> properties = loadProperties(bindingProviders
					.get(i));
			properties.put("state", (i + 1) % 2 == 0 ? "even" : "odd");
			renderBlock(res, "result.html", properties);
		}
		res.getWriter().write("</tbody></table>");

		res.getWriter()
				.write("<table><tr><th class=\"content ui-state-default\">Recent Exceptions</th></tr>");

		for (final Object obj : componentBindingsValuesProvider
				.getRecentExceptions()) {
			renderBlock(res, "exception.html", new HashMap<String, String>() {
				private static final long serialVersionUID = 1L;
				{
					put("ex", obj.toString());
				}
			});
		}
		res.getWriter().write("</table>");
	}
116133
private void paintRows(final WDataTable table, final WebXmlRenderContext renderContext) {
		XmlStringBuilder xml = renderContext.getWriter();
		TableDataModel model = table.getDataModel();

		xml.appendTagOpen("ui:tbody");
		xml.appendAttribute("id", table.getRepeater().getId());
		xml.appendClose();

		if (model.getRowCount() == 0) {
			xml.appendTag("ui:nodata");
			xml.appendEscaped(table.getNoDataMessage());
			xml.appendEndTag("ui:nodata");
		} else {
			// If has at least one visible col, paint the rows.
			final int columnCount = table.getColumnCount();

			for (int i = 0; i < columnCount; i++) {
				if (table.getColumn(i).isVisible()) {
					doPaintRows(table, renderContext);
					break;
				}
			}
		}

		xml.appendEndTag("ui:tbody");
	}