-
1. Re: a4j:push - Same PushEventListener given to different instances
billevans Jul 8, 2010 3:03 PM (in response to billevans)In case anyone out there is intested, I did find a solution to this after getting a hint from JBoss support. The trick is to use the 'binding' attribute to force a unique ID to be generated:
e.g.
<a4j:push id="#{pushWrapper.push.id}" binding="#{pushWrapper.push}"
eventProducer="#{accountDetail.addListener}" interval="${identity.pageAutoUpdateInterval}"
reRender="#{accountDetail.unsolicitedUpdIds}" limitToList="false"
oncomplete="showApplErrorDialogIfExists();">
</a4j:push>Then you need to write an Event-scoped bean to support the binding:
@Name("pushWrapper")
@Scope(ScopeType.EVENT)
public class PushRequest {
private static final Log log = new Log4JSeamAwareProvider(PushRequest.class);private UIPush push = new AjaxPush();
public PushRequest() {
}
public UIPush getPush() {
return this.push;
}
@Create
public void onCreate() {
log.info("On create");
Conversation conv = Conversation.instance();
if (conv != null) {
String cid = conv.getId();
this.push.setId(cid);
}
}
public void setPush(UIPush push) {
this.push = push;
}
}