Re: WebObjects and HTML
Re: WebObjects and HTML
- Subject: Re: WebObjects and HTML
- From: Jonathan Rochkind <email@hidden>
- Date: Mon, 08 Sep 2003 11:50:12 -0500
You can default to " ", but then you need to set the 'escapeHTML' on
every WOString to 'false'. Which means your ordinary non-blank values won't
have their contents escaped either; this may or may not be what you
want. WOString by default escapes all HTML codes; but it can be set to not
do so. I suppose you could even set the 'escapeHTML' binding to a method
which returns true sometimes (usually) but false othertimes (when you are
returning a simple &nbps; as a default empty value).
I guess you discovered that the 'valueWhenEmpty' binding never has HTML
codes escaped, regardless of the value of 'escapeHTML'. I'd consider this
a bug personally; not a very serious bug, but if Apple ever decides it's a
bug and fixes it, your solution will stop working.
I can't think of any solution that will allow you to make your stuff work
without some busywork of going and changing all the relevant
WOStrings. It's just the way WOString works. It's basically a design flaw
in your original design, that you need to fix.
Me, I sometimes deal with this problem (a WOString that may be empty as the
sole contents of a TD; when some browsers will improperly display a TD with
no content whatsoever), not through WOString, but just through putting a
&nbps; in the actual .html file, inside the TD, after the WOString. If the
WOString does have content, it'll end up with an appended to it,
which I can live with. If it doens't have content, there will be only an
in the cell, which is proper.
Also, actually, is an neccesary, or will a plain old space (" ")
suffice? I usually use , but I'm not sure why I do that; I think an
ordinary space will suffice. So you could have your method returning a
value use just a space as a default, and then you don't need to worry about
WOString escaping it.
Hope this helps,
--Jonathan
At 12:18 PM 9/8/2003 -0400, email@hidden wrote:
Setting the valueWhenEmpty attribute of the WOString objects to " "
worked.
Any programmatical ideas are welcome. That is easier to do as it involves
only one line of code
rather than changing attributes of 10 WOStrings.
Thanks,
Raj
email@hidden
Sent by: email@hidden
09/08/2003 11:51 AM
To: email@hidden
cc:
Subject: WebObjects and HTML
just to correct some typos :
I am trying to display a grid in HTML using WebObjects. I am using
NSMutable arrays and WORepetition objects
for the content of the table. Everything works fine.
The question is : What do I need to assign in Java programmatically to a
variable bound to a cell of the table so that the converted HTML generates
in between the <td> and </td> ?
The reason I am asking this is if I default the variable to empty string
or space, the HTML table looks messy.
And I default it to , the converted HTML displays in the
cell !! Any light on this?
Thanks,
Raj
----- Forwarded by Raj Chakravarthi/hq/hjf on 09/08/2003 11:50 AM -----
Raj Chakravarthi
09/08/2003 11:48 AM
To: email@hidden
cc:
Subject: WebObjects and HTML
I am trying to display a grid in HTML using WebObjects. I am using
MSMutable arrays and WORepetition objects
for thhe content of the table. Everything works fine.
The question is : What do I need to assign in Java programmatically to a
variable bound to a cell of the table so that the converted HTML generates
in between the <td> and </td> ?
The reason I am asking this is if I default the variable to empty string
or space, the HTML table looks messy.
And I default it to , the converted HTML displays in the
cell !! Any light on this?
Thanks,
Raj
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.