本文整理汇总了Python中pyasm.widget.TextWdg.set_persistence方法的典型用法代码示例。如果您正苦于以下问题:Python TextWdg.set_persistence方法的具体用法?Python TextWdg.set_persistence怎么用?Python TextWdg.set_persistence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.widget.TextWdg
的用法示例。
在下文中一共展示了TextWdg.set_persistence方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_new_tab_wdg
# 需要导入模块: from pyasm.widget import TextWdg [as 别名]
# 或者: from pyasm.widget.TextWdg import set_persistence [as 别名]
def get_new_tab_wdg(self):
widget = Widget()
span = SpanWdg()
swap = SwapDisplayWdg.get_triangle_wdg()
title = SpanWdg("Tab Creation")
span.add(swap)
span.add(title)
span.add_style("float: left")
widget.add(span)
widget.add(HtmlElement.br() )
# add the tab selector
div = DivWdg()
SwapDisplayWdg.create_swap_title( title, swap, div)
tab_text = TextWdg("tab")
tab_text.set_persistence()
span = SpanWdg(css="med")
span.add("Tab: ")
span.add(tab_text)
div.add(span)
# parent
index_text = TextWdg("parent_tab")
index_text.set_persistence()
span = SpanWdg(css="med")
span.add("Parent Tab: ")
span.add(index_text)
span.add(HintWdg("Enter the name of the tab that this will fall under. Leave empty to put on the main tab") )
div.add(span)
# index
index_text = TextWdg("index")
index_text.set_attr("size", "4")
index_text.set_persistence()
span = SpanWdg(css="med")
span.add("Index: ")
span.add(index_text)
span.add(HintWdg("Enter the numeric location for this tab to be placed") )
div.add(span)
WebContainer.register_cmd("CreateTabCmd")
button = IconSubmitWdg("Create Tab", IconWdg.CREATE, True)
div.add(button)
widget.add(div)
return widget
示例2: init
# 需要导入模块: from pyasm.widget import TextWdg [as 别名]
# 或者: from pyasm.widget.TextWdg import set_persistence [as 别名]
def init(my):
search = Search("sthpw/queue")
search.add_order_by("priority desc")
search.add_order_by("timestamp desc")
widget = Widget()
div = DivWdg(css="filter_box")
span = SpanWdg(css="med")
from pyasm.prod.web import SearchFilterWdg
search_filter = SearchFilterWdg(columns=Queue.get_search_columns())
search_filter.alter_search(search)
span.add(search_filter)
div.add(span)
span = SpanWdg(css="med")
priority_wdg = TextWdg("priority_search")
priority_wdg.set_persistence()
priority = priority_wdg.get_value()
if priority:
search.add_filter("priority", priority)
span.add("Priority: ")
span.add(priority_wdg)
div.add(span)
select = SelectWdg("queue_state")
select.set_option("values", "|pending|locked|error|done")
select.set_option("labels", "All|pending|locked|error|done")
select.add_event("onchange", "document.form.submit()")
select.set_persistence()
span = SpanWdg(css="med")
span.add("State: ")
span.add(select)
div.add(span)
queue_state = select.get_value()
if queue_state != "":
search.add_filter("state", queue_state)
user_select = SelectWdg("user_select")
user_select.add_empty_option()
user_search = Search("sthpw/login")
user_select.set_search_for_options(user_search, "login", "login")
user_select.add_event("onchange", "document.form.submit()")
user_select.set_persistence()
div.add("User: ")
div.add(user_select)
queue_user = user_select.get_value()
if queue_user != "":
search.add_filter("login", queue_user)
search_limit = SearchLimitWdg()
search_limit.set_limit(10)
div.add(search_limit)
search_limit.alter_search(search)
widget.add(div)
sobjects = search.get_sobjects()
table = TableWdg("sthpw/queue")
table.set_sobjects(sobjects)
widget.add(table)
my.add(widget)