点集贵州电脑网
 
 
 梦想之源 ›› 灌水专区 ›› 自定义组件的问题 版主:
灌水专区
新建论坛
申请免费TS
1 / 1 页
<< 1 >>
跳转
 主题:自定义组件的问题
 
 lele
发表时间:[2007-11-14 11:02:07] [向作者发站内短信] [复制链接告诉朋友]
等 级:列兵
经 验:498
性 别:帅哥
文 章:138
精 华:0

public abstract class  SearchPage extends BaseComponent {
 
 public ReportGet parameter;


 public  void setParameter(ReportGet parameter){
  this.parameter=parameter;
 }

 public  ReportGet getParameter(){
  return this.parameter;
 }
 
 // 设置设备参数PO类
 public BasePO po=null;


 /**
  * @return the po
  */
 public BasePO getPo() {
  return po;
 }

 /**
  * @param po the po to set
  */
 public void setPo(BasePO po) {
  this.po = po;
 }
。。。。。省略,和这个错误没关系

对应的.page如下

<component-specification class="com.longcredit.KEye.app.business.report.SearchPage">  


        
    <component id="report_alert" type="Hidden">
          <binding name="value" value="ognl:parameter"/>
    </component>
       
    <component id="device_type" type="PropertySelection">
        <binding name="model" value="ognl:getSelect('1000001','action=getdeviceprototypelist')"/>
        <binding name="value" value="ognl:parameter.prototypeid"/>
    </component>
   
 <component id="date" type="TextField">
        <binding name="value" value="ognl:parameter.date"/>
    </component>
             
    <component id="searchInfo" type="Submit">
        <binding name="listener" value="listener:getLink"/>
        <binding name="parameters" value='{"action=getSummaryReportByPrototype&amp;prototypeid="+po.prototypeid+"&amp;date="+po.date+"&amp;reporttype=1","ReportIndex","updateDeviceFail"}'/>
    </component>
</component-specification>

 

错误如下:

org.apache.tapestry.BindingException
Unable to read OGNL expression '<parsed OGNL expression>' of $SearchPage_10@e8e8bf[ReportIndex/DateSearch]: source is null for getProperty(null, "prototypeid")
binding: ExpressionBinding[ReportIndex/DateSearch parameter.prototypeid]
location: context:/WEB-INF/DeviceSearchDate.jwc, line 15, column 67
10 <binding name="value" value="ognl:parameter"/>
11 </component>
12  
13 <component id="device_type" type="PropertySelection">
14 <binding name="model" value="ognl:getSelect('1000001','action=getdeviceprototypelist')"/>
15 <binding name="value" value="ognl:parameter.prototypeid"/>
16 </component>
17  
18 <component id="date" type="TextField">
19 <binding name="value" value="ognl:parameter.date"/>
20 </component>


 楼主更多新贴 :  
灌水专区jfreechart图形上的链接
灌水专区itemselection的问题
灌水专区ognl:devicegroup.id
灌水专区foreach的问题
  楼1  
等 级:列兵
经 验:498
性 别:帅哥
文 章:138
精 华:0
 lele
发表时间:[2007-11-14 11:04:16] [向作者发站内短信] [复制链接告诉朋友]

BaseComponent 类里是不能使用initialize()方法的

那么 在这样的情况下 需要

13 <component id="device_type" type="PropertySelection">
14 <binding name="model" value="ognl:getSelect('1000001','action=getdeviceprototypelist')"/>
15 <binding name="value" value="ognl:parameter.prototypeid"/>
16 </component>

这样的形式 ,就是希望把select的值绑定到parameter对象的prototypeid属性

怎么办

  楼2  
等 级:下士
经 验:1683
性 别:帅哥
文 章:496
精 华:2
 干煸四季豆
发表时间:[2007-11-14 11:12:57] [向作者发站内短信] [复制链接告诉朋友]

组件,是可以定义组件参数的。把你的parameter.prototypeid作为一个组件参数即可。

  楼3  
等 级:列兵
经 验:498
性 别:帅哥
文 章:138
精 华:0
 lele
发表时间:[2007-11-14 11:19:22] [向作者发站内短信] [复制链接告诉朋友]

这个不是太理解 组件可以定义参数我是知道的

那我在这个组件定义的.page里应该这样写吧

     <parameter name="prototypeid" required="yes"/>

那我在对应的类里要有prototypeid的抽象setter/gettter方法?

 

  楼4  
等 级:下士
经 验:1683
性 别:帅哥
文 章:496
精 华:2
 干煸四季豆
发表时间:[2007-11-16 00:34:36] [向作者发站内短信] [复制链接告诉朋友]

试试就知道了,看书上对组件的介绍。:)

1 / 1 页
<< 1 >>
跳转
  快速回复
  帐号: 密码: 匿名不登陆
回复内容:  
验 证 码:
 
 
·VIP收费TS,您明智的选择!
·9800GT+19'液晶DIY仅售3500元
·双核特惠:1999、2999、3999
·什么是点金积分,如何查看自
·团购一期:三星R458-DS0G+高
  
贵州点集科技发展有限责任公司·点集贵州电脑网 版权所有©2006-2008
中华人民共和国增值电信业务经营许可证 黔B-20070010号
客服QQ: 93804809818866281927205370
电子邮件: deangi@vip.sina.com
技术支持: 0851-5109268