|
Hello,
I am new to use the RichUI Autocompelete. I have installed the richui plugin and trying to use the autocomplete, but it's not working. I have created a Test.gsp and that has the following code (same sample code of your's) <%@ page contentType="text/html;charset=UTF-8" %> <html> <head><title>Simple GSP page</title> <resource:autoComplete skin="default" /> </head> <body> <g:form> <richui:autoComplete name="person" action="${createLinkTo('dir': 'transaction/searchAJAX')}" /> </g:form> </body> </html> And on my searchAjax Action inside Transaction controller, I have the following code : def searchAjax = { def transactions= Transaction.list // Domain Class //Create XML response render(contentType: "text/xml") { results() { transaction.each { transaction -> result(){ name(transaction.id) } } } } } But when I run the application and type something on the text box, it doesn't call the ajaxSearch action . I don't know what am I missing ??? Please help !!! Am I missing something on my gsp page ? |
|
Hi,
looking at your controller code I think it's just a typo. Instead of: transaction.each it has to to be: transactions.each Hope that helps. Andreas
|
|
Hello,
I fixed that , but still it's not working , I found that, when I load the page , I get some javascript error i.e. "'tagname' is null or not an object".... Is't something that's causing the problem. Since I looked into the viewsource of the page and I found lot of .js files... Thanks Sen
|
|
In reply to this post by Saikat
I am also getting an error when trying to use AutoComplete. In IE6 I get the same error as Saikat, but in Firefox I get the following: elParent.tagName has no properties in autocomplete-min.js at line 18. Does that ring any bells? Thanks,
--------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
Okay, that could be an incompatibility of the Yahoo User Interface library (although it is not mentioned here http://developer.yahoo.com/yui/articles/gbs). I tested the autocomplete component on Firefox 2 and IE 7, but as Yahoo supports IE6 and Firefox 1.5.x it should work in principle. I'll see what I can do.
Andreas
|
|
In reply to this post by Saikat
For what it's worth, I am using Firefox 2 and I tried my app on a co-workers computer with IE7: same problem. I'm hoping that I'm just doing something wrong. Do you know of a more complete example that I can try out? Thanks,
--------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
Could you please post the part of your resulting HTML where the javascript libraries are included?. I can send you a small sample application if you like.
Andreas 2008/1/17, Dave Klein <
[hidden email]>:
|
|
In reply to this post by Saikat
Here's the generated html from my app and yes, I would appreciate a sample app. Thanks,
<body> <link rel='stylesheet' type='text/css' href='/AutoTest/plugins/richui-0.1/css/autocomplete.css' /> <script type='text/javascript' src='/AutoTest/plugins/richui-0.1/js/yui/yahoo-dom-event/yahoo-dom-event.js'></script> <script type='text/javascript' src='/AutoTest/plugins/richui-0.1/js/yui/connection/connection-min.js'></script> <script type='text/javascript' src='/AutoTest/plugins/richui-0.1/js/yui/animation/animation-min.js'></script> <script type='text/javascript' src='/AutoTest/plugins/richui-0.1/js/yui/autocomplete/autocomplete-min.js'></script> <form action="/AutoTest/person" method="post" > Name: <input class='' style='' type='text' id='person' name='person' value=''></input> <div class='searchcontainer yui-skin-sam' id='a352b203ce5eea32f456106b99e3bade0'></div> <script type='text/javascript'> autoCompleteDataSource = new YAHOO.widget.DS_XHR("null('dir': 'person/ajaxSearch')}", ["result", "name"]); autoCompleteDataSource.responseType = YAHOO.widget.DS_XHR.TYPE_XML; autoComplete = new YAHOO.widget.AutoComplete('person','a352b203ce5eea32f456106b99e3bade0', autoCompleteDataSource); autoComplete.queryDelay = 0; autoComplete.prehighlightClassName = "yui-ac-prehighlight"; autoComplete.useShadow = false; autoComplete.minQueryLength = 0; </script> </form> </body>
--------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
Hi,
I guess I figured it out. Try to surround the autoComplete component with a div. If it still doesn't work I'll send you a sample application. <div> <richui:autoComplete name="person" action="${createLinkTo('dir': 'person/searchAJAX')}" /> </div> This is a bug and I'll fix it in version 0.2. I was always using grails default layout which includes <div class="body"> ... </div> so it never happened. Thank you for posting your markup. There also seems to be something wrong with your action attribute: autoCompleteDataSource = new YAHOO.widget.DS_XHR("null('dir': 'person/ajaxSearch')}", ["result", "name"]); it should be something like that: autoCompleteDataSource = new YAHOO.widget.DS_XHR("/richuitest/person/searchAJAX", ["result", "name"]); Hope that helps Andreas
|
|
In reply to this post by Saikat
That got rid of the JS error. I'm having trouble with the action attribute you mentioned. I'll work with that for a while before I bug you again. Thanks so much for your fast responses! Dave
--------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
| Powered by Nabble | Edit this page |
