int size = queryProperties.size();
/* sizePerLin指每一行有多少个字段 */
int sizePerLine = Integer.parseInt(columnsPerLine);
int j = 0;
for (int i = 0; i < size; i++) {
UserPropertyRight property = (UserPropertyRight) queryProperties
.get(i);
if (j % sizePerLine == 0) {
buffer.append("<tr>\n");
}
String propertyName = property.getPropertyName();
if ("Y".equals(property.getScopeQuery())) {
/* 如果范围查询 */
buffer.append("<td nowrap>" + property.getPropertyChiName()
+ "</td>\n");
buffer.append("<td>\n");
buffer.append("<input type=\"text\" name=\"lower"
+ property.getPropertyName()
+ "\" value=\""
+ Format.format(BeanUtil.getFieldValue(lower,
propertyName)) + "\"/>--\n");
buffer.append("<input type=\"text\" name=\"upper"
+ property.getPropertyName()
+ "\" value=\""
+ Format.format(BeanUtil.getFieldValue(upper,
propertyName)) + "\"/>\n");
buffer.append("</td>\n");
} else {
/* 如果不是hidden字段 */
if (GenericValidator.isBlankOrNull(property.getHidden())) {
buffer.append("<td>" + property.getPropertyChiName()
+ "</td>\n");
}
propertyName = property.getPropertyName();
buffer.append("<td>\n");
/* 如果不是范围查询 */
if (GenericValidator.isBlankOrNull(property
.getPropertyValueTable())) {
/* 如果不是从数据字典表或者其他表中选取,则显示输入框 */
if (GenericValidator.isBlankOrNull(property.getHidden())) {
buffer.append("<input type=\"text\" name=\""
+ property.getPropertyName()
+ "\" value=\""
+ Format.format(BeanUtil.getFieldValue(lower,
propertyName)) + "\"/>\n");
} else {
buffer.append("<input type=\"hidden\" name=\""
+ property.getPropertyName()
+ "\" value=\""
+ Format.format(BeanUtil.getFieldValue(lower,
propertyName)) + "\"/>\n");
}
} else {
/* 如果是从数据字典表或者其他表中选取,则显示下拉列表或者弹出框 */
String propertyValueTable = property
.getPropertyValueTable();
if (property.getFromDictionary() != null) {
if (property.getFromDictionary().booleanValue()) {
StringBuffer selectBuffer = DictionaryProxy
.getHtmlSelect(propertyName,
propertyValueTable, BeanUtil
.getFieldValue(lower,
propertyName),
BeanUtil.getFieldValue(lower,
property.getShowProperty()));
buffer.append(selectBuffer);
} else {
if ("select".equalsIgnoreCase(property
.getShowType())) {
StringBuffer selectBuffer = HtmlClientComponentService
.getSelect(propertyValueTable, BeanUtil
.getFieldValue(lower,
propertyName));
buffer.append(selectBuffer);
} else {
buffer.append("<input type=\"text\" name=\""
+ property.getShowProperty()
+ "\" value=\""
+ Format.format(BeanUtil.getFieldValue(
lower, property
.getShowProperty()))
+ "\"/>");
}
}
}