官术网_书友最值得收藏!

Adding action buttons

Forms can have buttons to perform actions. These buttons are able to run window actions such as opening another form or running Python functions defined in the model.

They can be placed anywhere inside a form, but for document-style forms, the recommended place for them is the <header> section.

For our application, we will add a button to clear a done task. This button will run the do_clear_done object method:

<header> 
  <button name="do_clear_done" type="object" 
          string="Clear Done" /> 
</header> 

The basic attributes of a button consist of the following:

  • string with the text to display on the button
  • type of action it performs
  • name  is the identifier for that action
  • class is an optional attribute to apply CSS styles, like in regular HTML
主站蜘蛛池模板: 嘉黎县| 西林县| 民县| 河池市| 安溪县| 大埔区| 宜章县| 怀安县| 湖北省| 英超| 桂林市| 靖宇县| 南宁市| 改则县| 南靖县| 崇州市| 称多县| 琼中| 邢台县| 云和县| 资源县| 安福县| 唐河县| 延津县| 洞口县| 铅山县| 石家庄市| 桦川县| 陆川县| 济宁市| 光泽县| 古交市| 马尔康县| 兴安县| 抚州市| 清水县| 中牟县| 镶黄旗| 弥勒县| 任丘市| 云梦县|