Skip to main content
Known Participant
April 21, 2007
Question

Update Spry Table via link in row?

  • April 21, 2007
  • 7 replies
  • 647 views
Hi All,

Anyone know the procedure for doing this? If it's possible?

Basically, I've got a a Spry table with three columns and the 3rd column contains a "Delete" link for every row. I'd like to be able to click that link and have the record associated with that row be deleted and the table data updated without refreshing the page. Massimo Foti wrote an article describing similar functionality here but it involves using a form and I'm not sure how to either make use of it for my needs or modify the concept to work for me.

Thx!
This topic has been closed for replies.

7 replies

MikeyJAuthor
Known Participant
May 1, 2007
May have just answered my own question! I applied it when pulling the data from the db and creating the xml file and it seems to work. Display shows the ampersand as it should as well.

Thx!
Inspiring
May 1, 2007
"MikeyJ" <mikeyj@pttracker.com> wrote in message
news:f17vg3$jd0$1@forums.macromedia.com...
> Ok, so should I be using XMLFormat on all my data as I pull it from the db
> or
> is there a way to incorporate it into your example code so it's done
> automatically?

My sample use this CFML custom tag:
http://www.olimpo.ch/tmt/tag/spryxml/

There are many alternativies, like:
http://ray.camdenfamily.com/index.cfm/2006/7/2/ToXML-CFC--Converting-data-types-to-XML



> Does the process need to be reversed when the data is outputted
> so the user sees an ampersand again and not the ascii version of it?

No.

Massimo


MikeyJAuthor
Known Participant
May 1, 2007
Ok, so should I be using XMLFormat on all my data as I pull it from the db or is there a way to incorporate it into your example code so it's done automatically? Does the process need to be reversed when the data is outputted so the user sees an ampersand again and not the ascii version of it?

Thx,
Mike
Inspiring
May 1, 2007
"MikeyJ" <mikeyj@pttracker.com> wrote in message
news:f17q8t$d98$1@forums.macromedia.com...
> Another quick question Massimo...
>
> Have you ever run into an issue when there is an ampersand in one of the
> fields you are pulling into a Spry dataset? Everything was working ok for
> me
> until someone entered a name like "Bob & Judy" into the Name field and
> then the
> records wouldn't show. The "Loading data..." message would never go away.
> Once
> I narrowed it down and deleted the ampersand everything was ok again.

The ampersand is a special char in XML. You either encode it on the
server-side, or put all your XML text inside CDATA blocks.
If you look at my example, it uses XMLFormat() on the server-side


--
----------------------------
Massimo Foti, web-programmer for hire
Tools for ColdFusion and Dreamweaver developers:
http://www.massimocorner.com
----------------------------


MikeyJAuthor
Known Participant
May 1, 2007
Another quick question Massimo...

Have you ever run into an issue when there is an ampersand in one of the fields you are pulling into a Spry dataset? Everything was working ok for me until someone entered a name like "Bob & Judy" into the Name field and then the records wouldn't show. The "Loading data..." message would never go away. Once I narrowed it down and deleted the ampersand everything was ok again.

Thx,
Mike
MikeyJAuthor
Known Participant
April 28, 2007
Thanks for the help! It was of course, user error....somehow gateway.cfc got placed in a subdirectory. DoH! I finally figured out how to see the errors using Firebug...thx for the hint!
Inspiring
April 22, 2007
"MikeyJ" <mikeyj@pttracker.com> wrote in message
news:f0e17q$mek$1@forums.macromedia.com...
> Anyone know the procedure for doing this? If it's possible?
>
> Basically, I've got a a Spry table with three columns and the 3rd column
> contains a "Delete" link for every row. I'd like to be able to click that
> link
> and have the record associated with that row be deleted and the table data
> updated without refreshing the page. Massimo Foti wrote an article
> describing
> similar functionality
> http://www.adobe.com/devnet/dreamweaver/articles/edit_data_in_ajax.html
> but it
> involves using a form and I'm not sure how to either make use of it for my
> needs or modify the concept to work for me.

What kind of server-side language are you using?

If you use CF, you can find a complete example here:
http://www.massimocorner.com/spry/dynamic_spry.zip

It's more sophisticated than the article you mentioned.


--
----------------------------
Massimo Foti, web-programmer for hire
Tools for ColdFusion and Dreamweaver developers:
http://www.massimocorner.com
----------------------------


MikeyJAuthor
Known Participant
April 24, 2007
Thx Massimo! This looks like it should work but I seem to be having an issue.

I'm trying to modify the example to do the Update where the Delete is in the example but I'm getting a "can't retrieve data" error popup. The url shown in the popup is correct and my Error/Status codes are 100/4/500. If, on the action page I bypass the component code and just leave the update query it will work but that kind of defeats the purpose! ;-) Any thoughts?

Thx!