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

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
主站蜘蛛池模板: 涞源县| 黄陵县| 稻城县| 通辽市| 斗六市| 安塞县| 孟州市| 敖汉旗| 新龙县| 佳木斯市| 海晏县| 芜湖市| 澄迈县| 博野县| 安国市| 调兵山市| 新宁县| 轮台县| 读书| 泰来县| 图木舒克市| 蒙自县| 封丘县| 丹阳市| 鄄城县| 荥阳市| 丹东市| 中阳县| 抚顺县| 石门县| 姜堰市| 武威市| 始兴县| 衡南县| 霸州市| 绥阳县| 泌阳县| 宁远县| 邯郸市| 南川市| 安达市|