我有一個富文本編輯器一個非常簡單的彈出窗口:將焦點設置到豐富:編輯在豐富:modalPanel當模式面板彈出
<rich:modalPanel id="commentFormPanel" width="640" height="480">
<f:facet name="header">
<h:panelGroup>Comment</h:panelGroup>
</f:facet>
<h:form id="commentForm">
<rich:editor id="commentContent" width="620" height="440"
theme="simple" viewMode="visual"
value="#{commentHome.content}" />
</h:form>
</rich:modalPanel>
是否有可能將焦點設置在富人:編輯時模態面板彈出?
有人建議使用這樣的:
tinyMCE.execCommand('mceFocus',false,'commentForm:commentContent');
我試過,但沒有奏效。有沒有人有辦法解決嗎?謝謝。
更新:
我試了幾件事情:
一)。
<rich:editor id="commentContent" width="620" height="440"
theme="simple" viewMode="visual">
<f:param name="auto_focus" value="commentForm:commentContent" />
</rich:editor>
b)。
<rich:modalPanel onshow="tinyMCE.get('commentForm:commentContent').focus();">
都沒有工作。
謝謝馬克。你是明星。 –