[
https://issues.apache.org/jira/browse/TAPESTRY-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617612#action_12617612
]
Martin Papy commented on TAPESTRY-2541:
---------------------------------------
HLS said this :
Tapestry renders content as a lightweight DOM, not a character stream (as
Tapestry 4 did). The approach I'd take is two fold: I would start a new
element inside beginRender() and store the Element object inside a component
field. Inside afterRender(), I would visit the context of the element, looking
for Text nodes that I could change.
What's missing is that the API for Element, Text and Node allows for additions
to a Node (this is how Tapestry adds <link> elements for CSS and <script>
elements for JavaScript to a rendered page), but there's very little support
for otherwise modifying the DOM structure. New API to remove, replace and
reparent DOM nodes would help with what you're trying to accomplish. Again,
more API is needed, but that kind of change is driven by an actual need, either
by the framework, or by people creating JIRA issues.
> A component should be able to access its own body
> -------------------------------------------------
>
> Key: TAPESTRY-2541
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2541
> Project: Tapestry
> Issue Type: New Feature
> Components: tapestry-core
> Affects Versions: 5.0.13
> Reporter: Martin Papy
>
> It would be useful if I want to write a component that needs to manipulate
> its body... A trivial example would be a "stripwhitespace" component :
>
> <t:stripwhitespace>
>
> My string with too
>
> many white spaces
>
> </ t:stripwhitespace>
>
> In that case I would like to access the <t:body /> string to remove some
> spaces...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]