| 103 | === S3Summary === |
| 104 | |
| 105 | The '''S3Summary''' meta-method handler is implemented in modules/s3/s3summary.py. |
| 106 | |
| 107 | By default, S3Summary is assigned to the '''summary''' URL method, for all request methods and formats. |
| 108 | |
| 109 | If called with a URL query variable "w", the request will be forwarded to the widget at this index position (counting from 0): |
| 110 | |
| 111 | {{{ |
| 112 | # URL for the method handler of the second widget |
| 113 | /eden/org/organisation/summary?w=1 |
| 114 | }}} |
| 115 | |
| 116 | The index position can be inferred from the widget_id (HTML element ID assigned by S3Summary), e.g. "summary-0" indicates index position 0 - so that widgets can send Ajax-requests to their respective back-end method via the summary URL. |
| 117 | |
| 118 | Without the "w" parameter, the request is executed by S3Summary itself, sequentially invoking all configured widget handlers (full page load). |
| 119 | |
| 120 | === Widget Handlers === |
| 121 | |
| 122 | S3Summary does not render the widgets itself, but calls the {{{widget()}}} function of the specified method handler, with the signature: |
| 123 | |
| 124 | {{{ |
| 125 | widget(r, method=method, widget_id=widget_id, visible=visible, **attr) |
| 126 | }}} |
| 127 | |
| 128 | The parameters '''r''' (S3Request) and '''attr''' (controller attributes) are the same as for {{{apply_method()}}}. |
| 129 | |
| 130 | The '''widget_id''' contains the HTML element ID that shall be assigned to this widget (contains the widget's index position), and '''visible''' is a boolean indicating whether the widget is initially visible or not. |
| 131 | |
| 132 | If the specified method does not implement a widget() function, S3Summary will raise an "Unsupported Method" exception (HTTP 405). |