我正面临一个问题。我试图将其中一个GUI字段填充为' Y'(选择' Y' N' N'),这会导致触发回调函数。触发回调函数后,其中一个禁用字段将被启用。但是当我尝试通过HTMLUNIT执行此操作时,所需的文本字段不会启用。我正在寻找一种方法,通过它我可以从HTMLUNIT触发回调函数。我正在使用htmlunit 2.17。
以下是字段html标记..
部分端口包括当前BTN
<br/>
<div id="ctl00_ctl00_tabs_OrderPlaceHolder_ctl00_lovPartialPortInclBTN" class="RadComboBox RadComboBox_Windows7" style="font-weight:normal;width:200px;">
<input name="ctl00$ctl00$tabs$OrderPlaceHolder$ctl00$lovPartialPortInclBTN" type="text" class="rcbInput rfdDecorated" id="ctl00_ctl00_tabs_OrderPlaceHolder_ctl00_lovPartialPortInclBTN_Input" value="Y" readonly="readonly" autocomplete="off"/>
<div class="rcbSlide" style="z-index:6000;">
<div id="ctl00_ctl00_tabs_OrderPlaceHolder_ctl00_lovPartialPortInclBTN_DropDown" class="RadComboBoxDropDown RadComboBoxDropDown_Windows7 " style="display:none;">
<div class="rcbScroll rcbWidth" style="width:100%;">
<ul class="rcbList" style="list-style:none;margin:0;padding:0;zoom:1;">
<li class="rcbItem ">
N
</li>
<li class="rcbItem ">
Y
</li>
</ul>
</div>
</div>
</div>
<input id="ctl00_ctl00_tabs_OrderPlaceHolder_ctl00_lovPartialPortInclBTN_ClientState" name="ctl00_ctl00_tabs_OrderPlaceHolder_ctl00_lovPartialPortInclBTN_ClientState" type="hidden" autocomplete="off" value="{"logEntries":[],"value":"N","text":"N","enabled":true}"/>
</div>
以下是触发ID ::
的回调函数ctl00_ctl00_tabs_OrderPlaceHolder_ctl00_lovPartialPortInclBTN_ClientState
Sys.Application.add_init(function(){ $ create(Telerik.Web.UI.RadComboBox,{&#34; _dropDownWidth&#34;:0,&#34; _height&#34;:0,&#34; _isAspNet35&#34;:true,&#34; _postBackReference& #34;:&#34; __ doPostBack(\ u0027ctl00 $ ctl00 $突片$ OrderPlaceHolder $ ctl00 $ lovPartialPortInclBTN \ u0027,\ u0027arguments \ u0027)&#34;&#34; _skin&#34;:&#34; Windows7的&# 34;,&#34; _text&#34;:&#34; N&#34;&#34; _uniqueId&#34;:&#34; ctl00 $ ctl00 $突片$ OrderPlaceHolder $ ctl00 $ lovPartialPortInclBTN&#34;,& #34; _value&#34;:&#34; N&#34;&#34; clientStateFieldID&#34;:&#34; ctl00_ctl00_tabs_OrderPlaceHolder_ctl00_lovPartialPortInclBTN_ClientState&#34;&#34; collapseAnimation&#34;:&#34; {\ &#34;持续时间\&#34; 450}&#34;&#34; expandAnimation&#34;:&#34; {\&#34;持续时间\&#34; 450}&#34; &#34;的ItemData&#34;:[{&#34;值&#34;:&#34; N&#34;&#34;选择&#34;:真},{&#34;值&#34 ;:&#34; Y&#34;}],&#34; selectedIndex&#34;:0},null,null,$ get(&#34; ctl00_ctl00_tabs_OrderPlaceHolder_ctl00_lovPartialPortInclBTN&#34;)); });