use of com.liferay.faces.demos.bean.BookingsModelBean in project liferay-faces-bridge-impl by liferay.
the class CustomerSelectedEventHandler method handleEvent.
public EventNavigationResult handleEvent(FacesContext facesContext, Event event) {
EventNavigationResult eventNavigationResult = null;
String eventQName = event.getQName().toString();
if (eventQName.equals("{http://liferay.com/events}ipc.customerSelected")) {
Serializable value = event.getValue();
// payload from the wrapper.
if (value instanceof EventPayloadWrapper) {
value = ((EventPayloadWrapper) value).getWrapped();
}
Customer customer = (Customer) value;
BookingsModelBean bookingsModelBean = getBookingsModelBean(facesContext);
bookingsModelBean.setCustomer(customer);
String fromAction = null;
String outcome = "ipc.customerSelected";
eventNavigationResult = new EventNavigationResult(fromAction, outcome);
logger.debug("Received event ipc.customerSelected for customerId=[{0}] firstName=[{1}] lastName=[{2}]", new Object[] { customer.getCustomerId(), customer.getFirstName(), customer.getLastName() });
}
return eventNavigationResult;
}
use of com.liferay.faces.demos.bean.BookingsModelBean in project liferay-faces-bridge-impl by liferay.
the class CustomerSelectedEventHandler method getBookingsModelBean.
protected BookingsModelBean getBookingsModelBean(FacesContext facesContext) {
String elExpression = "#{bookingsModelBean}";
ELContext elContext = facesContext.getELContext();
ValueExpression valueExpression = facesContext.getApplication().getExpressionFactory().createValueExpression(elContext, elExpression, BookingsModelBean.class);
return (BookingsModelBean) valueExpression.getValue(elContext);
}
Aggregations