您的位置:首页 > 其它

查询字典类型

2009-07-09 14:47 85 查看
在DictionaryKindListPane.xhtml中:注意不要绑定字段,要重新定义变量,绑定变量。

<ui:define name="QueryConditionPanel">
<h:form style="margin:0px;" mce_style="margin:0px;" id="theBriefQueryForm">
<table align="center" width="80%">
<tr width="60%">
<td align="right" style="font-size: 10pt;" mce_style="font-size: 10pt;" width="40%">
字典类型:
<jsfext:inputText value="#{dictionaryKindModel.kindCondition}"
id="kind" tabindex="1" maxlength="64">
<jsfext:jseventlistener event="onkeydown"
listener="convertEnter2Tab()" />
</jsfext:inputText>
</td>
<td align="right" style="font-size: 10pt;" mce_style="font-size: 10pt;" width="40%">
字典中文含义:
<jsfext:inputText value="#{dictionaryKindModel.detailCondition}"
id="zdzwhy" tabindex="2" maxlength="65">
<jsfext:jseventlistener event="onkeydown"
listener="convertEnter2Tab()" />
</jsfext:inputText>
</td>
<td align="center" style="font-size: 10pt;" mce_style="font-size: 10pt;" width="20%">
<h:commandButton value=" 查 询 " action="#{dictionaryKindModel.doBriefQuery}"
tabindex="3"></h:commandButton>
</td>
</tr>
</table>
</h:form>
</ui:define>


DictionaryKindModel:

// 查询条件变量
private String kindCondition;
private String detailCondition;
/**
*
* @author:denghuimin,yanghanming
* @createTime:Jul 7, 2009 11:41:24 AM
* @function:重写父类的findByQueryCondition方法
* @param otherCondition
*            查询条件
* @return:
*/
public String findByQueryCondition(String otherCondition) {
String errMessage = "";
List list = new ArrayList<QueryConVo>();

if (StringUtils.isNotBlank(this.getKindCondition())) {
QueryConVo conVo = new QueryConVo(dictionaryKindDAOEx.KIND, this
.getKindCondition());
list.add(conVo);
}
if (StringUtils.isNotBlank(this.getDetailCondition())) {
QueryConVo conVo = new QueryConVo(dictionaryKindDAOEx.DETAIL, this
.getDetailCondition());
list.add(conVo);
}

dklist = new ArrayList<DictionaryKind>();
GenarateConnection gc = (GenarateConnection) getCtx().getBean(
BizGlobalConstants.X_GCONNECTION);
String hql = "from DictionaryKind as ti where 1=1 and ti.scbz ='0'";
try {
this.dklist = gc.findListForPage(hql, list, this
.getCurrentPageNumber(), this.getPageSize());
this.rowCount = gc.findCountForPage(hql, list, this
.getCurrentPageNumber(), this.getPageSize());
} catch (Exception e) {
e.printStackTrace();
}
return errMessage;
}

public String doBriefQuery() {
String errMessage = "";
errMessage = findByQueryCondition(dictionaryKind.getKind());
this.fromOutcome = DictionaryKindListPane;
return errMessage;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: