精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2011-01-07
最后修改:2011-01-07
一,所属命名空间不同
<h:input value="测试" type="button" forward="onSetting" xmlns:h=" http://www.w3.org/1999/xhtml"/ >
<n:input value="测试" type="button" forward="onSetting" xmlns:n="native"/>
<button label="测试" id="btnSubmit" forward="onSetting"></button>
/** Adds to the ID spaces, if any, when ID is changed. * Caller has to make sure the uniqueness (and not auto id). */ private static void addToIdSpaces(final Component comp) { final String compId = comp.getId(); if (comp instanceof NonFellow || isAutoId(compId)) return; //nothing to do if (comp instanceof IdSpace) ((AbstractComponent)comp).bindToIdSpace(comp); addFellow(comp, getSpaceOwnerOfParent(comp)); }
这段有趣的代码
if (comp instanceof NonFellow || isAutoId(compId)) return; //nothing to do
意思是排除符合NonFellow接口的组件,排除由zk自动生成id的组件 public class HtmlNativeComponent extends AbstractComponent implements DynamicTag, Native { //................ } public interface Native extends NonFellow { //................ }
<?xml version="1.0" encoding="utf-8"?> <window xmlns:w="client" xmlns:n="native" xmlns="http://www.zkoss.org/2005/zul" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd" apply="IndexController"> <h:input value="测试" type="button" forward="onSetting" xmlns:h="http://www.w3.org/1999/xhtml"/> <n:input value="测试" type="button" forward="onSetting" xmlns:n="native"/> <button mold="os" label="测试" forward="onSetting"></button> </window>
['zul.wgt.Button','oW6Q3',{$onClick:true,prolog:'\n\t',label:'测试'},[],'os']]]]]); 3,如果子组件的第一个组件是native组件getLastChild方法, 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
浏览 3933 次