I'm trying to insert an image that will work like a button. With component ice:commandLink all work fine.
<ice:commandLink partialSubmit="true"
title="#{controller.description}"
actionListener="#{controller.actionPerformed}"
styleClass="toolbarButtonText"
immediate="#{controller.action.immediate}"
>
<h:graphicImage value="#{controller.icon!=null?(controller.icon):(sessionContext.styleManager.zeroIcon)}"
border="0" alt="#{controller.description}"/>
<h:outputText value="#{controller.title}"
rendered="#{controller.icon==null}"/>
</ice:commandLink>
But when I try to replace the component with the ace, the picture becomes not clickable, and the click is now triggered on that line, which is specified in the value (by defaul "Default Anchor Label"). How can a remove all text and make picture like a button?
In my case, I do not need to use the ice component and that the page does not reboot after I click the button.
Related
Antd Button
The following code comes from the antd document
import { Button } from 'antd';
ReactDOM.render(
<div>
<Button>Default</Button>
<Button type="dashed">Dashed</Button>
<Button type="danger">Danger</Button>
</div>,
mountNode,
);
Like the default Button, Dashed Button, when you click, you'll have a highlight and border shadow effect.But I want Button to revert to the default state after clicking, rather than clicking elsewhere before it becomes the default state.
This is what happens when I set up the Uploade's click button, which keeps me clicking (highlighted and bordered) when I upload the file successfully or fails, which makes people look a little unusual.Although this detail is acceptable to most people, it still feels a little strange.
I have thought about using the Dragger component of Upload, which can meet my needs on the display. But I want to automatically hide the upload button when the upload content meets the requirements, and Dragger seems to be unsatisfied. So I chose to use the Upload component. After the condition is met, the content in the Upload is made blank, and the hidden effect is achieved. The above situation will occur in the middle of the Button.
I looked at Button's API
and didn't find an action like reset.
Here is my example code. When you click on the Button component, the highlight will not disappear. When you click on the Button upload component, the highlight will not disappear after uploading the file. After clicking on the Dragger component and uploading the file, the highlighting disappears automatically.
Whether there is a good action to reset the Button style.
If you know thank you for answering.Thank you.
You need to customise ant-btn class like so:
.ant-btn:focus {
color: inherit !important;
border: 1px solid rgb(217, 217, 217);
}
Here is the codepen
For a xamarin forms project on my iPhone/iOS (12.4), I'm using ItemTemplate to showing ViewCells of a ListView.
This looks like this:
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid>
...
<Frame
BackgroundColor="{Binding Value, Mode=OneWay, Converter={StaticResource PositionToBackgroundColorConverter}}"
BorderColor="{Binding Value, Mode=OneWay, Converter={StaticResource PositionToTextColorConverter}, ConverterParameter={x:Static model:ItemComponent.Border}}">
...
This works pretty fine, sofar a selected item is not set. When I select an item, the selected row are drawing by the framework, and its background is set to gray. In this state the background of the frame is not drawn correctly. Or the background of the selection "overpainting" the background of the frame.
Do you know a (simple?) method to redraw the Frame, after the selected item is changed?
EDIT:
For example, to easier understanding the problem, I put here an image with two ViewCells. The first ListItem is not selected, the second ListItem is selected. This is a symbolic illustration of unwanted behavior!
When the ListItem is selected it should looks like this here:
I am using the mat-tab-group from https://material.angular.io/components/tabs/overview.(used complex labels approach with ng-template)
The tab contains a name of the tab and a button to close the tab.
Whenever i focus the tab, it reads both aria-labels of name and a button. When tab is focused, it should read only the name but not the close button aria label. When tab is focused currently and then clicking on tab will focus the close button, at this time it should read the close button aria label.
How to do this ?
Code:
<mat-tab-group dynamicHeight [(selectedIndex)]="activeTabIndex" (selectedTabChange)="changetab($event)">
<mat-tab *ngFor="let tab of Tabs; let i = index" [label]="tab.name" [attr.sortColumn]="tab.sortBy" [attr.sortOrder]="tab.sortOrder"
[attr.viewId]="tab.id" [attr.viewObjectID]="tab.viewObjectId" attr.aria-label="{{tab.name}}">
<ng-template mat-tab-label>
<div class="tab-container">
<div class="somestyle">
<span class="tab-name" [matTooltip]="tab.name">{{tab.name}}</span>
</div>
<button mat-icon-button tabindex="0" id="{{tab.id}}" class="close-btn" (keyup)="closeTab($event,view)" (click)="closeTab($event,view)" attr.aria-label="{{closetab}}">
<mat-icon class="material-icons">cancel</mat-icon>
</button>
</div>
</ng-template>
</mat-tab>
The output of this : I am using "jaws" for screen reading tool. When we focus on tab, it reads tab name and close button label ( attr.aria-label="{{tab.name}}" and attr.aria-label="{{closetab}}").
Do you need to use aria-label at all?
The WAI-ARIA Practices document has this at the top of its "Read Me First" section:
No ARIA is better than Bad ARIA
The mat-tab-group examples simply use a text node inside the tab (which is a button with role="tab") for the accessible name. That should be adequate. Let the visual label be the accessible name, if possible.
The only reason you should use aria-label on a button is if the accessible name should be different from the button label. e.g. in cases where only an icon or unicode glyph is used as the visual label, in place of human-readable text.
In all other cases, just put the accessible name in a text node inside the button. (You may of course wrap it in span or other inline elements - as the mat-tab-group example does, if you need more refined styling).
This is true of other GUI controls too, although the visual label mechanism differs between element types. (e.g. The <input> element needs a corresponding <label>, which is both visible and understood by screenreaders because of the for attribute.)
If you must use aria-label, make sure it is on the element that gets focus, otherwise the screen readers will each try to guess what you want the accessible name to be, with unpredictable results. I suspect this is what you are experiencing.
Also, if I am not mistaken, you are adding the 'body' of the tab (including the close box) to the focusable tab itself. This is not the correct structure. Again, let the mat-tab-group example be your guide.
You should be able to overwrite what is read on focusing the entire tab, if you add an aria-label="Your preferred text here" to the tab element.
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).
In a page i am displaying image,desc,etc fileds.whenever click on that small image need to display large size image and close icon also and need to show the blur of the background screen(for no user interaction in background fileds).whenever click on close icon need to show actual data.
How to achieve this?
One way is to have this on your page:
<Grid Name="datagrid">
// your small image and other fields
</Grid>
<Grid Name="imagegrid" Visibility="Collapsed">
// larger image and a button to "close"
</Grid>
On TAP event of the SMALL picture, change the datagrid visibility to collapsed and imagegrid visibility to visible.
On click event of the close button in imagegrid, change datagrid visibility to visible and imagegrid visibility to collapsed.
The second way to do this is to use another page with just a large picture and a close button. When the user taps on the small picture, navigate to that second page, and when the user taps close or back button, navigate back to the first page with small picture and all the fields.