我们正在调整我们的Intranet Web应用程序以符合WCAG 2.0标准.该应用程序具有复杂控件的列表,但我无法读取屏幕读取列表中的任何内容,但labelDisplay或whats由列表的labelFunction返回.
下面是一个简单的例子,屏幕阅读器和listBox读取"labelOne",列表中每个项目的labelFunction结果.
<?xml version="1.0"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:access="accessibility.*">
<fx:Script><![CDATA[
private function listLabelFunction(item : Object) : String {
return item.one;
}
]]></fx:Script>
<s:VGroup>
<access:Label id="labelOne" text="This text will be read out!"/>
<s:List hasFocusableChildren="true" labelFunction="listLabelFunction">
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer>
<fx:Script><![CDATA[
import mx.controls.Alert;
]]></fx:Script>
<s:HGroup id="hGroup">
<access:Label id="labelDisplay" text="{data.one}"/>
<access:Label id="labelTwo" text="{data.two}"/>
<s:Button id="button" label="{data.button}" click="Alert.show('Ok!')"/>
</s:HGroup>
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
<s:dataProvider>
<mx:ArrayCollection>
<fx:Object one="one" two="two" button="ok"/>
<fx:Object one="une" two="deux" button="ok"/>
<fx:Object one="uno" two="due" button="ok"/>
<fx:Object one="um" two="dois" button="ok"/>
</mx:ArrayCollection>
</s:dataProvider>
</s:List> …Run Code Online (Sandbox Code Playgroud) 我想使用PDFBox 2.0创建一个单选按钮组,我能够创建3个单选按钮,但是我不知道如何对它们进行分组(PDFBox 1.8,使用PDRadioCollection,但2.0没有。)。
如何使用PDFBox 2.0创建单选按钮组?
这是我当前的代码:
PDDocument document = new PDDocument();
PDPage page = new PDPage(PDRectangle.A4);
document.addPage(page);
PDAcroForm acroForm = new PDAcroForm(document);
acroForm.setNeedAppearances(true);
document.getDocumentCatalog().setAcroForm(acroForm);
PDResources res = new PDResources();
COSName fontName = res.add(PDTrueTypeFont.load(document, new FileInputStream("C:/Windows/Fonts/arial.ttf"), StandardEncoding.INSTANCE));
acroForm.setDefaultResources(res);
acroForm.setDefaultAppearance('/' + fontName.getName() + " 10 Tf 0 g");
PDPageContentStream contents = new PDPageContentStream(document, page);
List<String> options = Arrays.asList("a", "b", "c");
for (int i = 0; i < options.size(); i++) {
PDRadioButton button = new PDRadioButton(acroForm);
button.setPartialName("RadioButton" + options.get(i));
PDAppearanceCharacteristicsDictionary fieldAppearance …Run Code Online (Sandbox Code Playgroud)