From: Anjo K. <an...@us...> - 2005-08-06 19:30:04
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16361 Modified Files: ERXWOForm.java Log Message: added disabled binding on ERXWOForm Index: ERXWOForm.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXWOForm.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ERXWOForm.java 19 Jul 2005 13:34:51 -0000 1.13 --- ERXWOForm.java 6 Aug 2005 19:29:55 -0000 1.14 *************** *** 25,28 **** --- 25,29 ---- * detail, though and shouldn't be relied on. * <li> it adds the <code>secure</code> boolean binding that rewrites the URL to use <code>https</code>. + * <li> it adds the <code>disabled</code> boolean binding allows you to omit the form tag. * </ul> * This subclass is installed when the frameworks loads. *************** *** 36,39 **** --- 37,41 ---- WOAssociation _fragmentIdentifier; WOAssociation _secure; + WOAssociation _disabled; public ERXWOForm(String name, NSDictionary associations, *************** *** 44,47 **** --- 46,50 ---- _fragmentIdentifier = (WOAssociation) _associations.removeObjectForKey("fragmentIdentifier"); _secure = (WOAssociation) _associations.removeObjectForKey("secure"); + _disabled = (WOAssociation) _associations.removeObjectForKey("disabled"); } *************** *** 83,87 **** public void appendToResponse(WOResponse response, WOContext context) { ! boolean inForm = context.isInForm(); context.setInForm(true); --- 86,90 ---- public void appendToResponse(WOResponse response, WOContext context) { ! boolean wasInForm = context.isInForm(); context.setInForm(true); *************** *** 89,93 **** String elementName = elementName(); ! boolean shouldAppendFormTags = !inForm && (elementName != null); if (shouldAppendFormTags) --- 92,97 ---- String elementName = elementName(); ! boolean disable = _disabled != null && _disabled.booleanValueInComponent(context.component()); ! boolean shouldAppendFormTags = !disable && !wasInForm && (elementName != null); if (shouldAppendFormTags) *************** *** 101,105 **** _appendCloseTagToResponse(response, context); } ! context.setInForm(false); if(_fragmentIdentifier != null) { Object value = _fragmentIdentifier.valueInComponent(context.component()); --- 105,109 ---- _appendCloseTagToResponse(response, context); } ! context.setInForm(wasInForm); if(_fragmentIdentifier != null) { Object value = _fragmentIdentifier.valueInComponent(context.component()); |