You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Martin Papy (JIRA)" <de...@tapestry.apache.org> on 2008/07/29 01:22:33 UTC

[jira] Created: (TAPESTRY-2541) A component should be able to access its own body

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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-2541) A component should be able to access its own body

Posted by "Martin Papy (JIRA)" <de...@tapestry.apache.org>.
    [ 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-2541) Tapestry DOM needs basic methods to manipulate the DOM post-render

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAPESTRY-2541:
-------------------------------------------

    Summary: Tapestry DOM needs basic methods to manipulate the DOM post-render  (was: A component should be able to access its own body)

Ability to query nodes, change and coelesce text nodes, re-parent elements, etc.

Please confirm this is what you specifically need.

> Tapestry DOM needs basic methods to manipulate the DOM post-render
> ------------------------------------------------------------------
>
>                 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
>            Assignee: Howard M. Lewis Ship
>
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Assigned: (TAPESTRY-2541) A component should be able to access its own body

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship reassigned TAPESTRY-2541:
----------------------------------------------

    Assignee: Howard M. Lewis Ship

> 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
>            Assignee: Howard M. Lewis Ship
>
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-2541) Tapestry DOM needs basic methods to manipulate the DOM post-render

Posted by "Martin Papy (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624027#action_12624027 ] 

Martin Papy commented on TAPESTRY-2541:
---------------------------------------

Yes this is what I need, I think this could be very usefull.

> Tapestry DOM needs basic methods to manipulate the DOM post-render
> ------------------------------------------------------------------
>
>                 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
>            Assignee: Howard M. Lewis Ship
>
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Closed: (TAPESTRY-2541) Tapestry DOM needs basic methods to manipulate the DOM post-render

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAPESTRY-2541.
------------------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0.15

> Tapestry DOM needs basic methods to manipulate the DOM post-render
> ------------------------------------------------------------------
>
>                 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
>            Assignee: Howard M. Lewis Ship
>             Fix For: 5.0.15
>
>
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org