Hi Jason.

Hate to see a first post go unanswered. ;-)

Two paths lie before you. (That I see.)
If you're using Tapestry 4, the first path is blocked off.

T3's PropertySelection had a renderer parameter which
has been deprecated and removed, sadly. With this you
had control over the component's rendering, and could
for example output radio buttons instead of a drop-down.

You could have written a renderer that output the usual
PropertySelection tags, but for your options, used
writer.printRaw() instead of writer.print().

Anyway, you can achieve your goal by copying the source
(java and jwc) for Tapestry's PropertySelection component
to your project directory, then renaming and hacking it.

(Look at the Insert component to see how its "raw" works.)

Add this to your new MyPropertySelection.jwc:
  <parameter name="raw" type="boolean" direction="in">
        <description>
        If false (the default), then HTML characters in the value are escaped.  
If
        true, then value is emitted exactly as is.
        </description>
  </parameter>

In the java file, you can either just hack it or derive
from PropertySelection and delete methods you don't need.

Add the new parameter:
    public abstract boolean getRaw();

You'll need to hack (or override) renderFormComponent().
Look for this line:
    writer.print(model.getLabel(i));

Change it to:
    if (getRaw())
        writer.printRaw(model.getLabel(i));
    else
        writer.print(model.getLabel(i));

Hope that helps.
Cheers,
Nick.


Jason Moody wrote:
> Hey all -   First time post for me.  
> 
>  
> 
> I have some html characters in a property selection model which Tapestry is
> escaping (ie &ndash is becoming &amp;ndash).  How can I preserve the html
> formatting? (ie raw=true).
> 
>  
> 
> <option value="540">Cost&ndash;Effectiveness</option>
> 
>  
> 
> Cheers, Jason 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to