1.如何获取RadioBox值
假设在jspx页面中有如下:
<af:selectOneChoice label="checkbox"
binding="#{backing_dp_functionCreate.selectFuncType}"
id="selectFuncType"
value="1"
autoSubmit="true" immediate="true"
valueChangeListener="#{backing_dp_functionCreate.changeFuncType}"
required="false">
<af:selectItem label="View" value="1"
binding="#{backing_dp_functionCreate.selectItem2}"
id="selectItem2"/>
<af:selectItem label="Procedure" value="2"
binding="#{backing_dp_functionCreate.selectItem3}"
id="selectItem3"/>
<af:selectItem label="Function" value="3"
binding="#{backing_dp_functionCreate.selectItem1}"
id="selectItem1"/>
<af:selectItem label="Advanced" value="4" binding="#{backing_dp_functionCreate.selectItem4}"
id="selectItem4"/>
</af:selectOneChoice>
在backing_dp_functionCreate对应的backingbean中有:
private CoreSelectOneChoice selectFuncType;
下面就可以使用得到选中的value, 注意ADF在每次提交的时候会根据selectOneChoice 的binding去同步对应的backingbean的值
String funcType=(String)this.getSelectFuncType().getValue();
2. 如何动态设置Radiobox的值
<af:selectOneChoice simple="true" value="#{row.paramID}"
binding="#{backing_dp_functionChooseParams2.outputText3}" id="outputText3"
label="Label 1" required="true">
<af:forEach var="inparam"
items="#{bindings.findAllInParamsByProjectContext1.rangeSet}">
<af:selectItem value="#{inparam.ID}"
label="#{inparam.paramName}"/>
</af:forEach>
</af:selectOneChoice>
注意:findAllInParamsByProjectContext1来自后台pagedef.xml, 使用rangeSet得到结果集List
<?xml version="1.0" encoding="UTF-8" ?>
<pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="10.1.3.36.73"
id="dp_functionChooseParams2PageDef" Package="oracle.cdc.xbrl.view.pageDefs.dp">
<parameters/>
<executables>
<methodIterator id="findAllInParamsByProjectContextIter" Binds="findAllInParamsByProjectContext.result"
DataControl="FunctionManagerDataControl" RangeSize="-1" BeanClass="oracle.cdc.xbrl.dp.function.XBRLParam"/>
</executables>
<bindings>
<methodAction id="findAllInParamsByProjectContext"
InstanceName="FunctionManagerDataControl.dataProvider"
DataControl="FunctionManagerDataControl"
MethodName="findAllInParamsByProjectContext"
RequiresUpdateModel="true" Action="999"
ReturnName="FunctionManagerDataControl.methodResults.FunctionManagerDataControl_dataProvider_findAllInParamsByProjectContext_result">
<NamedData NDName="projID" NDValue="${userState.currentProjId}"
NDType="int"/>
<NamedData NDName="contextID" NDType="int"
NDValue="#{processScope.context}"/>
</methodAction>
<table IterBinding="findAllInParamsByProjectContextIter" id="findAllInParamsByProjectContext1">
<AttrNames>
<Item Value="ID"/>
<Item Value="paramName"/>
</AttrNames>
</table>
</bindings>
</pageDefinition>
没有评论:
发表评论