Hi Daniele,

Am 07.11.2012 um 14:42 schrieb Daniele Corti <ilde...@gmail.com>:

> Hi list, 
> maybe stupid question, but, is there a way to define the default behaviour of 
> WOString?
> 
> I mean WOString binding have as default:
> 
> escapeHTML = true;
> valueWhenEmpty = "";
> 
> In most parts of my WebApps I define escapeHTML = "$false" and valueWhenEmpty 
> = "&nbsp;", not just in Tables, to get correct HTML from WOString.
> 
> The problems occurs when I use components from third parts, where I cannot 
> change the behaviour of subcomponents.
> 
> For Example, I use the Validity.framework's GSVExceptionViewer component, to 
> display errors.
> 
> I've notice errors coming from EOEnterpriseObject.checkConsistency() method 
> have some HTML inside the text (e.g in class

The checkConsistency method does nothing (at least in the standard Wonder 
classes) and seems to be a leftover from Obj-C times of WO.

> User, if email field is empty, return "Please provide a <b>Email</b>."), so 
> when I display the error the HTML is escaped and rendered in the page, that 
> is not very beautiful. 
> To avoid this, I have changed the Component .wod file, in order to use 
> escapeHTML = false; on WOStrings binds, but it would be nice to do this 
> globally.
> 
> So, the question: is there a way to change default behavior of WOString, 
> without subclassing it? For example a key in Properties file?  

You could patch ERXWOString (that internally replaces WOString) and make a pull 
request on github. Or of course you could use your own WOString class by 
calling ERXPatcher.setClassForName(MyOwnWOString.class, "WOString")

> 
> Thanks in advance!
> 
> -- 
> Daniele Corti
> --
> I DON'T DoubleClick



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to