Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » multi-page form editor lazy construct(issue when saving a multi-page form editor)
multi-page form editor lazy construct [message #551311] Thu, 05 August 2010 21:26 Go to next message
vlad crc is currently offline vlad crc
Messages: 7
Registered: August 2010
Junior Member
Hello,

Can you folks please help with an issue ?

I develop a RAP appl (I know this is a RCP forum, but I think this is the appropriate place to post this issue) and I created a multi-page form editor. In each page I have some Text, tables and other controls. On "doSave" I go through all the controls in all pages to get their values for further processing.

Now here comes the issue: if a user only opens let's say the 1st and the 2nd page to modify something, and he doesn't open the 3rd and the other pages (which is a common use case), then, when I try to get the values of the controls in the 3rd page I get a null pointer exception, because the pages are constructed lazily and the controls on 3rd page does not exist.

What is the best approach to solve this issue ?

Thank you,
Vlad
Re: multi-page form editor lazy construct [message #551345 is a reply to message #551311] Fri, 06 August 2010 05:02 Go to previous message
Prakash G.R. is currently offline Prakash G.R.
Messages: 621
Registered: July 2009
Senior Member
On 06/08/10 2:56 AM, vlad crc wrote:

> I develop a RAP appl (I know this is a RCP forum, but I think this is
> the appropriate place to post this issue) and I created a multi-page
> form editor. In each page I have some Text, tables and other controls.
> On "doSave" I go through all the controls in all pages to get their
> values for further processing.

Ideally approach would have been to have a model and update the model
elements when there are changes in the associated UI elements. Finally
when you save, you should be persisting the model.

> Now here comes the issue: if a user only opens let's say the 1st and the
> 2nd page to modify something, and he doesn't open the 3rd and the other
> pages (which is a common use case), then, when I try to get the values
> of the controls in the 3rd page I get a null pointer exception, because
> the pages are constructed lazily and the controls on 3rd page does not
> exist.

A workaround is to show all the tabs before save (this has the side
effect of creating all the controls)

--
- Prakash
Platform UI Team, IBM

www.eclipse-tips.com
Previous Topic:Issue observed during use of Progress Monitor / IProgress Service
Next Topic:Commercial RCP-Apps and License
Goto Forum:
  


Current Time: Thu Oct 30 13:16:28 GMT 2014

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

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