manually set focus for tag library

108 阅读1分钟

https:///wiki/display/WEBCUIF/Tag+Library+FAQ#TagLibraryFAQ-HowcanIsetthefocustoanInputfieldorDDLBinapage%3F

  1.  对于利用chtmlb实现的page,wiki上介绍的方法只有在下列两个条件同时满足时才生效:
    

a. 只针对input field和drop down list这两种UI element生效。其他如button, text area 无效。

b. 必须当input field或drop down list处于edit mode时才生效,见上图。

  1.  如果用thmlb实现UI page,的确可以在html里面用focus attribute,
    

但是用thtmlb做UI: a. 使用了thtmlb tag的UI element在configuration里面是不可见的。对于客户来说他看到的UI上部分element可配置,部分不可配置,这种behavior很confusing。 b. 使用thtmlb之后,因为ui element没有和model node 或value node绑定,导致以前有framework支持的很多基本功能都需要手动实现, 比如在input field里面输入值之后点button,要想取得用户输入,还得写下面的代码:

所以不建议仅仅为了支持ui element的focus,就把目前的chtmlb全部用thtmlb rework一遍。
要获取更多Jerry的原创文章,请关注公众号"汪子熙":