https://issues.apache.org/jira/browse/TAP5-569

here, this bug has more js that you should include.  Then you can just use:

Tapestry.activateZone( "vMessage", validLink );


On 3/10/09 8:03 AM, Michael Williamson wrote:
I'm having problems creating a ZoneManager.  Here are is my code.

Component tml

<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
        <t:zone t:id="vMessage" class="errorDiv">
        <p>${message}</p>
        </t:zone>
        <p>  Check</p>
</t:container>

container java

package roa.components;

import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.Link;
import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.RenderSupport;
import org.apache.tapestry5.annotations.ApplicationState;
import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.InjectComponent;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.corelib.components.Zone;
import org.apache.tapestry5.ioc.annotations.Inject;

import roa.business.AppObject;
import roa.business.AssemblyPart;
import roa.business.Validation;
import roa.data.VenderInworkAssyParts;


public class ValidateMessage
{
        @Property
        @Persist
        private String message;
        
        @Property
        @Persist
        private String currentValues;
        
        @ApplicationState
        private AppObject appObject;
        
        @InjectComponent
        private Zone vMessage;
        

        @Inject
     private ComponentResources resources;

     @Environmental
     private RenderSupport renderSupport;

     void afterRender(MarkupWriter writer)
     {
         Link link = resources.createEventLink("actionFromCheck");
         renderSupport.addScript("var validLink = " + link);
     }

        public Object onActionFromCheck()
        {
                        this.message = "New Message";

                return vMessage.getBody();
        }
}

JavaScript

                        var element = document.forms[0].all("check");
                        var zoneObject = Tapestry.findZoneManager(element);
                        zoneObject.updateFromURL(validLink);

the ZoneManager is null.  I have tried serval variations on this code based
on google search. I think I need to remove the ActionLink in the component
tml file and create a new ZoneManager from the zone element and the link but
I can't get that to work ether.


Fernando Padilla wrote:
URL = a url you would build on the serverside using something like:
resources.createEventLink( "".... );


Let me review the background below.. I hope I don't confuse you too much..


Normally:

<t:zone id="zoneId"/>
  activateZone


Generates:Html:

<div id="zoneId">
</div>

  URL activateZone


Generates:Javascript:

1) setup a ZoneManager against the div#zoneId
2) setup a click listener on the actionlink.. to fetch actionlink URL
from tapestry, (which calls the event listener which returns a Block,
and then tapestry renders block.. ), once the URL returns, it squirts
the contents of the results into the appropriate div#zoneId.

step 2 is basically what Tapestry.activateZone would replace.. so you
can do this without relying on an actionlink or form..


mwilliam...@kcp.com wrote:
I would like to use this feature but I can't figure out what url this is.

Fernando Padilla wrote:
that said, any committers want to add a simple function for people to
use?? something like this:

Tapestry.activateZone = function( zoneId, url ) {
        var zoneManager = Tapestry.findZoneManagerFromId( zoneId );
        zoneManager.updateFromURL( url );
}


Inge Solvoll wrote:
var zoneObject = Tapestry.findZoneManager(elementConnectedToZone);

zoneObject.updateFromURL(link);

On Fri, Mar 6, 2009 at 8:16 AM, Andrea Chiumenti<kium...@gmail.com>
wrote:

Hi to avoid me to read all Tapestry js code, could you tell me waht
is/are the js Class and method(s) that replace a zone on a xhr call ?

Thanks,
kiuma

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


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



Quoted from:
http://www.nabble.com/about-T5-javascript-tp22367350p22400998.html

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





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

Reply via email to