Vertical Scroll doesn't work with Keyboard arrow up/down - jsf-2

I'm using RichFaces 4.3.5 and when I try to select an option on picklist with keyboard arrow up and down the options focus change but the scroll do not follow.
For example, there are 20 options, you can see 10. I use the arrow and pass by one by one. When I got the 11º position, the scroll doesn't move, so I cant see the 11º.
I don't know if I was clear enough... but this also happens in richfaces showcase.
http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=pickList&skin=blueSky
Try to see the others options with keyboard, the scroll dosn't move.
Does anyone know how can I fix this? Any workaround?
Thank you verymuch
this is how I'm using.
<rich:pickList value="#{filter.subItemsSelected}" listHeight="75" styleClass="#{filter.codigo} hide" addAllText="Adicionar todos" addText="Adicionar" removeAllText="Remover todos" removeText="Remover">
<f:selectItems value="#{filter.subItems}" var="sub" itemValue="#{sub}" itemLabel="#{sub.nome}" />
<f:converter converterId="filtroConverter" />
</rich:pickList>

Related

Xamarin.Forms on iOS: Shrink height of page instead of shifting it up when the softkeyboard appears

Got the problem that the softkeyboard overlaps an entry field placed at the bottom.
XAML code:
<ContentPage.Content>
<AbsoluteLayout VerticalOptions="Fill">
<ScrollView AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,0.9">
<Label Text="Heading" />
</ScrollView>
<Entry x:Name="SearchEntry" AbsoluteLayout.LayoutBounds=".5,1,1,.1" AbsoluteLayout.LayoutFlags="All" Placeholder="Suchen..." ReturnType="Done" />
</AbsoluteLayout>
</ContentPage.Content>
I installed the KeyboardOverlap! plugin via nuget. It shifts the whole page upwards till the entry is visible again. The entry is visible, but the top of the page isn't visible anymore because it's shifted up.
Another often mentioned solution is wrapping the pages's content in a ScrollView. Because I definitively need an AbsoluteLayout as root content, that's unfortunately not a solution.
I'm looking for a solution which shrinks the height of the page and don't just shifts it up when the softkeyboard appears.
Why I need this? The page is filled dynmically with search result based on the entrie's input. If there are only few result, they're not visible because of the page's upward shift. The user could think that there aren't any search results. Displaying a text like 'No search results.' above the entry would be a simple solution but is not an option here.
Using this CustomRenderer class in the iOS project instead of the KeyboardOverlap plugin did the trick.
Don't forget to customize line 14 with your concrete page classname(s) where you need the functionality. Otherwise the renderer is called for all pages in your app!
Many thanks to Jack Hua - MSFT!

Disable page jumping to the top after commandButton is clicked

I got a <h:commandbutton> like
<h:commandButton value="Neuer Abschnitt"
styleClass="btn btn-primary btn-info"
action="#{beitragBearbeitenBean.erstelleAbschnitt}" />
Well, I click onto the button, the method is called and after that, the page is jumping to the top (provied you are not at the top!)
Interestingly, a
<f:ajax execute="#form" />
does offer a little jump up.
How can I avoid a jump, generally?
an <h:commandButton> doess a full post of the page, no ajax stuff. So it is normal to jump back to the top of the same page (assuming your action returns null or is void). The <f:ajax> makes it refresh the form and most likely jumps to the top of the form (if the button you use is also in that form). Updating parts of the form (e.g. a panel inside the form) and not update the button since it can stay ourtside the panel most likely will cause that you stay at the same spot. But if the size of the panel changes, it might not (but then you can e.g. make your pannel scrollable so the button will not move).

Why arrows keys do not work inside icefaces dataTable textEntry inside cell

I use icefaces 3 ace:dataTable and inside column I use ace:textEntry. When I try to change value inside ace:textEntry I noticed arrows keys do not work. So it is not possible to change cursor position inside column textEntry using left, right keys. Why?
<ace:dataTable value="#{myBean.items}" var="row"
paginator="true" paginatorPosition="top" rows="5">
<ace:column headerText="Item">
<ace:textEntry value="#{row.itemValue}"/>
</ace:column>
</ace:dataTable>
The arrows key do not work because ace:dataTable uses paginator. After removing paginator="true" arrows keys works again.

For iOS, Safari, VoiceOver, how do I get VoiceOver to read custom radio buttons?

