Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Passing parameters while creating a view in Eclipse RCP
Passing parameters while creating a view in Eclipse RCP [message #1064593] Thu, 20 June 2013 07:28
Jaya S is currently offline Jaya SFriend
Messages: 1
Registered: June 2013
Junior Member
I am creating eclipse RCP application and I am stuck with passing parameter while showing a view. As the first approach, I tried setting a static variable in View2 from View1 and opened that view (as below). It works.

IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
String viewIdToClose = studentListView.ID;
IViewPart viewToClose = activePage.findView(viewIdToClose);
TableItem item = studentTable.getItem(studentTable.getSelectionIndex());
String text = item.getText(ListViewConstants.TABLE_COLUMN_ONE);
try {
String viewIdToOpen = StudentReview.ID;
StudentReview.userId = text;
} catch (PartInitException e) {...}

As this doesn't seem to be a good approach, I tried as per the suggestion mentioned in the below link(accepted answer). Passing parameters to the view . In this approach, we can pass parameters only after showing the view.

But the issue I have is, the view to be opened should have the value from selected row while calling showView() i.e, I want to populate the parameters in View 2 based on View 1's selection. Is there any way to achieve this? Is it good to use PULL instead of PUSH approach?

Any suggestion is appreciated.

Previous Topic:Package Explorer hiding children files
Next Topic:Child menu of New menu is not showing In E4 RCP.
Goto Forum:

Current Time: Tue Dec 07 19:22:42 GMT 2021

Powered by FUDForum. Page generated in 0.01681 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top