jsf输入按键问题 [英] jsf enter key pressed problem

查看:54
本文介绍了jsf输入按键问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有两个按钮的xhtml弹出页面.这两个按钮在其后备bean中都有actionListener方法.当用户单击Enter时,我如何确保第一个按钮actionListener方法被调用.

i have a xhtml popup page which has two buttons.The two buttons have actionListener methods in their backing beans. When the user clicks enter how can i ensure that the first buttons actionListener method gets called.

推荐答案

几个框架都提供了一个标签来允许这样做,例如,< s:defaultAction/> http://seamframework.org/"rel =" nofollow noreferrer> Jboss Seam .它只是向您的页面添加了一段javascript,以监听回车键.

Several frameworks provide a tag to allow for this, for example <s:defaultAction/> from Jboss Seam. It is just adds a piece of javascript to your page that listens for the enter key.

如果您不使用Seam或类似产品,则可以自己添加javascript-例如

If you aren't using Seam or similar, then add the javascript yourself - for example something like this

这篇关于jsf输入按键问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