Removed extra indentations in code.
This commit is contained in:
@@ -24,7 +24,7 @@ A simple solution to return html content is to use the `WSF_HTML_PAGE_RESPONSE`
|
|||||||
In a `WSF_EXECUTION` descendant, see how to implement the `execute` procedure.
|
In a `WSF_EXECUTION` descendant, see how to implement the `execute` procedure.
|
||||||
|
|
||||||
```
|
```
|
||||||
execute
|
execute
|
||||||
local
|
local
|
||||||
mesg: WSF_HTML_PAGE_RESPONSE
|
mesg: WSF_HTML_PAGE_RESPONSE
|
||||||
do
|
do
|
||||||
@@ -39,8 +39,7 @@ In this case, the html is hardcoded, and written manually.
|
|||||||
Now let's see how to use the WSF widgets on a more advanced usecase, a simple sign-in web form with 2 input fields `username`, `password` and `submit` button.
|
Now let's see how to use the WSF widgets on a more advanced usecase, a simple sign-in web form with 2 input fields `username`, `password` and `submit` button.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
execute
|
||||||
execute
|
|
||||||
do
|
do
|
||||||
-- Basic url dispatching...
|
-- Basic url dispatching...
|
||||||
if request.is_post_request_method then
|
if request.is_post_request_method then
|
||||||
@@ -50,7 +49,7 @@ Now let's see how to use the WSF widgets on a more advanced usecase, a simple si
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
execute_web_form_display
|
execute_web_form_display
|
||||||
local
|
local
|
||||||
mesg: WSF_HTML_PAGE_RESPONSE
|
mesg: WSF_HTML_PAGE_RESPONSE
|
||||||
f: WSF_FORM
|
f: WSF_FORM
|
||||||
@@ -71,12 +70,12 @@ Now let's see how to use the WSF widgets on a more advanced usecase, a simple si
|
|||||||
response.send (mesg)
|
response.send (mesg)
|
||||||
end
|
end
|
||||||
|
|
||||||
execute_web_form_submission
|
execute_web_form_submission
|
||||||
do
|
do
|
||||||
... this will be explain in next section !
|
... this will be explain in next section !
|
||||||
end
|
end
|
||||||
|
|
||||||
new_login_form: WSF_FORM
|
new_login_form: WSF_FORM
|
||||||
local
|
local
|
||||||
f: WSF_FORM
|
f: WSF_FORM
|
||||||
f_set: WSF_FORM_FIELD_SET
|
f_set: WSF_FORM_FIELD_SET
|
||||||
@@ -120,7 +119,7 @@ Indeed `WSF_HTML.process (request, .., ..)` analyze the request, fill the form f
|
|||||||
See
|
See
|
||||||
|
|
||||||
```
|
```
|
||||||
process (req: WSF_REQUEST; a_before_callback, a_after_callback: detachable PROCEDURE [WSF_FORM_DATA])
|
process (req: WSF_REQUEST; a_before_callback, a_after_callback: detachable PROCEDURE [WSF_FORM_DATA])
|
||||||
-- Process Current form with request `req`,
|
-- Process Current form with request `req`,
|
||||||
-- and build `last_data: WSF_FORM_DATA` object containing the field values.
|
-- and build `last_data: WSF_FORM_DATA` object containing the field values.
|
||||||
-- agent `a_before_callback` is called before the validation
|
-- agent `a_before_callback` is called before the validation
|
||||||
@@ -130,7 +129,7 @@ See
|
|||||||
In our previous sample code, `execute_web_form_submission` could be:
|
In our previous sample code, `execute_web_form_submission` could be:
|
||||||
|
|
||||||
```
|
```
|
||||||
execute_web_form_submission
|
execute_web_form_submission
|
||||||
local
|
local
|
||||||
mesg: WSF_HTML_PAGE_RESPONSE
|
mesg: WSF_HTML_PAGE_RESPONSE
|
||||||
l_html: STRING
|
l_html: STRING
|
||||||
@@ -186,8 +185,8 @@ To set validation,
|
|||||||
For instance, in previous sample, accepts only alpha-numeric characters:
|
For instance, in previous sample, accepts only alpha-numeric characters:
|
||||||
|
|
||||||
```
|
```
|
||||||
f_username.set_description ("Only alpha-numeric character are accepted.")
|
f_username.set_description ("Only alpha-numeric character are accepted.")
|
||||||
f_username.set_validation_action (agent (fd: WSF_FORM_DATA)
|
f_username.set_validation_action (agent (fd: WSF_FORM_DATA)
|
||||||
do
|
do
|
||||||
if attached fd.string_item ("username") as u then
|
if attached fd.string_item ("username") as u then
|
||||||
if across u as ic some not ic.item.is_alpha_numeric end then
|
if across u as ic some not ic.item.is_alpha_numeric end then
|
||||||
@@ -237,4 +236,3 @@ For now, the `wsf_html` provides a simple solution to build web form. It is alwa
|
|||||||
Advanced usage could be built on top of the `wsf_html` to include for instance javascript actions, but this is out of the scope of `wsf_html` .
|
Advanced usage could be built on top of the `wsf_html` to include for instance javascript actions, but this is out of the scope of `wsf_html` .
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user