【问题标题】:how to add a loupefield to finder?如何将放大镜添加到取景器?
【发布时间】:2015-12-04 20:55:57
【问题描述】:

有没有办法在查找器中添加放大镜字段? 我尝试使用放大镜使用此查找器表单:

<form:find id="fc_org_po_dominio_Carga" finderName="ByUnidadmotor"
    path="/cargas/reports/reporte_rendimientoxplacaPeriodo/genera?size=${empty param.size ? 10 : param.size}&amp;command=0" 
    render="${empty dependencies}" z="user-managed">
   <loupefield:loupe 
       additionalFields="placas,modelovehiculo,areaadscrita" 
       caption="placas" controllerPath="cargas" 
       field="unidadmotor" disableFormBinding="true"
       id="c_org_pgjeo_dominio_Carga_unidadmotor" 
       itemValue="id" items="${vehiculoes}"
       listPath="vehiculoes/list" mode="create" 
       path="/vehiculoes" pkField="id" z="user-managed"/>
 </form:find>

但是我收到了这个错误:

org.springframework.beans.NotReadablePropertyException:bean 类 [java.lang.String] 的无效属性“unidadmotor”:bean 属性“unidadmotor”不可读或具有无效的 getter 方法:getter 的返回类型是否匹配setter 的参数类型?

例如在线宠物诊所: http://geo-gvnix.rhcloud.com/pets?find=ByOwner&form&page=1&size=10 在寻找所有者而不是选择字段时,最好有一个放大镜。

有什么提示吗?

【问题讨论】:

    标签: spring finder gvnix


    【解决方案1】:

    几个小时后我可以在finder表单中添加一个放大镜,我意识到有必要在uiModel中包含“command”属性,模型的这个属性必须具有放大镜的属性才能搜索,例如:

    uiModel.addAttribute("command", new Entidad());
    

    我添加了这个属性,查找器可以无缝工作!

    【讨论】:

      猜你喜欢
      • 2014-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-04
      • 1970-01-01
      • 1970-01-01
      • 2016-05-05
      相关资源
      最近更新 更多