0

xhtml の jsf2.0 の Jquery オートコンプリートは正常に動作しますが、select 関数でバッキング Bean に値を設定しようとすると、設定されません。

<div class="ui-widget" style="font-size: 0.9em; padding-left: 0.3em;"  >
                        <label for="organizatiosSelectAuto">Representative Organization: </label>
                        <h:inputText id="organizationSelectAuto"/>
                    </div>
<h:inputText id="orgIDHidden" value="#{letterMBean.orgID}" style="" immediate="true"    onchange="submit()" valueChangeListener="#{letterMBean.orgChanged(this)}"/>

$(function() {
        var availableTags = #{jqueryClientList.arrayObj} ;
        $( '#organizationSelectAuto' ).autocomplete({
            source: availableTags,
            minLength: 2,
            select: function( event, ui ) {    
             alert("id"+ui.item.id);
              document.getElementById('housefrm:orgIDHidden').value = ui.item.id;
              alert("input Text vlaue"+document.getElementById('housefrm:orgIDHidden').value);
            }
        });
    });
4

1 に答える 1

0

どういうわけか、選択後にjquery関数でフォームを送信する必要があるため、機能し始めました

<h:commandButton id="populateOrgId" action="#{letterMBean.orgChanged}" style="display: none" >     </h:commandButton> document.getElementById('housefrm:populateOrgId').click();
于 2012-07-12T22:36:19.420 に答える