Ana*_* MS 0 jsf hotkeys form-submit primefaces
我有以下片段:
<h:form>
<p:inputText id="inputId" ... />
<p:commandButton id="commandId" ... />
<p:hotkey bind="return ..." />
</h:form>
Run Code Online (Sandbox Code Playgroud)
当我按下Enter的<p:inputText>,我怎么能调用<p:commandButton>使用<p:hotkey>?
该<p:hotkey>不是用来捕捉Enter形式的输入键.它被设计用来捕捉像箭头键和特殊键组合Ctrl,Alt并Shift在整个页面的组合.
你需要<p:defaultCommand>改为.
<h:form>
<p:inputText ... />
<p:commandButton id="commandId" ... />
<p:defaultCommand target="commandId" />
</h:form>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1214 次 |
| 最近记录: |