Dear all:

I was doing some async calls in T4.

After the components is updated asynchronously, the javascript event
associated with it will by broken.

Thus, I have to specify the "script" component in the "updateComponents"
attribute

However, the script has two parts ---"body" & "initialization".

My question is : 

1. How can I resend just the content in <initialization> to the client? (I
want to optimize the size of async calls)

2. If this is possible, will the javascript event be able to be bound to the
updated components again by resending the <initialization> block "only" ?

The following is the script I'm using:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script PUBLIC "-//Apache Software Foundation//Tapestry Script
Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd";>
<script>
    <include-script
resource-path="/com/live/scriptLib/jQuery/jquery-1.2.2.pack.js"/> 
    <input-symbol key="target" required="yes"/>
    <input-symbol key="tooltipContent" required="yes"/>
    <input-symbol key="offsetx" required="yes" />
    <input-symbol key="offsety" required="yes" />
    <body>
        <![CDATA[

            /* Position the tooltip */
            var positionTooltip = function(event) {
                var tPosX = event.pageX ${offsetx};
                var tPosY = event.pageY  ${offsety};
                $('div.tooltip').css({top: tPosY, left: tPosX});
            };
            
            /* Show (create) the tooltip */
            var showTooltip = function(event) {
                $('div.tooltip').remove();
                var $detail = ${tooltipContent}.html( );
                $('<div
class="tooltip">'+$detail+'</div>').appendTo('body');
                positionTooltip(event);
             };
              
            /* Hide (remove) the tooltip */
            var hideTooltip = function() {
                $('div.tooltip').remove();
            };
            
        ]]>
    </body>
    <initialization>
        <![CDATA[
               /*Attach the event */
               $(document).ready(function() {
                        $('${target}')
                        .hover(showTooltip, hideTooltip)
                        .mousemove(positionTooltip);
               })
        ]]>
    </initialization>
</script>



-- 
View this message in context: 
http://www.nabble.com/-T4.1.*--Update-%3Cinitialization%3E-of-.script-file-only-tp15605738p15605738.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to