Foren

Portlet IPC after recieved Event

Daniel Storch, geändert vor 9 Jahren.

Portlet IPC after recieved Event

New Member Beiträge: 16 Beitrittsdatum: 03.05.15 Neueste Beiträge
I have a Navigation portlet which schows all Students, when a Student gets clicked im sending a event with the id of the clicked student to other portlets. Sending and receiving the event is not the problem, that works fine. What i don't get, is how to proceed with the id of the Object.

How do i update the portlets receiving the event to show the data of the Object they received. Since i only get the id, the first stept is to search in the DB and get alle data, afterwards update the portlets view.

Here my EventHandler:
The hskaId is the id of the Object wchich i need.
public class ReceivedFeedbackEventHandler implements BridgeEventHandler{

	@Override
	public EventNavigationResult handleEvent(FacesContext facesContext, Event event) {
		 EventNavigationResult eventNavigationResult = null;
         String eventQName = event.getQName().toString();

         if (eventQName.equals("{http://liferay.com/events}ipc.studentSelected")) {
             System.out.print("EVENT RECIVED STUDENT");
             
             String hskaId = (String) event.getValue();
             
         }

         if(eventQName.equals("{http://liferay.com/events}ipc.projectSelected")) {
        	 System.out.print("EVENT RECIVED PROJECT");
         }
         
         return eventNavigationResult;
	}

}


In the ManagedBean of the Portlet, im calling this to get all Students of a hskaId. Where "hskaId" stands right now, should the recieved event value go.
Student student = StudentLocalServiceUtil.findByProjectId("hskaId");


How do i get the received value of the event to the ManagedBean and update the view?

Sorry if this is a amature question, but i haven't found any example for this.
Daniel Storch, geändert vor 9 Jahren.

RE: Portlet IPC after recieved Event

New Member Beiträge: 16 Beitrittsdatum: 03.05.15 Neueste Beiträge
Crosspost: Also posted this question on Stackoverflow.
thumbnail
Olaf Kock, geändert vor 9 Jahren.

moved to "Liferay Faces" area

Liferay Legend Beiträge: 6441 Beitrittsdatum: 23.09.08 Neueste Beiträge
Thanks for linking the crosspost. The stackoverflow tagging gave away the "JSF". As you still haven't gotten any replies, I've moved this to the Liferay Faces part of the messageboards. I posted the general mechanics on the stackoverflow post (well, only a link to a place). If there's more JSF magic required, you'll find it here.
thumbnail
Kyle Joseph Stiemann, geändert vor 9 Jahren.

RE: Portlet IPC after recieved Event

Liferay Master Beiträge: 760 Beitrittsdatum: 14.01.13 Neueste Beiträge
Hi Daniel,
I answered your question on StackOverflow. Also please see the Customers and Bookings portlet demo for a working example of how to do what you are asking.

- Kyle