Reputation: 5396
I am using this to access context of backing bean from another backing bean.
I am modifying property of this bean in current one. Can I put this context back?
TemplatePrescriptionMaintenanceBackingBean templatePrescBean = (TemplatePrescriptionMaintenanceBackingBean)context.getApplication()
.evaluateExpressionGet(context, "#{templatePrescriptionMaintenanceBackingBean}", TemplatePrescriptionMaintenanceBackingBean.class);
Upvotes: 0
Views: 77
Reputation: 1108922
That's not necessary. You're obtaining a reference to an existing bean instance, not a copy or something. If you manipulate the reference, then it'll be "reflected" anywhere else which is also holding a reference to this instance. Java is an OO language, not a procedural language or something.
By the way, @ManagedProperty
is a better approach to obtain a reference to another managed bean.
Upvotes: 1