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

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
主站蜘蛛池模板: 东乌珠穆沁旗| 诸城市| 霍邱县| 内丘县| 玛曲县| 株洲市| 阜南县| 育儿| 南城县| 凤冈县| 清河县| 德化县| 扶风县| 乐清市| 彭泽县| 丽江市| 正定县| 上杭县| 广东省| 庆阳市| 嘉义县| 平定县| 东方市| 枞阳县| 阳山县| 沁阳市| 浏阳市| 濮阳县| 竹山县| 祁阳县| 孟津县| 宁国市| 凌海市| 福建省| 延庆县| 望谟县| 岳阳市| 阜新市| 扎鲁特旗| 板桥市| 红原县|