thanks... I purchased the WOWODC 08 and I reviewing the sessions. Ted
--- On Sun, 3/8/09, Chuck Hill <[email protected]> wrote: > From: Chuck Hill <[email protected]> > Subject: Re: escaping in HTML > To: "Theodore Petrosky" <[email protected]> > Cc: "WebObjects-Dev Apple" <[email protected]> > Date: Sunday, March 8, 2009, 3:26 PM > > On Mar 8, 2009, at 11:59 AM, Theodore Petrosky wrote: > > > > > yes of course... but I know that i need to replace the > "\n" for "<br/>". but I don't see how. > > Well... you DID say "If I just bind the text to a WOText > area". Now you show a WOString. WOText and > WOString are very, very different. Being precise in > your questions will yield more exact answers more quickly. > > > > I seem to recall an example method. > > > > inside my HTML > > > > <webobject name = "NotesRowRepetition"> > > <tr align = "left"> > > <td><wo:WOString value = > "$currentNote.noteText" /></td> > > </tr> > > </webobject> > > > > and the WOD: > > > > NotesRowRepetition: WORepetition { > > > list = notesDG.displayedObjects; > > item = > currentNote; > > } > > > > so that currentNote is from a 'to-many' relationship. > I need to escape the currentNote.noteText for \n > > > > I just don't see how. > > java.text.Format. Get familiar with it, it is a very > useful tool. I covered this in my Best Practices > session at WOWODC 08. > > Here is a simple example > > > /** > * Converts \n to <br/> on output > */ > public class HTMLLineBreakReformatter extends > java.text.Format { > > > public StringBuffer format(Object object, > StringBuffer buffer, FieldPosition position) { > return > buffer.append(((String)object).replaceAll("\n", > <br/>)); > } > > } > > Create an instance in your page and use the formatter > binding of WOString. > > > Chuck > > > --- On Fri, 3/6/09, Miguel Arroz <[email protected]> > wrote: > > > >> From: Miguel Arroz <[email protected]> > >> Subject: Re: escaping in HTML > >> To: "John Huss" <[email protected]> > >> Cc: "Theodore Petrosky" <[email protected]>, > [email protected] > >> Date: Friday, March 6, 2009, 11:56 AM > >> Hi! > >> That shouldn't be needed in text > >> areas... my guess is some kind of line feed > representation > >> problem. Mac (classic), Windows and UNIX all use > different > >> representations for line feeds. I don't recall > what the > >> browser uses, but it's probably different than > what you > >> have in the DB. > >> Yours > >> Miguel Arroz > >> On 2009/03/06, at 16:24, John Huss > >> wrote: > >> How about using > >> string.replace("\n", "<br/>") > >> > >> John > >> > >> On Fri, Mar 6, 2009 at 10:09 AM, > >> Theodore Petrosky <[email protected]> > >> wrote: > >> > >> I know I saw an example somewhere... I just can't > seem > >> to find it again. > >> > >> I have text from my database that has returns > (line > >> feeds). If I just bind the text to a WOText area, > the CRs > >> and LFs are ignored. > >> > >> Can someone point me in the right direction. > >> > >> I need to convert the CR to <BR />... > >> > >> Ted > >> > >> > > > > > > > > > > > > _______________________________________________ > > Do not post admin requests to the list. They will be > ignored. > > Webobjects-dev mailing list ([email protected]) > > Help/Unsubscribe/Update your Subscription: > > http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net > > > > This email sent to [email protected] > > > > --Chuck Hill > Senior Consultant / VP Development > > Practical WebObjects - for developers who want to increase > their overall knowledge of WebObjects or who are trying to > solve specific problems. > http://www.global-village.net/products/practical_webobjects > > > > > > > _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
