3

<p:editor>ページの読み込みにフォーカスを自動的に設定するにはどうすればよいですか?

ページが読み込まれた後、エディター パネルをさらにクリックせずにエディターに書き込みできるようにしたいと考えています。

4

1 に答える 1

3

Primefaces は属性「widgetVar」を提供するため、クライアントから要素を取得してフォーカスできます。

<h:head>
        <script type="text/javascript">
            function test() {
                xxx.focus();
            }
        </script>
    </h:head>
    <h:body onload="test()">        
        <h:form id="form">  
            <p:inputText id="rongnk" value="test"/>
            <p:editor widgetVar="xxx" id="nkrong" value="123" width="600"/>  
        </h:form>  
    </h:body>
于 2013-04-15T14:02:35.340 に答える