• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: creating and instantiating formatters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: creating and instantiating formatters


  • Subject: Re: creating and instantiating formatters
  • From: David Holt <email@hidden>
  • Date: Wed, 25 Mar 2009 11:51:32 -0700

I started a thread about this in the last week or two. Use "$false" or it will come back to bite you if you do an auto format in WOLips because the HTML parser will change your unquoted variable to "false". Just saying ;-)

David


On 25-Mar-09, at 11:34 AM, Theodore Petrosky wrote:


thanks.... on a lark I tried

escapeHTML = false

and it worked... must I quote the boolean. it is working without them.

Ted

--- On Wed, 3/25/09, Chuck Hill <email@hidden> wrote:

From: Chuck Hill <email@hidden>
Subject: Re: creating and instantiating formatters
To: "Theodore Petrosky" <email@hidden>
Cc: email@hidden
Date: Wednesday, March 25, 2009, 1:32 PM
<wo:WOString  formatter =
"$hTMLFormtter" value = "$currentNote.noteText" />

add escapeHTML = "$false"

or is that $false?  I don't use inline bindings...


Chuck

On Mar 25, 2009, at 10:23 AM, Theodore Petrosky wrote:


Obviously, I don't understand how to create,
instantiate, or implement a formatter. Here's what I tried.

I created HTMLLineBreakReformatter.java as:

package com.as.utils;

import java.text.FieldPosition;
import java.text.Format;
import java.text.ParsePosition;

@SuppressWarnings("serial")
public class HTMLLineBreakReformatter extends Format
{

@Override public StringBuffer format(Object
object, StringBuffer buffer, FieldPosition pos) {
return
buffer.append(((String)object).replaceAll("\n", "<BR
/>"));

}

    @Override
    public Object parseObject(String
source, ParsePosition pos) {

return null; }

}

Then I imported it into my java for the page:

public HTMLLineBreakReformatter hTMLFormtter;

and in the constructor for the page's java:

public UserMain(WOContext context) {
    super(context);

hTMLFormtter = new
HTMLLineBreakReformatter();
}


then in the WOString in question:

<wo:WOString formatter = "$hTMLFormtter"
value = "$currentNote.noteText" />

the \n's are indeed replaced by <br /> and I see
in the page in question:

I need to see the example here!!!<BR /><BR
/><BR />and again<BR /><BR />and
again<BR /><BR />and again!!!

the HTML page is not interpreting the <br /> as
a new line which means I don't understand something.

I am running out of ideas to try. I should say I feel
that I have run out of ideas.

Thanks for any help...

Ted




_______________________________________________ Do not post admin requests to the list. They will be
ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net


This email sent to email@hidden


--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@hidden)
Help/Unsubscribe/Update your Subscription:
@mac.com


This email sent to email@hidden

_______________________________________________ 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
References: 
 >Re: creating and instantiating formatters (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: Re: [OT] Thank you for letting me participate with NOVA WO
  • Next by Date: Re: JavaClient Common classes
  • Previous by thread: Re: creating and instantiating formatters
  • Next by thread: Check / Force field uniqueness in EOF
  • Index(es):
    • Date
    • Thread