Re: s.autocompleter with JSON Plugin
Am Dienstag, 20. März 2007 schrieb Musachy Barroso: > I think the daily builds are for 2.1 only. If you want to build it: > > http://struts.apache.org/2.x/docs/building-with-maven.html I tried to build tags/STRUTS_2_0_7 as well as trunk. both seem to be broken: [surefire] Running org.apache.struts2.views.xslt.XSLTResultTest 2007-03-20 23:41:57,404 ERROR [XSLTResult.java:365] : Unable to render XSLT Template, 'nofile.xsl' javax.xml.transform.TransformerException: Stylesheet nofile.xsl not found in resources. > The autocompleter tag can be used without the json plugin, check showcase > for examples. Seems to be my only chance, thanks :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s.autocompleter with JSON Plugin
I think the daily builds are for 2.1 only. If you want to build it: http://struts.apache.org/2.x/docs/building-with-maven.html The autocompleter tag can be used without the json plugin, check showcase for examples. musachy On 3/20/07, Piero Sartini <[EMAIL PROTECTED]> wrote: I tried to apply the patch that is in JIRA - but it does not work. I guess it is not only the change in the JavaScript but somewhere in the Java classes as well. Is there a prepackaged 2.0.7 somewhere? Or do I have to build it by myself? Need to present s2 soon and it would be great if I get this to work till then. Regards, Piero Am Samstag, 17. März 2007 schrieb Musachy Barroso: > This was an issue in 2.0.6 and it is fixed on 2.0.7: > > https://issues.apache.org/struts/browse/WW-1659 > > As Dave mentioned in 2.0.6 the autocompleter was expecting an array of > arrays. Now the autocompleter will use the following logic to determine how > to load the data: > > 1. If the response is an array, use it > 2. If the response is an object, and has a field that matches the > "dataFieldName" attribute in the autocompleter, use it. > 3. If the response is an object, and has a field that starts with the > "name" of the autcompleter use it > 4. If a field of type array is found, use it > > so the following cases will work: > > public class MyAction { >private String[][] states; //data here > } > > // #2 > //#3 > //#4 > > regards > musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- "Hey you! Would you help me to carry the stone?" Pink Floyd
Re: s.autocompleter with JSON Plugin
I tried to apply the patch that is in JIRA - but it does not work. I guess it is not only the change in the JavaScript but somewhere in the Java classes as well. Is there a prepackaged 2.0.7 somewhere? Or do I have to build it by myself? Need to present s2 soon and it would be great if I get this to work till then. Regards, Piero Am Samstag, 17. März 2007 schrieb Musachy Barroso: > This was an issue in 2.0.6 and it is fixed on 2.0.7: > > https://issues.apache.org/struts/browse/WW-1659 > > As Dave mentioned in 2.0.6 the autocompleter was expecting an array of > arrays. Now the autocompleter will use the following logic to determine how > to load the data: > > 1. If the response is an array, use it > 2. If the response is an object, and has a field that matches the > "dataFieldName" attribute in the autocompleter, use it. > 3. If the response is an object, and has a field that starts with the > "name" of the autcompleter use it > 4. If a field of type array is found, use it > > so the following cases will work: > > public class MyAction { >private String[][] states; //data here > } > > // #2 > //#3 > //#4 > > regards > musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s.autocompleter with JSON Plugin
This was an issue in 2.0.6 and it is fixed on 2.0.7: https://issues.apache.org/struts/browse/WW-1659 As Dave mentioned in 2.0.6 the autocompleter was expecting an array of arrays. Now the autocompleter will use the following logic to determine how to load the data: 1. If the response is an array, use it 2. If the response is an object, and has a field that matches the "dataFieldName" attribute in the autocompleter, use it. 3. If the response is an object, and has a field that starts with the "name" of the autcompleter use it 4. If a field of type array is found, use it so the following cases will work: public class MyAction { private String[][] states; //data here } // #2 //#3 //#4 regards musachy On 3/17/07, Dave Newton <[EMAIL PROTECTED]> wrote: --- Rohit Dewan <[EMAIL PROTECTED]> wrote: > However, the autocompleter is blank after load. > > Has anyone had success using the JSON plugin with > the autocompleter? I'm getting a JavaScript error: [Exception... "'Error: TypeError: this.data[x][0].toLowerCase is not a function' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "" data: no] (I'm also doing this in JSP w/o the workaround you're using.) The tag docs says that input data must be in the format [["foo":"bar"], ["baz":"quux"]] though, so... I don't know if it will work with the default JSON plugin, and if true that would also imply that you could only load one autocompleter per JSON Action rather than lumping a bunch together (if you wanted to) and the tag would grab the appropriate data by the tag's "name" attribute. d. Don't pick lemons. See all the new 2007 cars at Yahoo! Autos. http://autos.yahoo.com/new_cars.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- "Hey you! Would you help me to carry the stone?" Pink Floyd
Re: s.autocompleter with JSON Plugin
--- Rohit Dewan <[EMAIL PROTECTED]> wrote: > However, the autocompleter is blank after load. > > Has anyone had success using the JSON plugin with > the autocompleter? I'm getting a JavaScript error: [Exception... "'Error: TypeError: this.data[x][0].toLowerCase is not a function' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "" data: no] (I'm also doing this in JSP w/o the workaround you're using.) The tag docs says that input data must be in the format [["foo":"bar"], ["baz":"quux"]] though, so... I don't know if it will work with the default JSON plugin, and if true that would also imply that you could only load one autocompleter per JSON Action rather than lumping a bunch together (if you wanted to) and the tag would grab the appropriate data by the tag's "name" attribute. d. Don't pick lemons. See all the new 2007 cars at Yahoo! Autos. http://autos.yahoo.com/new_cars.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
s.autocompleter with JSON Plugin
I have the following in the body: <@s.url id="foos" value="foosList.action" /> <@s.form theme="ajax" action="addTest" method="add"> <@s.autocompleterModel theme="ajax" href="%{foos}" name="foo" /> <@s.submit value="OK" action="addTest" method="add"/> <@s.submit value="Cancel" action="addTest" method="cancel"/> I have verified that foosList.action returns the following {"foos":{1:"chance",10:"test"}} However, the autocompleter is blank after load. Has anyone had success using the JSON plugin with the autocompleter? Regards, Rohit