You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ownedthx <se...@gmail.com> on 2009/06/03 00:41:08 UTC

Serializing a component as the value of a textarea

Hi all,

I have a model that is a tree structure, which I've modeled in Tapestry as
each node being a Component. (I have many possible node types, each with
their own Component, possibly containing n children of other of these node
components).

When I include this tree-structure component directly on the page (by simply
including it in the tml as per usual), everything works great.

But, I can't figure out how I can get the markup associated with my
component into a tapestry textarea.  My goal is to make this textarea a rich
text editor, which is why I'm interested in placing HTML directly into a
textarea to begin with.

Note:  I could render the component to the page invisibly, and use
javascript to copy over the markup, but I'm hoping to find a clean Tapestry
solution to this problem.  Also, I'm trying to avoid using a MarkupWriter
because ideally a web designer can come in and touch the TML files without
having to know Java.

Thanks for any help!
Seth

-- 
View this message in context: http://www.nabble.com/Serializing-a-component-as-the-value-of-a-textarea-tp23842369p23842369.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Serializing a component as the value of a textarea

Posted by ownedthx <se...@gmail.com>.
That sounds dead on with what I need.   I'll give it a try!  Thanks.

The closest *cough* solution I have at the moment is the following template:

<t:form>
        <textarea name="articleTitleText">
            <t:myComponent t:id="myComponent"/>
        </textarea>
</t:form>

Notice I'm using a non-tapestry textarea.  This successfully populates the
form with the right text... but, on submit of the form, for whatever reason
Tapestry is trying to coerce the form contents back into the component (at
least, I think so--I get a 'no coercion for String to custom component'
exception).  I made a quick-and-dirty type coercer that does nothing, just
to get rid of the type coercion exception thrown.  

So definitely I'd like to check out this tapx-templating...

Seth



Ulrich Stärk wrote:
> 
> I haven't worked with it before and thus don't know if it supports what
> you need, but maybe the 
> tapx-templating module may help
> (http://tapestry.formos.com/nightly/tapx/tapx-templating/). 
> Basically you'd want it to render your component structure into a String
> or some other object and 
> bind that as a value to your textfield.
> 
> HTH,
> 
> Uli
> 
> ownedthx schrieb:
>> Hi all,
>> 
>> I have a model that is a tree structure, which I've modeled in Tapestry
>> as
>> each node being a Component. (I have many possible node types, each with
>> their own Component, possibly containing n children of other of these
>> node
>> components).
>> 
>> When I include this tree-structure component directly on the page (by
>> simply
>> including it in the tml as per usual), everything works great.
>> 
>> But, I can't figure out how I can get the markup associated with my
>> component into a tapestry textarea.  My goal is to make this textarea a
>> rich
>> text editor, which is why I'm interested in placing HTML directly into a
>> textarea to begin with.
>> 
>> Note:  I could render the component to the page invisibly, and use
>> javascript to copy over the markup, but I'm hoping to find a clean
>> Tapestry
>> solution to this problem.  Also, I'm trying to avoid using a MarkupWriter
>> because ideally a web designer can come in and touch the TML files
>> without
>> having to know Java.
>> 
>> Thanks for any help!
>> Seth
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Serializing-a-component-as-the-value-of-a-textarea-tp23842369p23852299.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Serializing a component as the value of a textarea

Posted by Ulrich Stärk <ul...@spielviel.de>.
I haven't worked with it before and thus don't know if it supports what you need, but maybe the 
tapx-templating module may help (http://tapestry.formos.com/nightly/tapx/tapx-templating/). 
Basically you'd want it to render your component structure into a String or some other object and 
bind that as a value to your textfield.

HTH,

Uli

ownedthx schrieb:
> Hi all,
> 
> I have a model that is a tree structure, which I've modeled in Tapestry as
> each node being a Component. (I have many possible node types, each with
> their own Component, possibly containing n children of other of these node
> components).
> 
> When I include this tree-structure component directly on the page (by simply
> including it in the tml as per usual), everything works great.
> 
> But, I can't figure out how I can get the markup associated with my
> component into a tapestry textarea.  My goal is to make this textarea a rich
> text editor, which is why I'm interested in placing HTML directly into a
> textarea to begin with.
> 
> Note:  I could render the component to the page invisibly, and use
> javascript to copy over the markup, but I'm hoping to find a clean Tapestry
> solution to this problem.  Also, I'm trying to avoid using a MarkupWriter
> because ideally a web designer can come in and touch the TML files without
> having to know Java.
> 
> Thanks for any help!
> Seth
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org