![]() |
Business Internet Services |
|
The Tokens tag is used to concat parameter values into a single value or separate them into new values based in a delmiter char in the input value. The action attribute controls the behavior with "concat" or "separate". The tag can use Parameter or ArrayParamter tags as input to supply the values. The default delimiter is comma but other delimiters can be specified including delim=" " for breaking a value into tokens at space chars and delim="" for combining values together without a delimiter. In this example the runtime Parameter values of Rp tags are combined
into a comma delimited list and stored as a new parameter called "to".
The Tokens tag implements the Parameter interface so it can create a list
and pass it directly to a parent that uses Parameter tags.
In this example an array of values is returned by an Ap tag. The Tokens tag will
combine them into a String with a space between each value.
The Tokens tag can also be used to separate values from a delimited String and
store them under new parameter names. Suppose a webform contained a select list
called userinfo that posted an option value as "username.ID". This is a handy way
of incorporating two fields of info into one option. A Tokens tag on the receiving
page can be used to break the option values apart and store them back into the
request as two separate parameters.
Return to Index Note: We have tried to test all of the code examples but they may contain errors. Any questions, comments,
suggestions, or problems should be sent to info@plands.com. |
|
© 2005 Planetary
Data Systems.
All rights reserved. |