On a BorderLayout panel (with hidden overflow), when Page Down, ↓ or End are pressed the page is scrolled down, hiding its top. How to prevent it?
This same problem occurs on the Ext GWT example website also. To reproduce it, left click on the tab panel header on an empty area and press Page Down.
Here's a screenshot illustrating the problem.
i find the way to solve this problem ,
i give margin to my viewport
x-viewport {margin-bottom: -16px;}
and Done!
Related
i saw on the vaadin demo website on the sampler a menubar which gets an icon at the end of it when its getting smaller. But there is no sourcecode which shows me how to do this. Does anyone know how they made it?
https://demo.vaadin.com/sampler/#ui/interaction/menu-bar
Actually u can drag the arrows on the right down corner to make the space bigger or smaller. At the end of the menubar u can see a "play-icon" which gets the hidden menuitems.
but how?
That’s a built-in feature of the MenuBar component. You need to set an explicit width for the component, for example setWidth("100%"). You can see it in the example source (click the (i) icon in the top right corner and open “Source” tab).
I got a Accordion embedded into a normal Panel. The Accordion size is half the current screen size.
Now if I add content (tab) to the Accordion, the Accordion itself contains a caption followed by the content and I can see the content clearly.
If I add more than, say about 30 tabs, I can only see the caption, cause it takes also space from the Accordion.
Now my question is, how can I set the tabs content size, that I always can see the content or is it possible to show the scrollbar of the underlying Panel, cause it is not showing up.
EDIT
Here is a screenshot of many tabs added to the accordion:
I can not scroll an if I click onto an item, it won't expand.
I solved it by using a TabSheet. It is not the best solution, but okay for me. Here is the reported bug link: https://dev.vaadin.com/ticket/18219
I am currently trying to get the tabs on the tab pane to be rotated 90 degrees and visible completely.
My attempt has ended in this
Image
I was able to rotate it by adding a rotate styling to the tab itself, but i cannot resize the anchorpane, or tab at all.
After googling for a long time, I could only find this http:// javafx-jira.kenai.com/browse/RT-19547. It says that the only way they could do it is to "put the text into the tab's 'Graphic' to achieve this". I'm not sure what that means or how to accomplish that.
My end goal is to create tabs that have the same shape and feel as these (image)
In this solution:
http://oreilly.com/pub/a/mac/2002/03/22/vertical_text.html
The text was painted vertically and tried as an icon on the tab. This way you don't have to modify JTabbedPane you just use a custom Icon in the tab.
Of course you would also have to specify the tab placement to be on the Left.
Shortly: i want to position a dialog in the middle of the screen and not in the middle of the page.
I have a problem positioning a dialog with primefaces. My Dialog is usualy in the middle of the screen and if the height of my page is not bigger than my screen its ok. But if there is a scroll bar and the height is for example 3 times my screen (e.g. 3072 in a 1280*1024 resolution), the Dialog is displayed at position 1536, which is out of my screen. As the background is frozen, the only way i can do something is by refreshing or leaving the page.
Any idea?
Use attribute position:
position="center"
Other possible values are:
top
bottom
left
right
right,top
right,bottom
left,top
left,bottom
You can use html .
-Create div element.Firstly hide it
When you want to show it,change z-index and display of div element.
-You can use size that you want
My idea :)
On my page I have a panel which is hidden by default. I can show it via myPanel.setVisible(true) when necessary. After this the height of the window is increased and the window scrollbar appears.
The problem is that the window is not scrolled to the bottom automatically, which is a desired behaviour. How can I fix it? I just want to scroll my page to the bottom.
I know Window.scrollTo (LEFT, TOP) can help me. But the problem is that I dont know how can I calculate the height of the page relative to the top - the second parameter I need to provide to this method. I really tried numerous ways:
Window.getClientHeight();
Document.get().getScrollHeight();
Document.get().getBody().getOffsetHeight();
Document.get().getBody().getAbsoluteBottom();
First two of them do not change their value after the hidden panel becomes visible. The second pair gives me 0 and 8 (???) values.
So how can I solve my issue?
ps
If the situation is a bit different and I have a div with a scrollbars, not the window scrollbars, is it possible to scroll it to the bottom programmatically?
You can use setVerticalScrollPostion API and set the position of the scroll
Is it simple Panel or some subclass of it.
In any case, try first with:
int top = myPanel.getAbsoluteTop();
and then scroll to some value aggregated with top.
From API:
public int getAbsoluteTop()
Gets the object's absolute top position in pixels, as measured from the browser window's client area.
For scrolling down the document, you should use the scrollTo method in Window object, i.e.:
Window.scrollTo(0, Window.getScrollTop() + Window.getClientHeight());
You actually do not need to know the size of the page to scroll to it's bottom. Just use
Window.scrollTo(0, Integer.MAX_VALUE);
At least this always worked for me.
If you want , you can create a widget handle with an id.
For example : widget.getElement().setId("scrollPanel");
Then you can scroll the view on the widget with Document.get().getElementById("scrollPanelFooter").scrollIntoView();
It's simpler!