Spry with AutoSuggest
I am new to spry and I have been able to get autosuggest to
work without a problem. Except that now, I want to search the same
xml file using multiple searches with multiple search fields at the
same time. I want to have about 6 different search fields using
autosuggest. These search fields search the same xml file. But, I
want each search field to search under a different column. I am
creating an intranet. And, thus, I have no link to post to the
outside. I am using an Microsoft Access file with over 5,000
records. These records are mechanical drawings. And, each record
has around 30 columns that an individual can search for a
particular record. I want to be able to establish around 6 separate
search fields that search the same xml file. As an individual types
in a search field the repeat region shows the current hits. And,
when, the individual searches the other field the repeat region
continues to dwindle down to narrow down the search. I hope this
makes sense. I do have it working with one field. I just want to
add 5 more search parameters or fields to search through the other
columns simutaneously.
In your showDIV function add Spry.Data.initRegions(); after you updated the innerHTML.
This tells Spry that theres a new spry:region on the page
Similar Messages
-
Spry.Widget.AutoSuggest
I am using the Spry.Widget.AutoSuggest as part of another
object. I have the details VERY close, but am missing a small
detail somewhere, and while I think I've tried everything, I'm
still missing something.
In my init, I have the following code:
quote:
* Callbacks used for Predictive Search -------Fails
Spry.Widget.PredictiveSearch.prototype.regionCallback =
Object;
Spry.Widget.PredictiveSearch.regionCallback.prototype.onPostUpdate
= function(notifier, data)
alert("onPostUpdate called for " + data.regionID);
var typedText = this.predictiveSearch.typedTextField.value;
boldTextInChildDivs( data.regionNode, typedText );
this.setMatchIgnoreCase( typedText );
resetSessionTimeoutCheck();
self = this;
var regionCallback = this.regionCallback;
var suggestionsDiv = this.suggestionsDiv;
alert(self.suggestionsDiv)
Spry.Data.Region.addObserver( self.suggestionsDiv,
self.regionCallback );
When I type in the field, everything works as expected,
except that the suggestions div is not populated (it shows as an
empty div in firebug). The alert inside the region callback never
fires, so there is something wrong with how I am creating either
the addObserver, or the function itself. If I make this a function,
and use the 3rd parameter, AND make it a child of the window with a
unique name, it works fine... The idea was to try to make this a
little more like Spry.Widget.CollapsiblePanel in how the callbacks
are handled.
If you're wondering why I'm doing it this way, I am trying to
optimize some pages which use this widget several times per page,
and currently have it hard coded on the page (this is being pulled
into a separate javascript file.)
Thanks in advance.The partial answer is that I was using incorrect syntax. I
started going through the SimpleAutosuggest, and found the
following:
quote:
Spry.Data.Region.addObserver(regionID, { onPostUpdate:
function(notifier, data) {
self.attachClickBehaviors();
Which was basically the syntax I was looking for, which
allows me to use the object notation instead of the function
notation, and call through an object that each autosuggest object
is tied to.
However, it brings me back to my original problem. I've gone
through the Region Observer Notifications documentation here:
http://livedocs.adobe.com/en_US/Spry/SDG/help.html?content=WS57937FB2-D8C1-424d-B3E4-655FD 7A7899B.html
... and in another place, I read that in a callback, you cannot
pass variables because it will run the call back immediately, and
not when you expect it to. That seems to be my problem, but
regardless of if I pass parameters, I get no call back when I
expect it. If I pass parameters, I get the call back immediately,
but not later, if I don't pass parameters, I never get the
callback.
It's got to be something dumb, but I don't see what it is,
and unfortunately, I have no way of putting the code outside our
firewall until it goes live. :(
Thank you for trying. -
Spry.Widget.AutoSuggest is not working (1.6)
Hi Everyone,
I been trying to get the Autosuggest widget to work for a
while now with no result. I have an XML data set created and it is
displaying out the results on my page, however, when it comes to
start the Autosuggest, Firebug catches an error saying that the
Spry.Widget has no properties. And IE7 an expected char ";" in char
5 od that same line.
I wam adding my code, hoping someone can help me out solve
this little bug.
Thanks.
<head>
<script language="JavaScript" type="text/javascript"
src="../SpryAssets/xpath.js"></script>
<script language="JavaScript" type="text/javascript"
src="../SpryAssets/SpryData.js"></script>
<script language="JavaScript" type="text/javascript"
src="../SpryAssets/SpryAutoSuggest.js"></script>
<link href="../SpryAssets/SpryAutoSuggest.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript">
var ds1 = new Spry.Data.XMLDataSet("spryxmltest.php",
"/Manuals/ManualsContained");
</script>
</head>
<body>
<div id="mySuggest" class="container" style="float:
left;">
<form method="get" action="test.php">
<input type="text" id="ModelsContained"
name="ModelsContained"/>
<div id="resultsDIV" spry:region="ds1">
<div spry:repeat="ds1"
spry:suggest="{ds1::ModelsContained}">
<div class="list">{ModelsContained}</div>
</div>
</div>
</form>
</div>
<script type="text/javascript">
var theSuggest = new
Spry.Widget.AutoSuggest('mySuggest','resultsDIV','ds1','ModelsContained',
{hoverSuggestClass: "hover", minCharsType: 2, containsString: true,
maxListItems: 20});
</script>
</body>Hi,
if you get that error Spry.Widget has no properties, this
means that the spryAutosuggest.js file is not correctly included in
page. Please check if you have the good path to this js file.
thanks,
Diana -
Hello, I am having a little trouble getting the autosuggest
to work. No errors come up in firebug but I get no suggestions
displaying.
My code on the browser is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-2" />
<script language="JavaScript" type="text/javascript"
src="xpath.js"></script>
<script language="JavaScript" type="text/javascript"
src="SpryData.js"></script>
<script language="JavaScript" type="text/javascript"
src="SpryAutoSuggest.js"></script>
<link href="SpryAutoSuggest.css" rel="stylesheet"
type="text/css" />
<script language="JavaScript" type="text/javascript">
var ds1 = new
Spry.Data.XMLDataSet("C:\Inetpub\wwwroot\tasker_state\spry\suggest\test.xml",
"staff/staffmember");
</script>
</head>
<body>
<div id="testSuggest">
<input type="text" name="product" />
<div id="resultsDiv" spry:region="ds1">
<ol>
<li spry:repeat="ds1"
spry:suggest="{fname}">{fname}</li>
</ol>
</div>
</div>
<script type="text/javascript">
var theSuggest = new
Spry.Widget.AutoSuggest("testSuggest","resultsDiv", "ds1","fname",
{ containsString: true });
</script>
</body>
</html>
(This is made in a .cfm file)
I have looked this over and over and can't quite nail why
there are no suggestions displayed on the page as you type.
ThanksI tried to just make the dataset and display:
<script language="JavaScript" type="text/javascript">
var ds1 = new Spry.Data.XMLDataSet("
http://localhost/tasker_state/spry/suggest/test.xml","staff/staffmember");
</script>
</head>
<body>
<div id="myRegion" spry:region="ds1">
<ol id="repeatList">
<li spry:repeat="ds1">{fname}</li>
</ol>
</div>
is the code on the browser - this however doesn't work
either -
Spry with DW insert, modify and delete behaviors
I posted this question before and didn't get a response. I'm
wondering if there is any documentation available for using Spry
with DW insert, modify and delete behaviors? I'd like to be able to
perform these functions without having to go from list to master to
detail page as in traditional ASP etc. According to Alex July at
Linecraft this is one of "many hidden features" in Spry.
http://www.linecraft.com/b2/index.php?p=28&c=1"LAGooner10" <[email protected]> wrote in
message
news:fk71ad$5c7$[email protected]..
>I posted this question before and didn't get a response.
I'm wondering if
> there is any documentation available for using Spry with
DW insert, modify
> and
> delete behaviors? I'd like to be able to perform these
functions without
> having to go from list to master to detail page as in
traditional ASP etc.
Here you can find an article that covers data update:
http://www.adobe.com/devnet/dreamweaver/articles/edit_data_in_ajax.html
The server-side code is CFML, but the concept is the same.
A more complete demo, with search, insert, update and delete
is available
here (code only, no article):
http://www.massimocorner.com/spry/dynamic_spry.zip
Massimo Foti, web-programmer for hire
Tools for ColdFusion and Dreamweaver developers:
http://www.massimocorner.com -
Has anyone had any luck integrating Spry with Drupal 6.x?
I found some support for Drupal 5 such as this module:
http://drupal.org/project/spry
Thanks in advance for any pointers.
DaveHi,
You are really close.
Give the first UL an ID:
<ul id="MenuBar1" class="MenuBarHorizontal menu" >
and add the other class.
After the list markup, add a constructor:
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1");
//-->
</script>
And then attach the required files to the head:
<script src="SpryAssets/SpryMenuBar.js"
type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css"
rel="stylesheet" type="text/css" />
Here it is working:
http://www.dbooth.net/spry/menu.htm
Hope this helps,
Don -
Spry With Cold Fusion + Tutorials
Hi,
I want to try Spry with cold fusion . Can anyone help me on
getting some tutorials?>
http://www.adobe.com/devnet/dreamweaver/articles/edit_data_in_ajax.html
A more advanced demo application, without tutorial, but with
more advanced
features, is now available here:
http://www.massimocorner.com/spry/dynamic_spry.zip
Massimo Foti, web-programmer for hire
Tools for ColdFusion and Dreamweaver developers:
http://www.massimocorner.com -
Using Spry with large amounts of data
I was wondering if it is plausible to use spy's Auto suggest
feature with queries that return around 18,000 rows of data.
What are the limitations of using spry with this kind of
overhead?
My current Situation
I currently have a cfc that returns a query which is then
converted to xml using a toXML function and then loaded into spry.
At this time the xml that is created only contains around 500
rows but when this is all hooked up to spry's auto suggest feature
i am experiencing very slow load time.
What am i doing wrong? My end result would like to be a
lookup to over 18,000 employeesin your text box, include an onChange attribute (i think it's
supported) like this:
onChange="yourCustomCall(yourformid)"
Then each time that the text box is changed, a new spry call
will be made to the server.
Be warned though: This, like all other AJAX calls, can lead
to very high server load. each time you make a change in that text
box, you are making a CF call. Be sure your environment can scale
to handle that load if it is a high-use site. -
Generate Photo Gallery XML for Spry with Adobe Bridge
Wanted to post a note to what I've discovered/worked out -- a
way to
generate a very useful photos.xml from Adobe Bridge. If you
use Bridge,
it's very easy to add titles, keywords, ratings -- all kinds
of metadata
that one might use in a photo gallery. Here it is in case
anyone wants
to use.
The script is based on one I found at the Adobe User to User
Bridge
Scripting Forum for exporting a CSV file.
Note 1: this particular script doesn't take into account
CDATA that
might exist in your metadata, like ampersands in your title.
I've just
avoided using those, but you could also have the script write
out a
CDATA node for that info instead.
Note 2: this script does not write out a thumbpath,
thumbwidth or
thumbheight attribute. But usually the thumbpath is the exact
same as
the regular "path" attribute, and the thumbwidth and
thumbheight are
just a ratio of the regular "width" and "height" attributes.
I added a
bit of JS to the gallery.js file to calculate those before
growing the
thumbnail on rollover.
Personally I'm using keywords as categories and titles as
captions and
sorting by rating (stars in Bridge), so here's the .jsx file
I created.
The script should be saved to the folder "StartupScripts" in
Program
Files/Common Files/Adobe.
Hope this is useful for others too!
#target bridge
if (BridgeTalk.appName == "bridge" ) {
// create menu
var menu = MenuElement.create( "command", "Export XML File",
"at the end
of Tools");
menu.onSelect = function(m) {
try {
// ask for the name of the output file
var f = File.saveDialog("Export XML file to:", "XML
File:*.XML");
if ( !f ) { return; }
// open filestream and write first line
f.open("w");
f.writeln("\<photos\>\r\r");
// get a list of all the visible thumbnails in Bridge
var items = app.document.visibleThumbnails;
for (var i = 0; i < items.length; ++i) { var item = items
f.writeln("\<photo path = \"" + item.name + "\"" + "\r" +
"width = " +
"\""+ getWidth(item) + "\"" + "\r" + "height = " + "\""+
getHeight(item)
+ "\"" + "\r" + "rating = " + "\""+ getRating(item) + "\"" +
"\r" +
"categories = " + "\""+ listKeywords(item) + "\"" + "\r" +
"caption = "
+ "\""+ getTitle(item) + "\"" + " \>" + "\r" +
"\<\/photo\>\r\r" ); }
f.writeln("\<\/photos\>");
f.close();
} catch(e) {
function getTitle(tn) {
md = tn.metadata;
md.namespace = "
http://purl.org/dc/elements/1.1/";
var varTitle = md.title;
return varTitle;
function getWidth(tn) {
md = tn.metadata;
md.namespace = "
http://ns.adobe.com/tiff/1.0/"
var varWidth = md.ImageWidth;
return varWidth;
function getHeight(tn) {
md = tn.metadata;
md.namespace = "
http://ns.adobe.com/tiff/1.0/"
var varHeight = md.ImageLength;
return varHeight;
function getRating(tn) {
md = tn.metadata;
md.namespace = "
http://ns.adobe.com/xap/1.0/"
var varRating = md.Rating;
return varRating;
function listKeywords(tn) {
md = tn.metadata;
md.namespace = "
http://ns.adobe.com/photoshop/1.0/";
var Keywords = md.Keywords;
var varKeywords = "" ;
for ( var i = 0; i < Keywords.length; ++i ) { varKeywords
= varKeywords
+ Keywords + ","; }
return varKeywords;I updated the script so it exports an XML file from Bridge
with full
compatibility with the Spry Demo Photo Gallery, to use as
photos.xml.
It's at the same address:
http://www.imagicdigital.com/spry/bridge_export_xml.zip
To Use:
The script goes in the folder "StartupScripts" in Program
Files/Common
Files/Adobe.
Launch Bridge and browse to a folder that contains the files
you want in
your gallery -- the "source" folder, as it were.
Choose the menu command "Tools > Export XML for Spry
Gallery".
Type a name for your XML file in the Save dialog box, choose
a location,
and hit "Save".
In the dialog box that pops up, enter a max length/width for
your
thumbnails, in pixels. Some common sizes are "75" , "100" or
"125".
Hit "OK". You should see an alert pop up telling you "XML
file
successfully created!" -
Issue with autosuggest on a numeric field
I have a form with a CFINPUT that has autosuggest to a cfc.
The cfc runs a query against a varchar field that has only numeric
values. When the match is made and the lis is returned I get an
error (Bind failed for autosuggest CUSTOMER, bind value is not a 1D
array of strings). This only happens with fields that are all
numeric, if the field has any letters or symbols I do not have this
issue.
The data returned is coming back as numeric in scientific
notation (CFC invocation response: [5.159000038E9]) The data is
matching on the phone number and that is what is being returned.
It there a way to correct this issue? Code sample is below.
<cfinput type="text" name="CUSTOMER" size="10"
maxlength="10" value="#CUSTOMER#"
autosuggest="cfc:customerInfo.getCustomerSuggest({DSN},
{cfautosuggestvalue})">
here is the function from the CFC:
<cffunction name="getCustomerSuggest" access="remote"
returntype="array" output="false">
<cfargument name="argDB" type="string" required="yes">
<cfargument name="argCUSTOMER" type="string"
required="yes">
<cfset var myarray = ArrayNew(1)>
<cfquery name="cstInfo" datasource="#argDB#"
maxrows="25">
SELECT customer
FROM custFile
WHERE customer LIKE <cfqueryparam value="#argCUSTOMER#%"
cfsqltype="CF_SQL_VARCHAR">
</cfquery>
<cfloop query="cstInfo">
<cfset arrayAppend(myarray, '#customer# ')>
</cfloop>
<cfreturn myarray>
</cffunction>I don't understand the actual results desired. But I would
make my cffunction returntype a string and get rid of the cfloop
that creates your array. One of my autosuggest cfcs is;
<cffunction name="getJobsearch" access="remote"
returnType="string" output="false">
<cfargument name="term" type="string"
required="false">
<cfset var Jqry = "">
<cfquery name="Jqry" datasource="taxsearchdb">
SELECT J.CompanyName + ' ' + J.CompanyCity + ' ' + C.State +
' ^' + cast(J.JobOrderNumber as varchar) as Jname
FROM jorder J, Companies C
WHERE J.CompanyNumber = C.CompanyRecordNumber and
J.CompanyName LIKE <cfqueryparam cfsqltype="cf_sql_var"
value="#trim(arguments.term)#%">
</cfquery>
<cfreturn ValueList(Jqry.Jname)>
</cffunction> -
Hello all, I am new into spry framework but I managed to use
it with prototype, lightbox and scriptaculous.
The question is how can I access the {ds_RowID} and
{ds_RowCount} from Javascript?
I am using the following that works but returns Script Error.
var myCurRow = eval('{ds_RowID}');
var myTotalRow = eval('{ds_RowCount}');
if ( (myCurRow+1) >= myTotalRow) {
localinit();
I am using the following to create the XML instanses:
var dsGalleries = new
Spry.Data.XMLDataSet("/ssp_director/galleries.php",
"galleries/gallery");
var dsGallery = new
Spry.Data.XMLDataSet("/ssp_director/galleries.php",
"galleries/gallery");
var dsPhotos = new
Spry.Data.XMLDataSet("{dsGalleries::@file}",
"gallery/photos/photo");
Thank you for your help.
YiannisHi Yiannis,
You want to do something like this:
var myCurRow = dsPhotos.getCurrentRow().ds_RowID;
var myTotalRow = dsPhotos.getRowCount();
--== Kin ==-- -
Any plans for adding custom tags, CFCs or anything like that
to make this nice and easy for us ColdFusion folks to use?I've been using ajax in my CF web apps for a few months now.
We're currently using ajaxCFC from Rob Gonda. It's a slick little
implementation and includes a lot of the expected helper functions
to assist with the dynamic population of combo boxes and the like.
Now that Macromedia (er, Adobe - still getting used to that) has
taken on this project, I'm very excited. I look forward to
no-longer having to defend my "experimental" implementation of
ajax. No slight to Rob, but my configuration manager is picky about
software that doesn't have a corporate support tail on it.
There are two things that Rob does in his implementation that
I hope will carry into Spry. First, the ability to seemlessly pass
complex structures between javascript and ColdFusion (most
important - we found other implementations of ajax for CF that
couldn't do this - non-starter) and secondly (closely related), he
includes a convenient little corrective process for his arrays to
make them one-based on the CF side and zero based on the javascript
side. Seems like a little thing, but it's soooo nice not to have to
sweat the array index. -
I have been having problems getting Thickbox or Greybox
windows to popup when I place the anchor tag containing attributes
for these calls inside a spry region. It ends up opening up the
image as a normal hyperlink would.
Once I move this call to either Greybox or Thickbox outside
of the spry region it works fine.
Has anyone had similiar experiences? Fix?
Link
to Example Practive PageI know this is an old post now, but if it helps anyone. I had the same problem as the OP with GreyBox but reading the FAQs on the GreyBox site I found the answer.
To use GreyBox with spry you need to use the onclick= command as detailed in the advanced section in the GreyBox instructions, and not the rel= command as detailed in the basic section.
Example: To show an image inside a spry region, where the image name and image title is retrieved from a HTML dataset, this is the code you would use.
<a href="images/{ds1::img_full}" onclick="return GB_showImage('{ds1::imgTitle}', this.href)">Show Image</a>
The image name is the name the image is saved as and the image title is the title you want displayed in the GreyBox title bar.
Using the onclick= command the image will open in a GreyBox window. Using the rel= command the image will open in a normal blank HTML window.
Hope this helps. -
Spry with Dreamweaver download problem
but I can not find the application...
The folders in the Spry_P1_3_08_11 folders are:
the folders are
articles
data
demos
includes
samples
widgets...
where is the application?
Betsy WallaceBetsyW. wrote:
> OK, I am sorry about that; it is just that neither of my
polite querys on the
> Spry framework for Ajax forum have received any
answers...
That's a pity, because it is really the best place for you to
get an answer.
> It just seems that these attempts
> by software professionals who try to make database
functionality more user
> friendly for web designers such as myself..(and many who
use DreamWeaver), fail
> in their attempt to do so for two reasons, first,
because they continue to
> necessitate too much code and secondly because they fail
to include sufficient
> ,understandable documentation, specifically tutorial
info. that works.
Spry is AJAX, the "hot" topic of the web at the moment, but
in my
opinion, it's not the best way to work with a database. The
problem with
the way that Spry handles dynamic data is everything falls
flat on its
face if someone visits your site with JavaScript disabled.
It's also
useful for search engines. Rather than attempt to work with
XML data
sets, I would suggest that you investigate the Spry widgets,
such as
accordions, tabbed panels, and so on.
The other problem with Spry is that it's still evolving. As a
result,
there is very little documentation. The documentation that
does exist is
pretty mind-numbing, even for somebody like myself with a
reasonable
understanding of JavaScript and other programming languages.
As I
understand it, a new version of Spry is due to be released
very soon (I
did hear a rumour that it was tomorrow). I don't know whether
it will
include updated documentation, but it's definitely on the
Spry
development team's to-do list.
> It is
> very very frustrating for me. I am trying very hard to
learn....I am also
> trying to access the newsgroup link but to no avail...
Is there a way to do it
> from within unison?
I'm sorry, I don't know what unison is. I have subscribed to
it with
Thunderbird, using forums.macromedia.com as the name of the
news server.
> I will refrain from copying this to the
> Spry forum... but they really should read it...
Perhaps this is one that could be duplicated. What I was
concerned about
was different people spending time trying to troubleshoot
your problem.
A good policy is to wait at least 24 hours before posting in
a second
forum. Then begin your post saying that you have tried in xxx
forum, but
got no replies.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
If Spry can be used in any website design software, then how
do I make it work with DW MX?You would have to do it manually, i.e., with no Design view
display.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"TaraLeigh" <[email protected]> wrote in
message
news:g534or$ss4$[email protected]..
> If Spry can be used in any website design software, then
how do I make it
> work with DW MX?
Maybe you are looking for
-
Expired Thawte Certificate killed our app
Today we got several calls from customers saying that they cannot install our application. Adobe Air would install just fine but when Air went to install the app.air file an error popped up saying "Sorry, an error has occurred. The application could
-
Indesign to PDF - Font showing up as small boxes
I am exporting an Indesign Document to PDF. The font in parts of the document are showing up as small boxes, and are not translating to you PDF version correctly when viewed in Adobe Acrobat Pro. The document is too large to outline all they text, I
-
Why can't I access my music in iCloud when I am not on WiFi? It asked me to download the music, won't this take up memory on the iPhone?
-
CS5 Constant Crashes when animating 3D layers
I have been so incredibly frustrated trying to animate 3D layers in Photoshop CS5, with crashes every 5 minutes or less. Even moving the scrubber is followed by 10 seconds of lag. I have a $4,000 MAC PRO ( 2.93 GhZ Quad-Core Xeon, 8 gb DDR3 RAM, Rade
-
How to start netmgr and xhost on linux Fedora Core 5
Hi I have couple of questions. 1. I am having problem in starting netmgr on my linux. I am getting following error. Exiting java.lang.NullPointerException at oracle.ewt.lwAWT.BufferedApplet.<init>(Unknown Source) at oracle.sysman.emSDK.client.appCont