Programatic Contextual Event on Disclosure Listener - jdev 11.1.2.3
969955Jun 5 2013 — edited Jun 6 2013Hello:
I want to programatically fire a contextual event from a DisclosureListener(when a showDetailItem is disclosed in tabbed panel). When I detect the tab is opened I want to publish the Contextual Event.
See code below
It compiles ok, but the error I get is:
oracle.jbo.uicli.binding.JUEventBinding cannot be cast to oracle.binding.ControlBinding
What am I missing here???
Thanks for the help...
===============================================================
package com.xxx.dbmstr.sbe.view.beans;
import com.xxx.ptnr.cc.uc1.common.JSFUtils;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.binding.BindingContainer;
import oracle.jbo.domain.Number;
import oracle.jbo.uicli.binding.JUCtrlActionBinding;
import oracle.jbo.uicli.binding.JUEventBinding;
import org.apache.myfaces.trinidad.event.DisclosureEvent;
public class DBMstrTabs {
private String isOpen = "QA";
public DBMstrTabs() {
super();
}
public void doCE(){
SBEPayload p = (SBEPayload) JSFUtils.getManagedBeanValue("SBEPayloadBean");
if (p == null){
p = new SBEPayload();
}
Number empKey = (Number)JSFUtils.resolveExpression("#{bindings.empKey_t.inputValue}");
p.setEmpKey(empKey);
JSFUtils.setManagedBeanValue("SBEPayloadBean", p);
DCBindingContainer bc = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
JUCtrlActionBinding actionBnd = (JUCtrlActionBinding) bc.getControlBinding("eventBinding");
((DCBindingContainer)bc).getEventDispatcher().queueEvent(actionBnd.getEventProducer(),p);
((DCBindingContainer)bc).getEventDispatcher().processContextualEvents();
}
public void checkQA(DisclosureEvent disclosureEvent) {
if (disclosureEvent.isExpanded()){
setIsOpen("QA");
doCE();
}
}
public void checkSTANDARDS(DisclosureEvent disclosureEvent) {
if (disclosureEvent.isExpanded()){
setIsOpen("STANDARDS");
doCE();
}
}
...
}