简体   繁体   English

如何使用ADF propertyListener标记?

[英]How do I use the ADF propertyListener tag?

I have a class 我有一堂课

CustomerBean {
    Customer customer;
    public CustomerBean() {...}
    public getCustomer() {...}
    public void setCustomer(Customer c) {...}
    ...
}

When using normal JSF I can use a setPropertyLIstener tag (on say a commandLink) to update the customer property. 当使用普通的JSF时,我可以使用setPropertyLIstener标记(例如,commandLink)来更新客户属性。

I'm trying to do the same thing with Oracle ADF, but failing. 我正在尝试使用Oracle ADF做同样的事情,但是失败了。 How do I specify a binding to a property on a data control? 如何在数据控件上指定对属性的绑定? When I try to use Jdeveloper to do it it sets up an iterator for the customer variable, how do I declare and wire up a PropertyListener correctly? 当我尝试使用Jdeveloper进行设置时,它将为customer变量设置一个迭代器,如何正确声明和连接PropertyListener?

Are there any-up-to date ADF resources I should know of? 我应该了解最新的ADF资源吗? - a lot of ones I come accross use deprecated classes and methods. -我遇到的很多人都使用过时的类和方法。

Thanks in advance. 提前致谢。

This should work. 这应该工作。

  1. From the datacontrol panel, drag the setCustomer() method to the page and create it as a command link. 从datacontrol面板中,将setCustomer()方法拖到页面上并将其创建为命令链接。
  2. Bind the customer argument to #{requestScope.customer} . 将客户参数绑定到#{requestScope.customer}
  3. Inside the commandLink , use setPropertyListener / setActionListener to put the customer into request scope. commandLink内部,使用setPropertyListener / setActionListener将客户置于请求范围内。
  4. When the commandLink is clicked, ADF will pull the customer value from request scope and invoke the method. 单击commandLink ,ADF将从请求范围中提取客户值并调用该方法。

How about Oracle's own ADF docs? Oracle自己的ADF文档如何? The af:setPropertyListener is specified here . 此处指定af:setPropertyListener

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM