-
Notifications
You must be signed in to change notification settings - Fork 767
Documentation update for page parameters [WTF-2288] #10472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
stdagkalakis
wants to merge
10
commits into
mendix:development
Choose a base branch
from
stdagkalakis:wtf-2288-doc-update-for-primitive-and-optional-page-parameters
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d95dee9
WIP: Add page parameter page and screenshots
stdagkalakis a27ecb4
Review: Address review comments, update parameter page text, adds map…
stdagkalakis 0930f54
Review: fix more comments
stdagkalakis b8c37e9
Edit
ConnorLand ed2e0cd
Add references to page parameters doc page
stdagkalakis 6d32f32
Review: Remove excess sentences, adjust text
stdagkalakis ee44a3c
Review: replace object wording with value to be more generic
stdagkalakis 1d771be
edit
ConnorLand 7b4499d
Format
ConnorLand 6198ea9
edit
ConnorLand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
content/en/docs/refguide/modeling/pages/page/page-parameter.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| --- | ||
| title: "Page Parameters" | ||
| url: /refguide/page-parameter/ | ||
| weight: 70 | ||
| #If moving or renaming this doc file, implement a temporary redirect and let the respective team know they should update the URL in the product. See Mapping to Products for more details. | ||
| --- | ||
|
|
||
| ## Introduction | ||
|
|
||
| Parameters are the means by which you pass data to your page. When a page is loaded, the parameters are filled with the current values. | ||
|
|
||
| To use an object or primitive value in your page, define a parameter. In the image below, the parameter is named **CustomerName**, is of type string, is not required, and has a default value of an empty string `''`: | ||
|
|
||
| {{< figure src="/attachments/refguide/modeling/pages/page/page-parameter.png" alt="use an object or primitive value" class="no-border" >}} | ||
|
|
||
| ## Properties | ||
|
|
||
| ### Name | ||
|
|
||
| * **Name** — The name of the parameter. | ||
|
|
||
| ### Data Type | ||
|
|
||
| The data type of a parameter defines the type of the value that it expects. Possible data types are **Objects**, and **Primitives** such as `Boolean`, `Date and time`, `Decimal`, `Enumeration`, `Integer/Long`, and `String`. | ||
|
|
||
| Default: *Object* | ||
|
|
||
| ### Argument {#argument} | ||
|
|
||
| Argument determines whether it is **Required** or **Optional** to [pass an argument](#passing-arguments) to the parameter when opening the page. If it is required it is mandatory to supply an argument for that parameter when opening a page. | ||
|
|
||
| ### Default Value | ||
|
|
||
| When argument is set to **Optional**, a default value can be set. The default value is used if no [argument is passed](#passing-arguments) to the parameter. Given the example below, if no argument is passed for `CustomerName`, the page will open with the parameter set to `''`: | ||
|
|
||
| {{< figure src="/attachments/refguide/modeling/pages/page/page-parameter-default-value.png" alt="no argument example" max-width=70% >}} | ||
|
|
||
| {{% alert color="info" %}} | ||
| The default value is used when the argument is omitted during modeling. Not when the argument value is `empty` during runtime. | ||
| {{% /alert %}} | ||
|
|
||
| ## Passing Arguments {#passing-arguments} | ||
|
|
||
| Arguments are passed to page parameters when a page is opened. For example, using a **Show page** action [on a widget event](/refguide/on-click-event/#show-page) or in a [microflow](/refguide/show-page/). For each parameter the page has an argument can be configured. It is only necessary to pass arguments to [required parameters](#argument): | ||
|
|
||
| {{< figure src="/attachments/refguide/modeling/pages/page/page-parameter-mappings.png" alt="example of passing arguments" width="500px" >}} | ||
|
|
||
| ### Variable Arguments | ||
|
|
||
| Variable arguments are used to pass parameters from the context to the page. This is done by selecting from the available variables on the page presented in the dropdown. **Optional** parameters do not require an argument and can be omitted by selecting `(None)` : | ||
|
|
||
| {{< figure src="/attachments/refguide/modeling/pages/page/page-parameter-argument-variable.png" alt="example of variable arguments" max-width=70% >}} | ||
|
|
||
| ### Expression-Based Arguments | ||
|
|
||
| This method allows users to use functions and follow associations within the expression to set the argument values. Using expressions for arguments provides flexibility in setting values and improves the functionality of pages. | ||
|
|
||
| In the example below, the page has a parameter **AnimalName** which is populated by an expression extracting the **Name** member of the provided **Animal** object: | ||
|
|
||
| {{< figure src="/attachments/refguide/modeling/pages/page/page-parameter-expression.png" alt="example expression-based arguments" width="500px" >}} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+28.7 KB
...c/attachments/refguide/modeling/pages/page/page-parameter-argument-variable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+51.3 KB
static/attachments/refguide/modeling/pages/page/page-parameter-default-value.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.6 KB
static/attachments/refguide/modeling/pages/page/page-parameter-expression.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24 KB
static/attachments/refguide/modeling/pages/page/page-parameter-mappings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.