qooxdoo选项卡问题
你好: 我添加了 html 输入并选择丰富的 qx.ui.basic.Label。我已将事件处理程序正确添加到这些 html 控件中。我的问题与选项卡事件有关。 当我在 html 表单控件内时,qooxdoo 会拦截 tab 按键,并将焦点转到下一个 qooxdoo 控件。准确地说,我需要将焦点保持在标签内,让浏览器将焦点放在下一个 html 控件上。 阅读文档,我尝试过: qx.ui.core.FocusHandler.getInstance().addRoot(label); 然后,选项卡按键不会将焦点移出我的标签,但浏览器不会将焦点更改到内部标签控件上...... 有什么建议吗?
Hi:
I've add html inputs and selects to a rich qx.ui.basic.Label. I`ve added correctly event handlers to these html controls. My problem comes with tab events.
When I'm inside the html form controls, a tab keypress is intercepted by qooxdoo and focus go to the next qooxdoo control. I need to keep focus inside my Label, let the browser put the focus on the next html control, to be precise.
Reading docs, I've tried:
qx.ui.core.FocusHandler.getInstance().addRoot(label);
Then the tab keypress don't put focus out of my Label, but browser don't change focus over inside label controls...
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是:使用正确的 qooxdoo 表单小部件(例如 qx.ui.form.SelectBox),并停止滥用 qx.ui.basic.Label 作为 HTML 元素的容器。顾名思义,标签小部件是一个用于保存或多或少短文本片段的小部件。 (这实际上是丹尼尔的回答)。
编辑(根据您的评论):
至于解析,我会让浏览器这样做,通过创建一个文档元素,将其innerHtml设置为生成的HTML,然后使用通常的JS方法遍历生成的DOM树。这应该使解析变得简单。
至于渲染,我会编写一个小型 DOM 解释器来遍历这棵树,并沿途生成 qooxdoo 小部件。如果您知道要处理的内容(标签、文本框、选择框),那应该不会太困难。然后将生成的小部件添加到合适的容器中。
Yes: Use proper qooxdoo form widgets (e.g. qx.ui.form.SelectBox), and stop abusing qx.ui.basic.Label as a container for HTML elements. The Label widget is what the name suggests, a widget to hold a more or less short piece of text. (This was actually Daniel's answer).
EDIT (following your comment):
As for the parsing, I would let the browser do that, by creating a document element, set its innerHtml to the generated HTML, and then just traverse the generated DOM tree with the usual JS methods. That should make parsing straight forward.
As for the rendering, I would then write a small DOM interpreter that traverses this tree, and generates qooxdoo widgets along the way. If you know what you're dealing with (labels, text boxes, select boxes) that shouldn't be too difficult. Then add the generated widgets to a suitable container.