Re: [D2W] Conditionally changing property level components
Re: [D2W] Conditionally changing property level components
- Subject: Re: [D2W] Conditionally changing property level components
- From: Ramsey Gurley <email@hidden>
- Date: Sat, 26 Feb 2011 15:41:19 -0700
On Feb 26, 2011, at 3:25 PM, Mike Gee wrote:
> Thanks for the components, Ramsey!
>
> Is there an easy way to drop the AjaxNotificationCenter onto an ERMODWizardCreationPage without subclassing it (adding aboveDisplayPropertyKeys). Or would having AjaxNotificationCenter extend ERDCustomEditComponent be the better way to go and include in displayPropertyKeys? I am looking to have a selection from a popup (ERD2WEditToOneRelationship) set some text field values. Using the delegate pattern from your example I know my attributes are getting set but so far haven't been able to get the AjaxNotificationCenter on the page.
>
> Thanks
>
> Mike
Are you using the ones in the zip file or the ones in the AjaxLook framework? I would have thought that the following methods would have handled the object and key bindings for a displayPropertyKeys repetitions... Perhaps that solution works better in theory than practice... (^_^)
/**
* Since this component uses synchronization to update observers when the
* d2wContext changes, it cannot be non-synchronizing. However, if we want
* to be able to drop this component anywhere, it needs to be able to
* accept any binding value. So this method simply returns value for key
* from the dynamicBindings dictionary.
*/
public Object handleQueryWithUnboundKey(String key) {
if(log.isDebugEnabled()) {
log.debug("Handling unbound key: " + key);
}
return dynamicBindings().objectForKey(key);
}
/**
* Since this component uses synchronization to update observers when the
* d2wContext changes, it cannot be non-synchronizing. However, if we want
* to be able to drop this component anywhere, it needs to be able to
* accept any binding value. So this method simply adds value for key
* to the dynamicBindings dictionary.
*/
@SuppressWarnings("unchecked")
public void handleTakeValueForUnboundKey(Object value, String key) {
if(log.isDebugEnabled()) {
log.debug("Take value: " + value + " for unbound key: " + key);
}
dynamicBindings().setObjectForKey(value, key);
}
Ramsey
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden