| West Wind Web Store .NET 2.0 |
Custom Fields for Item Display Pages
|
Here's how this works. Let's assume you want to handle a Size for special items like TSHIRTS.
If the type field is set, the Web Store performs special processing on the input that is returned from the Item page Post operation, by looking at any HTML POST variable that starts with the type name as a prefix.
You can use any kind of HTML input field, but here you would probably want to create a list with sizes like Large, Medium, Small etc. so a pair of ComboBoxes works best. The following is a short portion of the Long Description for this item:
This quality TShirt is made in the US of A. <select name="shirtSize"> <option>Large <option>Medium <option>Small </select> <select name="shirtColor"> <option>White <option>Grey <option>Black </select>
The Web Store will handle pulling out those values and sticking them into the ExtraText field as a string description so you can display these values. They will look like this:
West Wind Web Connection T-Shirt
Size:Large
Color:White
string Size = LineItem.GetProperty("shirtSize") string Color = LineItem.GetProperty("shirtColor")
return these values back to you. GetProperty() returns null if the value doesn't exist. You can use this in your Validate() code for the business object. Note that the key values are case sensitive and based on the field name you used in your HTML form.
Internally this data is stored in the XML field like this:
<root> <shirtSize>Large</shirtSize> <shirtColor>White</shirtColor> </root>
Note that the Web Store's Item page logic parses any extra fields and automatically adds each value to the ExtraText field by stripping of the prefix (shirt) and using the field name as the 'key' and the value as the value to display.
Last Updated: 11/3/2004 |
Send topic feedback