Java Dojo filteringSelect和Dojo组合框-未调用转换器
我对dojo filteringSelect和dojo combobox组件有问题。我已经尝试使用这两个组件,但问题是相同的。我意识到从不调用转换器,当combobox中填充值时,我得到错误java.lang.IllegalArgumentException:参数类型不匹配Java Dojo filteringSelect和Dojo组合框-未调用转换器,java,combobox,dojo,xpages,converter,Java,Combobox,Dojo,Xpages,Converter,我对dojo filteringSelect和dojo combobox组件有问题。我已经尝试使用这两个组件,但问题是相同的。我意识到从不调用转换器,当combobox中填充值时,我得到错误java.lang.IllegalArgumentException:参数类型不匹配 <xe:djFilteringSelect id="cbDocumentCategoryListtt" dojoType="dijit.form.ComboBox"
<xe:djFilteringSelect id="cbDocumentCategoryListtt"
dojoType="dijit.form.ComboBox"
value="#{compositeData.archiveDocument.documentCategory}"
disabled="#{javascript:!compositeData.editMode}">
<xe:this.queryExpr><![CDATA[${javascript:"*$\{0}*"}]]></xe:this.queryExpr>
<xe:this.converter>
<xp:converter
converterId="ConverterDocumentCategory">
</xp:converter>
</xe:this.converter>
<xp:selectItems id="selectItems2">
<xe:this.value><![CDATA[#{javascript:try{
ControllerDocumentCategory.getAllDocumentCategoryBasedOnLRM(compositeData.archiveDocument.entryDateFrom,compositeData.archiveDocument.entryDateUntil,compositeData.archiveDocument.fund,true)
}
catch(e)
{
var msg="Error: "+ e.toString()+" See log.";
var msgObj = new javax.faces.application.FacesMessage(javax.faces.application.FacesMessage.SEVERITY_ERROR, msg, msg);
facesContext.addMessage("",msgObj);
log.logError( e.toString(), null, e ,123,"ccArchiveDocumentBase.xsp",msg);
}}]]></xe:this.value>
</xp:selectItems>
</xe:djFilteringSelect>
在这个方法中,我为过滤器选择准备列表:
public List<SelectItem> getAllDocumentCategoryBasedOnLRM(Object objFrom, Object objUntil, Object objFund,boolean active) {
sig=new ArrayList<SelectItem>();
sigActive=new ArrayList<SelectItem>();
FacesContext context=FacesContext.getCurrentInstance();
try
{
if(objFrom==null || objFund == null || objUntil==null || ((Fund)objFund).getCodeText()==null || ((Fund)objFund).getCodeText().equals(""))
{
return sig;
}
Fund fund=(Fund) objFund;
Date date=(Date) objFrom;
Calendar cal=Calendar.getInstance();
cal.setTime(date);
if(fund.getCodeText().equals("3")){
LRM lrmm= new LRM();
lrmm.setCurrent("1");
lrmm.setFund(fund);
lrmm=(LRM) DbLotusBroker.getInstance().ftSearch(lrmm, true).get(0);
if(cal.after(lrmm.getDateFrom()) || cal.equals(lrmm.getDateFrom()))
{
DocumentCategory dc=new DocumentCategory();
LRMGroup lrmGroup = new LRMGroup();
lrmGroup.setLrm(lrmm);
dc.setLrmGroup(lrmGroup);
dc.setActive("1");
List<Object>list=DbLotusBroker.getInstance().ftSearch(dc, true);
sig.add(new SelectItem(new DocumentCategory()));
sigActive.add(new SelectItem(new DocumentCategory()));
for (Object object : list)
{
DocumentCategory documentCategory=(DocumentCategory) object;
sig.add(new SelectItem(documentCategory));
if(documentCategory.getActive().equals("1"))
sigActive.add(new SelectItem(documentCategory));
}
}else{
getLrmCategory(objFrom, objUntil, objFund, active);
}
}
else{
getLrmCategory(objFrom, objUntil, objFund, active);
}
}
catch (Exception e) {
SRCLogFactory.getInstance().getLog().logError(e);
context.addMessage("", new FacesMessage("Greška "+e));
}
if(active)
return sigActive;
else
return sig;
}
public List getAllDocumentCategoryBasedOnlm(对象objFrom、对象objUntil、对象objFund、布尔活动){
sig=新的ArrayList();
sigActive=newarraylist();
FacesContext context=FacesContext.getCurrentInstance();
尝试
{
如果(objFrom==null | | | objFund==null | | | objUntil==null | | |((基金)objFund).getCodeText()=null | |((基金)objFund.getCodeText().equals(“”)
{
返回信号;
}
基金=(基金)objFund;
日期日期=(日期)objFrom;
Calendar cal=Calendar.getInstance();
校准设定时间(日期);
if(fund.getCodeText()等于(“3”)){
LRM lrmm=新的LRM();
lrmm.设定电流(“1”);
lrmm.setFund(基金);
lrmm=(LRM)DbLotusBroker.getInstance().ftSearch(lrmm,true).get(0);
if(cal.after(lrmm.getDateFrom())| | cal.equals(lrmm.getDateFrom()))
{
DocumentCategory dc=新的DocumentCategory();
LRMGroup LRMGroup=新的LRMGroup();
lrmgrup.setLrm(lrmm);
dc.setLrmGroup(lrmGroup);
dc.setActive(“1”);
Listlist=DbLotusBroker.getInstance().ftSearch(dc,true);
sig.add(新建SelectItem(新建DocumentCategory());
sigActive.add(新建SelectItem(newdocumentcategory());
用于(对象:列表)
{
DocumentCategory DocumentCategory=(DocumentCategory)对象;
sig.add(新选择项(文档类别));
if(documentCategory.getActive().equals(“1”))
sigActive.add(新建SelectItem(documentCategory));
}
}否则{
getLrmCategory(objFrom、objUntil、objFund、active);
}
}
否则{
getLrmCategory(objFrom、objUntil、objFund、active);
}
}
捕获(例外e){
SRCLogFactory.getInstance().getLog().logError(e);
context.addMessage(“”,新面孔消息(“Greška”+e));
}
如果(活动)
返回激活状态;
其他的
返回信号;
}
转换器已在faces-config.xml文件中注册:
<description>A Converter for document category</description>
<converter-id>ConverterDocumentCategory</converter-id>
<converter-class>com.src.converters.ConverterDocumentCategory</converter-class>
</converter>
文档类别的转换器
转换器文档类别
com.src.converters.ConverterDocumentCategory
我认为这个问题是由使用扩展库xe:djFilteringSelect中的组件引起的,可能这个组件不能与转换器一起工作。有什么想法吗?我从来没有找到解决这个问题的办法。
<description>A Converter for document category</description>
<converter-id>ConverterDocumentCategory</converter-id>
<converter-class>com.src.converters.ConverterDocumentCategory</converter-class>
</converter>