I have a custom radio button that has a colorized and larger circle for the button. It's implemented using CSS as found in http://webdesign.tutsplus.com/articles/quick-tip-easy-css3-checkboxes-and-radio-buttons--webdesign-8953
However, when you have display:none in your CSS for the radio button, it confuses VoiceOver and the element is no longer read as a radio button even though the <input> type is 'radio'.
<input type="radio" value="1" id="rad1" name="station"><label for="rad1"><span></span>Helium</label>
<input type="radio" value="2" id="rad2" name="station"><label for="rad2"><span></span>Hydrogen</label>
input[type="radio"]
{
display:none;
}
I tried adding role='radio' to the <input> tag but that didn't help. When VoiceOver doesn't think it's a radio button, then you lose valuable interaction information. VO no longer says "radio button" or "1 of 4" or "checked".
All I can think of is not using display but rather using position and left to force the original radio button circle to be off the display.
input[type="radio"]
{
position: absolute;
left: -1em;
}
This does seem to work but doesn't seem "right". Is there something more elegant? Typically, with screen readers, you don't want to move an element off the visible display because with a screen reader, you can still put your focus on the item through various navigation techniques.
Also, when the circle itself is just pushed off the display, VoiceOver still knows about it and draws its focus rectangle to include the item that's off the display. This causes the rectangle to span all the way to the left edge.
Edit: Using left:-1em doesn't work either because it causes the display to scroll to the item that's off the screen when you swipe with VoiceOver on. My next attempt is to not hide the radio buttons (ie, don't use display:none) but leave the buttons there but cover them up with the background image used for the buttons (as explained in the webdesign url). This seems to work. I have
left:-20px;
position: relative;
for my <span> tag (which is where the image is displayed) and that causes the image to be displayed on top of the radio button circle.
So the end result is that, visually, you don't see the native radio button circle but rather see my image circle, and VoiceOver still thinks everything is a radio and announces "1 of 4" and "checked".
I didn't mark this as my answer to my own question because it still feels like a hack. It sounds like a bug with VoiceOver that it doesn't announce the element as a radio button.
display:none and visibility:hidden will hide content from screen readers. Using an absolute position off the screen is called "Screen reader text", this will hide the content visually but still have it read by a screen reader. This is true for all desktop and mobile screen readers.
So if you use display:none your radio button will be ignored, this is correct behaviour. The usual solution would be to place the radio button off the screen, but you are right that VoiceOver then places the focus on the left edge of the screen. Other (desktop) screen readers won't do that, it's just a weird behaviour of VoiceOver (imho a bug in VoiceOver). I wouldn't worry about this too much as this is just how VoiceOver works, but obviously your own suggested solution (placing the radio button behind the image) is possible in this case and is far better as the visual VoiceOver focus is then in the correct place. I wouldn't call it a "hack" - at least not any more that the very common practice of "screen reader text" is essentially just a hack.
Note there are often situations where you need to add some extra information for screen readers like VoiceOver where you don't have an image to hide the text behind, then placing the text off the screen may be the only option and the visible VoiceOver focus at the edge of the screen is a trade-off you need to accept.
A good summary of different techniques how to hide content can be found here: http://webaim.org/techniques/css/invisiblecontent/
Another option is to use role="radio" on the element you want screen readers to focus as the radio button. You'll want to make sure you add aria-checked, aria-disabled, etc as needed. Lastly, you can use aria-hidden on the real radio button to make screen readers ignore them.
More info. about role="radio": https://www.w3.org/TR/wai-aria-1.1/#radio
I use CSS to hide the actual <input type=radio/> under the <label>-graphic by using z-index: 2; or something else higher then the <input>'s z-index on the <label>.
This is proven to work even on older iOS where pressing the label didn't focus/activate the input.
Another way is to hide the <input type=radio/> by hiding it off-screen like this:
position: absolute;
left: -999em;
(If you minus this could you explain why? This is the most accessible solution for all iOS versions and other User Agents/Assistive Technologies combos)

Silverlight: Restrict RowDetailsTemplate width to it's parent DataGrid's width

I'd like to bind the Width of my RowDetailsTemplate to the Width of my DataGrid, so that the row details are not surrounded with scroll bars.
Here's the problem:
Notice that the RowDetailsTemplate contains hidden content that must be scrolled into view - which is terrible. The user must drag the scroll bar at the very bottom bottom of the DataGrid in order to see the rest of the row's details - which is very unintuitive. I really want the row details to layout its content such that no scrolling is necessary.
Any suggestions?
Thanks,
Charles
I did find the solution for a similar problem in WPF, you can find it here: DataGrid RowDetails Width problem
I don't know if it works in silverlight, but give it a try.
The answers here felt like a workaround so I did some research and did
find the solution on the Telerik forums, since we use their
RadGridView. Turned out the solution worked for DataGrid as well.
The key is to set the ScrollViewer.HorizontalScrollBarVisibility
property to Disabled, see example below.
<DataGrid ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<Border>
<TextBlock Foreground="White" Text="{Binding RowDetails}"
TextWrapping="Wrap"/>
</Border>
</DataTemplate>
</DataGrid.RowDetailsTemplate> </DataGrid>
Setting the AreRowDetailsFrozen property on my DataGrid to true solved my problem. Example:
<data:DataGrid AreRowDetailsFrozen="True" />

Resources