Hi, I believe this implementation is included in Java 1.4 (and further), but it is definitely missing in 1.3 and earlier and xalan.jar is necessary. It is a good point that I had not considered -- will make a note on T-Deli.
Thank you, - mb ----- Original Message ----- From: "Surya Prakash" <[EMAIL PROTECTED]> To: "Tapestry users" <[email protected]> Sent: Thursday, May 12, 2005 1:13 PM Subject: RE: Using XTiles component > Hi, > > After a very good help from Mind Bridge, figured out what the problem is. > Just posting here, in case somebody encounters the same problem. > > In the Tomcat lib, xalan jar file is not present and this is throwing an > error "javax.xml.transform.TransformerFactoryConfigurationError: Provider > org.apache.xalan.processor.TransformerFactoryImpl not found > at javax.xml.transform.TransformerFactory.newInstance(Unknown > Source) > at > org.mb.tapestry.xtile.XTileService.generateOutputString(XTileService.java:10 > 4)" > > I placed the jar and it is working fine. > > Excellent help and good work from the people over here. > > Thanks once again. > Surya > > -----Original Message----- > From: Surya Prakash > Sent: 11 May 2005 09:33 > To: Tapestry users > Subject: RE: Using XTiles component > > Hi, > > Sorry for a bit vague. > > Configuration: JDK1.5, Tomcat 5.0, Tapestry 3.0.3, IE 6+, Firefox 1+, > Eclipse 3M7, Spindle, X-Tiles jar available from t-deli.com > > Trying to replicate the X-Tiles demo given at given at T-Deli.com on the > local machine using above configuration. > > Problem: I downloaded the source code given at the t-deli site to display a > list of countries onkeyup script using Ajax. The source I am using is given > below: > *********************************** > Application file: > > <application name="AjaxTest"> > > <library id="xtile" > specification-path="/org/mb/tapestry/xtile/xtile.library"/> > > </application> > ************************************ > Home Page > > <html jwcid="@Shell" title="XTile example"> > <body jwcid="@Body"> > > Start typing the name of a country in the field below. <br> > The page will connect to the server and ask for possible completions. > <p> > <form name="f"> > <table cellspacing="0" cellpadding="0"> > <tr> > <td>Country: </td> > <td><input type="text" style="width: 200px" > onkeyup="sendValue(this.value)"/></td> > </tr> > <tr> > <td></td> > <td><textarea name="comps" rows="10" style="width: 200px" > ></textarea></td> > </tr> > </table> > </form> > > <span jwcid="@xtile:XTile" listener="ognl:listeners.handleCallback" > sendName="sendValue" receiveName="receiveCompletions"/> > > <script> > function receiveCompletions(arr) { > document.f.comps.value = arr.join("\n"); > } > </script> > > <span jwcid="@xtile:Timeout"/> > </body> > </html> > **************************************************************** > > Home.java > > package examples; > > import java.util.ArrayList; > import java.util.Collections; > import java.util.Iterator; > import java.util.LinkedHashSet; > import java.util.List; > import java.util.Locale; > import java.util.Set; > > import org.apache.tapestry.IRequestCycle; > import org.apache.tapestry.html.BasePage; > > public class Home extends BasePage > { > private final static int MAX_COMPLETIONS = 10; > > private static Set countries = new LinkedHashSet(); > > static { > System.out.println("Entered in static block"); > Locale[] locales = Locale.getAvailableLocales(); > for (int i = 0; i < locales.length; i++) { > String country = locales[i].getDisplayCountry(); > if (country != null) { > //System.out.println("Country:"+country); > countries.add(country); > } > } > } > > private String[] findCompletions(String typed) > { > System.out.println("Entered in findCompletions and > typed:"+typed); > if (typed.equals("")) > return null; > > typed = typed.toLowerCase(); > > List completions = new ArrayList(); > for (Iterator it = countries.iterator(); it.hasNext();) { > String country = (String) it.next(); > //System.out.println("Country:"+country); > if (country.toLowerCase().startsWith(typed)){ > System.out.println("Added > country:"+country); > completions.add(country); > } > if (completions.size() == MAX_COMPLETIONS) > break; > } > Collections.sort(completions); > > return (String[]) completions.toArray(new > String[completions.size()]); > } > > > public void handleCallback(IRequestCycle cycle) > { > System.out.println("Entered in handleCallback"); > Object[] params = cycle.getServiceParameters(); > if (params.length == 0) return; > > String typed = params[0].toString(); > String[] ret = findCompletions(typed); > for(int i=0; i<ret.length; i++){ > System.out.println("return list:"+ret[i]); > } > cycle.setServiceParameters(ret); > } > > } > ****************************************************** > > As shown in the source, the print statements are printing the list of > countries in the handleCallback and the returned String[] array ret is > correctly set to the service parameters, when I am typing a key but the list > is not shown in the text area in the html page. > > > Thanks in advance. > > Surya > > > -----Original Message----- > From: Jamie [mailto:[EMAIL PROTECTED] > Sent: 10 May 2005 18:17 > To: Tapestry users > Subject: Re: Using XTiles component > > Can you be more specific? It's hard to answer such a general question. > > Surya Prakash wrote: > > Hi, > > > > > > > > I just started working with Tapestry and in my current project need to use > > Tapestry with Ajax. I am trying to understand the working of XTiles > > component and though I was able to send the request, not receiving any > > response back. I am using the demo source given at t-deli. > > > > > > > > Any help will be greatly appreciated. > > > > > > > > Thanks in advance. > > > > > > > > Surya > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
