The EditStatePopup.wo property-level component is listed here. The component has an HTML template (.html
) file, a bindings (.wod
) file, and a source (.java
) file.
EditStatePopup.html
EditStatePopup.wod
EditStatePopup.java
<WEBOBJECTNAME=PopUpButton1></WEBOBJECT> |
PopUpButton1:WOPopUpButton { |
list = stateList; |
selection = state; |
} |
import com.webobjects.foundation.*; |
import com.webobjects.appserver.*; |
import com.webobjects.eocontrol.*; |
import com.webobjects.eoaccess.*; |
public class EditStatePopupextends WOComponent { |
protected String state; |
protected EOEnterpriseObjectobject; |
protected String key; |
protected NSMutableArraystateList; |
public EditStatePopup(WOContextcontext) { |
super(context); |
} |
public void takeValuesFromRequest(WORequest request, WOContext context) |
throws NSValidation.ValidationException{ |
super.takeValuesFromRequest(request,context); |
try { |
object.takeValueForKey(state,key); |
} catch (Exception exception){ |
throw (new NSValidation.ValidationException(“Incorrectstate |
input")); |
} |
} |
public NSArray stateList(){ |
if (stateList == null){ |
stateList = newNSMutableArray(new Object[] { |
"AL","AK", "AZ", "AR", "CA","CO", "CT", "DE", "FL","GA", |
"HI","ID", "IL", "IN", "IA","KS", "KY", "LA", "ME","MD", |
"MA","MI", "MN", "MS", "MO","MT", "NE", "NV", "NH","NJ", |
"NM","NY", "NC", "ND", "OH","OK", "OR", "PA", "RI","SC", |
"SD","TN", "TX", "UT", "VT","VA", "WA", "WV", "WI","WY" |
}); |
} |
return stateList; |
} |
public String state() throwsException { |
state = (String)object.valueForKey(key); |
return state; |
} |
public void setState(StringnewState) throws Exception { |
state = newState; |
} |
} |
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-07-11)