Introduction

A WOString represents itself in the HTML page as a dynamically generated string.

Usage

WOString {
  value=aString;
  [formatter=formatterObj;]
  [escapeHTML=aBoolean; ]
  [dateformat=dateFormatString;]
  [numberformat=numberFormatString;]
  [valueWhenEmpty=emptyString;]
}

Bindings

value

Text to display in the HTML page. value is typically assigned an java.lang.String object, an object that responds to a description message by returning an java.lang.String, or a method that returns an java.lang.String. The java.lang.String's contents are substituted into the HTML in the place occupied by this dynamic element.

escapeHTML

If escapeHTML evaluates to true, the string rendered by value is converted so that characters which would be interpreted as HTML control characters become their escaped equivalent (this is the default). Thus, if your value is "a <b>bold</b> idea", the string passed to the client browser would be "a <B>bold</B> idea", but it would display in the browser as "a <b>bold</b> idea". If escapeHTML evaluates to false, WebObjects simply passes your data to the client browser "as is." In this case, the above example would display in the client browser as "a bold idea". If you are certain that your strings have no characters in them which might be interpreted as HTML control characters, you get better performance if you set escapeHTML to false.

formatter

An instance of an NSFormatter subclass to be used to format object values for display as strings. This attribute should specify a variable containing (or method returning) a preconfigured formatter object.If a user enters an "unformattable" value, WOString passes the invalid value through, allowing you to send back an error page that shows the invalid value.

dateformat

A format string that specifies how value should be formatted as a date. If a date format is used, value can be assigned an NSTimestamp object (if it is assigned an java.lang.String object, it is stored as the string representation of an NSTimestamp object). If the element's value can't be interpreted according to the format you specify, value is set to null. See the NSTimestamp class specification for a description of the date format syntax.

numberformat

A format string that specifies how value should be formatted as a number. If the element's value can't be interpreted according to the format you specify, value is set to null. See the NSNumberFormatter class specification for a description of the number format syntax.

valueWhenEmpty

A string that is substituted for value when value is the empty string.

Examples

Java methods

WOD-style

 

Inline bindings (WOOGNL)

 

Related documents

ERXWOString

  • No labels