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

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
主站蜘蛛池模板: 敦化市| 军事| 区。| 漯河市| 荥经县| 施秉县| 汶川县| 姜堰市| 桐庐县| 花莲县| 曲松县| 炎陵县| 孟津县| 灯塔市| 丘北县| 新民市| 浏阳市| 修水县| 托克托县| 红桥区| 项城市| 华亭县| 长岛县| 托克逊县| 四川省| 涿鹿县| 桐城市| 沙河市| 阜宁县| 聂拉木县| 苏尼特左旗| 南乐县| 翁源县| 祁连县| 银川市| 屏东县| 清河县| 甘泉县| 任丘市| 轮台县| 太原市|