Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Composite form scrolls on top on radio or check button select(RCP 3.2 to 4.8 migration (compatibility mode) impacted Composite UI form)
Composite form scrolls on top on radio or check button select [message #1842575] Thu, 24 June 2021 08:21 Go to next message
Avishek Sribasbanikam is currently offline Avishek SribasbanikamFriend
Messages: 1
Registered: June 2021
Junior Member
Hi,

Need your help to resolve my Composite form scroll issue.
We recently moved our application from RCP 3.2 to RCP 4.8(compatibility mode)..since then the composite form UI doesn't work the same way like before.

Acceptance criteria of UI: When any radio or checkbox is selected at the bottom of the page taking the scrollbar down. After select the scroll form should retain the position.

Issue: The scroll form jumps on top of the page after any radio or checkbox is selected.

In the code composite form is disposed everytime when user selects any new radio button. This is done as each radio button has some child question which will be populated on selection. In RCP 3.2 (java 1.6) this worked perfectly but after migration to RCP 4.8 (java 1.8) doesnt work.

I have tried multiple ways to retain the position using SetOrigin and setting the location but nothing works.

Any suggestion will be much appreciated.

Here is the code snippet:
  private void init(boolean shouldScroll) {
    if(form != null) {
      form.dispose();
    }
    if(toolkit == null) {
      toolkit = new FormToolkit(parent.getDisplay());
    }
    //Enters this if block when form is disposed
    if(shouldScroll) {
    	form = new ScrolledForm(parent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
    			FormColors colors=new FormColors(parent.getDisplay());
    			((ScrolledForm) form).setExpandHorizontal(true);
    			((ScrolledForm) form).setExpandVertical(true);
    			((ScrolledForm) form).setBackground(colors.getBackground());
    			((ScrolledForm) form).setForeground(colors.getColor(IFormColors.TITLE));
    			((ScrolledForm) form).setFont(JFaceResources.getHeaderFont());
    			((ScrolledForm) form).setAlwaysShowScrollBars(false);
    			((ScrolledForm) form).getBody().setLayout( new FillLayout());
    }
    //enters Else block when application start of shouldScroll as false
    else {
    	FormColors colors=new FormColors(parent.getDisplay());
    	form = new Form(parent, SWT.BORDER);
    	form.setBackground(colors.getBackground());
    	form.setForeground(colors.getColor(IFormColors.TITLE));
    	form.setFont(JFaceResources.getHeaderFont());
      form.setLayout(new FillLayout());
    }
    form.update();
    form.redraw();

    assessmentRenderer = new AssessmentRenderer(toolkit);
    components = new Components(toolkit, this);
  }
  • Attachment: Capture.JPG
    (Size: 78.99KB, Downloaded 58 times)
Re: Composite form scrolls on top on radio or check button select [message #1849325 is a reply to message #1842575] Wed, 12 January 2022 21:35 Go to previous message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

Your disposing and rebuilding will probably cause some unexpected issues. You will have to play with it to get your required behavior.

Please note that 4.8 is dead as a doornail and posting half a snippet will not invite anyone to try to help you.

If you want help, upgrade to the latest Eclipse release (4.22) and try the same again. If it does not work then post a short runnable snippet (with a main method) that demonstrates the problem.
Previous Topic:Error on creating workspace for the first time
Next Topic:How to add "Build project" option to my custom project in RCP application
Goto Forum:
  


Current Time: Tue May 28 14:14:04 GMT 2024

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

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

Back to the top