当前位置: 首页>>代码示例>>Python>>正文


Python DOM.createForm方法代码示例

本文整理汇总了Python中pyjamas.DOM.createForm方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.createForm方法的具体用法?Python DOM.createForm怎么用?Python DOM.createForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyjamas.DOM的用法示例。


在下文中一共展示了DOM.createForm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createForm [as 别名]
    def __init__(self, initialValue="", target="", method="POST", 
                        basePath=None, **kwargs):

        self.id = "rte" + str(hash(self))

        self.setElement(DOM.createForm())
        DOM.setAttribute(self.element, "method", method)
        DOM.setAttribute(self.element, "target", target)

        if not kwargs.has_key('ID'): kwargs['ID'] = self.id
        if not kwargs.has_key('StyleName'): kwargs['StyleName'] = "gwt-RichTextEditor"
        if not kwargs.has_key('Height'): kwargs['Height'] = "600px"
        if not kwargs.has_key('Width'): kwargs['Width'] = "100%"
        Widget.__init__(self, **kwargs)

        JS("""
           var rte = this;
           this.element.onsubmit = function() {
               $wnd.setTimeout(function() { rte.onSave.call(rte) }, 0);
               return false;
           }
        """)

        if basePath is None:
            basePath = "fckeditor/"
        if not basePath.endswith("/"):
            basePath += "/"
        fck = createFCK("fck" + self.id)
        fck.Height = self.getHeight()
        fck.Width = self.getWidth()
        fck.Value = initialValue
        fck.BasePath = basePath
        fck.Config.CustomConfigurationsPath = "../../fckconfig.js"
        fck.pyjsObject = self

        self.loaded = False
        self.saveListeners = []
        self.pendingHTML = None

        html = fck.CreateHtml()
        DOM.setInnerHTML(self.getElement(), html)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:43,代码来源:RichTextEditor.py

示例2: __init__

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createForm [as 别名]
    def __init__(self, target = None, **kwargs):
        global FormPanel_formId

        if hasattr(target, "getName"):
            target = target.getName()

        if kwargs.has_key('Element'):
            element = kwargs.pop('Element')
        else:
            element = DOM.createForm()

        self.formHandlers = []
        self.iframe = None
        self.__formAction = None

        FormPanel_formId += 1
        formName = "FormPanel_" + str(FormPanel_formId)
        DOM.setAttribute(element, "target", formName)
        DOM.setInnerHTML(element, """<iframe name='%s' src="javascript:''">"""\
                                  % formName)
        self.iframe = DOM.getFirstChild(element)

        DOM.setIntStyleAttribute(self.iframe, "width", 0)
        DOM.setIntStyleAttribute(self.iframe, "height", 0)
        DOM.setIntStyleAttribute(self.iframe, "border", 0)

        if target is not None:
            kwargs['Target'] = target

        SimplePanel.__init__(self, element, **kwargs)

        try:
            self.sinkEvents(Event.ONLOAD)
        except:
            # MSHTML doesn't have form.onload,
            # it has onreadystatechange.
            pass
开发者ID:Afey,项目名称:pyjs,代码行数:39,代码来源:FormPanel.py


注:本文中的pyjamas.DOM.createForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。