Home » Eclipse Projects » Remote Application Platform (RAP) » ScrolledComposite#showControl doesn't work for new children
ScrolledComposite#showControl doesn't work for new children [message #505890] |
Tue, 05 January 2010 14:03 |
Ralf Zahn Messages: 32 Registered: July 2009 |
Member |
|
|
Hi,
as I know, the bounds of UI widgets are set by rendering them in the
browser and sending the bounds back to the server during the next request.
I have a ScrolledComposite, wherein some child widgets are created. I
want to scroll down to the widget that I have just created. But the
showControl-Method needs the widget to have bounds specified, and the
widget has the bounds (0,0,0,0) because it was not yet rendered in the
browser.
So how to solve the problem?
- Using UICallback and starting a Job that will check the widget to
have bounds set and then call the showControl-method within the UI
thread. (Disadvantages: delay in scrolling within the UI, single
sourcing is more complicated, a job is shown in the progress bar)
- Using the setOrigin method and estimating the bounds of the widget.
(I guess this does not work because the origin is handled before
calculating the bounds at the client, so it will only scroll to the
widget that already existed before)
- Modifying the showControl method not to use bounds, but adding an
attribute to the UI component containing a scroll command and sending it
to the client. (Advantages: transparency for single sourcing, no UI delay)
What about other methods of other widgets requiring bounds?
|
|
|
Re: ScrolledComposite#showControl doesn't work for new children [message #505898 is a reply to message #505890] |
Tue, 05 January 2010 14:24 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Ralf,
the controls bounds are calculated on the server side when the layout is
performed. When you add a new children to the ScrolledComposite try to
force the re-layouting at the end.
HTH,
Ivan
On 1/5/2010 4:03 PM, Ralf Zahn wrote:
> Hi,
>
> as I know, the bounds of UI widgets are set by rendering them in the
> browser and sending the bounds back to the server during the next
> request.
> I have a ScrolledComposite, wherein some child widgets are created. I
> want to scroll down to the widget that I have just created. But the
> showControl-Method needs the widget to have bounds specified, and the
> widget has the bounds (0,0,0,0) because it was not yet rendered in the
> browser.
>
> So how to solve the problem?
> - Using UICallback and starting a Job that will check the widget to
> have bounds set and then call the showControl-method within the UI
> thread. (Disadvantages: delay in scrolling within the UI, single
> sourcing is more complicated, a job is shown in the progress bar)
> - Using the setOrigin method and estimating the bounds of the widget.
> (I guess this does not work because the origin is handled before
> calculating the bounds at the client, so it will only scroll to the
> widget that already existed before)
> - Modifying the showControl method not to use bounds, but adding an
> attribute to the UI component containing a scroll command and sending
> it to the client. (Advantages: transparency for single sourcing, no
> UI delay)
>
> What about other methods of other widgets requiring bounds?
|
|
|
Re: ScrolledComposite#showControl doesn't work for new children [message #506018 is a reply to message #505898] |
Tue, 05 January 2010 18:47 |
Ralf Zahn Messages: 32 Registered: July 2009 |
Member |
|
|
Okay, I previously called scrolledComposite.layout(), instead
scrolledComposite.getBody().layout() is correct.
Now I have the problem that the origin is calculated correctly, but not
executed at the client. The controls, that were created during the
current request cycle, cannot be made visible by scrolling. It seems
that (at the client) the scrolling is executed before the new child
controls are added.
If the ScrolledComposite contains A, B, C, D, the client area can show 2
elements (A,B), and I add two further children E and F, call
showControl(F) during the same request, the ScrolledComposite will show
C,D. The next request adds G, H, but scrolls to E,F and so on.
Ivan Furnadjiev schrieb:
> Hi Ralf,
>
> the controls bounds are calculated on the server side when the layout is
> performed. When you add a new children to the ScrolledComposite try to
> force the re-layouting at the end.
>
> HTH,
> Ivan
>
> On 1/5/2010 4:03 PM, Ralf Zahn wrote:
>> Hi,
>>
>> as I know, the bounds of UI widgets are set by rendering them in the
>> browser and sending the bounds back to the server during the next
>> request.
>> I have a ScrolledComposite, wherein some child widgets are created. I
>> want to scroll down to the widget that I have just created. But the
>> showControl-Method needs the widget to have bounds specified, and the
>> widget has the bounds (0,0,0,0) because it was not yet rendered in the
>> browser.
>>
>> So how to solve the problem?
>> - Using UICallback and starting a Job that will check the widget to
>> have bounds set and then call the showControl-method within the UI
>> thread. (Disadvantages: delay in scrolling within the UI, single
>> sourcing is more complicated, a job is shown in the progress bar)
>> - Using the setOrigin method and estimating the bounds of the widget.
>> (I guess this does not work because the origin is handled before
>> calculating the bounds at the client, so it will only scroll to the
>> widget that already existed before)
>> - Modifying the showControl method not to use bounds, but adding an
>> attribute to the UI component containing a scroll command and sending
>> it to the client. (Advantages: transparency for single sourcing, no
>> UI delay)
>>
>> What about other methods of other widgets requiring bounds?
|
|
|
Re: ScrolledComposite#showControl doesn't work for new children [message #506020 is a reply to message #506018] |
Tue, 05 January 2010 18:56 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Ralf,
can you provide a snippet that demonstrate the problem?
Best,
Ivan
On 1/5/2010 8:47 PM, Ralf Zahn wrote:
> Okay, I previously called scrolledComposite.layout(), instead
> scrolledComposite.getBody().layout() is correct.
>
> Now I have the problem that the origin is calculated correctly, but
> not executed at the client. The controls, that were created during the
> current request cycle, cannot be made visible by scrolling. It seems
> that (at the client) the scrolling is executed before the new child
> controls are added.
>
> If the ScrolledComposite contains A, B, C, D, the client area can show
> 2 elements (A,B), and I add two further children E and F, call
> showControl(F) during the same request, the ScrolledComposite will
> show C,D. The next request adds G, H, but scrolls to E,F and so on.
>
>
> Ivan Furnadjiev schrieb:
>> Hi Ralf,
>>
>> the controls bounds are calculated on the server side when the layout
>> is performed. When you add a new children to the ScrolledComposite
>> try to force the re-layouting at the end.
>>
>> HTH,
>> Ivan
>>
>> On 1/5/2010 4:03 PM, Ralf Zahn wrote:
>>> Hi,
>>>
>>> as I know, the bounds of UI widgets are set by rendering them in the
>>> browser and sending the bounds back to the server during the next
>>> request.
>>> I have a ScrolledComposite, wherein some child widgets are created.
>>> I want to scroll down to the widget that I have just created. But
>>> the showControl-Method needs the widget to have bounds specified,
>>> and the widget has the bounds (0,0,0,0) because it was not yet
>>> rendered in the browser.
>>>
>>> So how to solve the problem?
>>> - Using UICallback and starting a Job that will check the widget to
>>> have bounds set and then call the showControl-method within the UI
>>> thread. (Disadvantages: delay in scrolling within the UI, single
>>> sourcing is more complicated, a job is shown in the progress bar)
>>> - Using the setOrigin method and estimating the bounds of the
>>> widget. (I guess this does not work because the origin is handled
>>> before calculating the bounds at the client, so it will only scroll
>>> to the widget that already existed before)
>>> - Modifying the showControl method not to use bounds, but adding an
>>> attribute to the UI component containing a scroll command and
>>> sending it to the client. (Advantages: transparency for single
>>> sourcing, no UI delay)
>>>
>>> What about other methods of other widgets requiring bounds?
|
|
| | | |
Goto Forum:
Current Time: Fri Apr 26 08:42:39 GMT 2024
Powered by FUDForum. Page generated in 0.03254 seconds
|