all groups > macromedia flash flash remoting > november 2003 >
You're in the

macromedia flash flash remoting

group:

Search, Previous/Next n-records, Detail page


Search, Previous/Next n-records, Detail page jeffcg2
11/30/2003 3:16:08 PM
macromedia flash flash remoting:
I'm trying to create this type of functionality with Flash MX 2004 Professional, ColdFusion 6.1 and MSSQL7.

Using DreamWeaver and ColdFusion this takes less than 5 minutes to accomplish.

I keep waiting for an example or a light to go on reading everything in the help files about data handling in Flash. I still have a lot of reading to do.

Question: I am working with a table of 10,000 records with 50+ fields at the moment.
In the example http://www.macromedia.com/devnet/mx/flash/articles/delta_packet.html.
the entire table is pulled into the Dataset component and bound to the Datagrid.

I don't imagine the Dataset is meant to handle 10,000 records with 50+ fields.

So how to handle selecting n-records at a time? Next n-records? Previous n-records?

Examples anywhere?





Jeff Craig
Re: Search, Previous/Next n-records, Detail page Tom Muck
12/2/2003 10:24:25 AM
[quoted text, click to view]

You can check a few of the examples at
http://www.flash-remoting.com/examples, mostly chapter 5.

The products admin example at
http://www.flash-remoting.com/examples/example.cfm?recordid=60 uses first,
prev, next, and last links on a details page, however I'm loading a small
recordset entirely into the Flash movie, which would not be a good idea in
your case. You should look into the setDeliveryMode("ondemand",pagesize)
method. There is an example at Macromedia in livedocs, and a fairly detailed
one in my book.


--
---------------------------------------------------------------
Tom Muck
author -- Flash Remoting: The Definitive Guide
http://www.flash-remoting.com/notablog

Team Macromedia Volunteer for Flash

Extending Knowledge, Daily
http://www.communityMX.com/

Re: Search, Previous/Next n-records, Detail page jeffcg2
12/4/2003 3:26:04 AM
Tom,
Thank you for the links.
Looks like they should be helpful if I ever get an idea what the %&)(*&% is wrong.
And your book looks like something I should have.

I don't really understand where to start trouble shooting.

There are just SOOO MANY screwy things (to me).

Why does the Tip of the Day finished tip.swf file give an error connection to their service on this machine that has all the latest updates. But if I put the file on my live machine, that still doesn't have the ColdFusion MX 6.1 updates it works fine.

The case sensitivity is a hair puller to me.
In one of the examples I think ID was capitalized in the table I build it wasn't it gave an error connecting to the webservice. I changed it to lower case and it worked. Wouldn't have thought that would make a difference.

//Now call the function with a query to get the data
_global.srv.getSQLData( "timetrax", "select notes, billable, duration, rate, duration, id from timeentry" );

Your ProductsAdmin.fla file doesn't work for me I get an error connecting to the webservice.

I had trouble for a while because I didn't get the updated flash remoting components at first.
Now some things work some don't. I'm wondering if there is more than one copy of the Flash Remoting files out there on the hard drive somewhere.

The Petmarket shopping cart application works fine here.
The Note Board sample file works fine here.
Several other samples I have gotten running on this machine. I've created my own webservices that function using Dreamweaver. I've gotten them to even get data into Flash using the webservice component. Getting the Deltapacket parsed to insert back into SQL 7 looks like a nightmare.


I'm wondering if SQL 2000 XML functions would help with that. Just got SQL 2000 installed at work last week so I haven't had much chance to check into that yet.

I am not an actionscript or javascript person so I expect much of my frustration with Flash has to do with that.



Jeff Craig
Re: Search, Previous/Next n-records, Detail page Tom Muck
12/4/2003 11:15:52 AM
[quoted text, click to view]

That's a fact. ;-)

[quoted text, click to view]
to their service on this machine that has all the latest updates. But if I
put the file on my live machine, that still doesn't have the ColdFusion MX
6.1 updates it works fine.

I'm not familiar with it, but if it's a web service you may have them turned
off. They are off by default in 6.1 and 6.0 updater 3:
http://www.flash-remoting.com/notablog/home.cfm?newsid=21

[quoted text, click to view]
wasn't it gave an error connecting to the webservice. I changed it to lower
case and it worked. Wouldn't have thought that would make a difference.

I always assume everything is case sensitive. That makes things easier to
debug.

[quoted text, click to view]
to the webservice.

Did you set up the CFC on your machine and a Northwind database connection?
It isn't a public web service, so it will only work if you create the same
data sources and CFC paths that I have.

[quoted text, click to view]
copy of the Flash Remoting files out there on the hard drive somewhere.

They should be in your Flash config directory, or in your local user Flash
config directory. If in doubt, do a search on your computer for
NetServices.as.

[quoted text, click to view]
my own webservices that function using Dreamweaver. I've gotten them to even
get data into Flash using the webservice component. Getting the Deltapacket
parsed to insert back into SQL 7 looks like a nightmare.

I haven't worked much with delta packets. I don't trust it.

[quoted text, click to view]
2000 installed at work last week so I haven't had much chance to check into
that yet.

Probably not. If you are using CF, the easiest way to deal with Flash/CF
communication is through Remoting.

Tom

Re: Search, Previous/Next n-records, Detail page jeffcg2
12/6/2003 3:37:39 PM
Tom,
I did a search for web.xml and found 9 (I think different files)
I didn't find this.
------------------
<init-param>
<param-name>DISABLE_CFWS_ADAPTERS</param-name>
<param-value>false</param-value>
<description>When set to true, this setting disables the ColdFusion WebServices Adapters in the gateway.</description>
</init-param>
----------------------
Since I am using IIS, I assume c:\inetpub\wwwroot\WEB-INF\web.xml
is the file I should be concerned with.

However, I did get your ProductsAdmin.fla file to work.

Why is a mistery to me.

I had the webservices working to start with.
I tested with a .cfm file.
--------------
<cfinvoke
webservice="http://www.flash-mx.com/ws/tipoftheday/tip.cfc?wsdl"
method="getTipByDate"
returnvariable="aHashMap">
<cfinvokeargument name="tipDate" value="10/03/2003"/>
</cfinvoke>
<cfdump var="#aHashMap#">
<cfinvoke
webservice="http://216.43.117.145/flashremoting/ProductsAdmin.cfc?wsdl"
method="getCategories"
returnvariable="aQuery">
</cfinvoke>
<cfdump var="#aQuery#">
<cfinvoke
webservice="http://216.43.117.145/flashremoting/ProductsAdmin.cfc?wsdl"
method="getSearchResult"
returnvariable="aQuery">
<cfinvokeargument name="search" value=""/>
</cfinvoke>
<cfdump var="#aQuery#">
--------------------------------

This is VERY strange to me.

I was opening your ProductsAdmin.fla file.
Changing
NetServices.setDefaultGatewayUrl("http://localhost/flashservices/gateway");
to
NetServices.setDefaultGatewayUrl("http://216.43.117.145/flashservices/gateway");
and changing
var myService = my_conn.getService("com.oreilly.frdg.admin.ProductsAdmin");
to
var myService = my_conn.getService("FlashRemoting.ProductsAdmin");

Then saving the file. It saved as Flash MX 2004 doc.

I got an error connecting to a webservice I knew was working.

This morning I did a save as on ProductsAdmin.fla to My_ProductsAdmin.fla.
It saved as Flash MX 2004 file then I made the changes. Did a test movie and everything worked fine.

After some trials I've discovered that the if I go back to the file that I saved after making the changes to the connector.

NetServices.setDefaultGatewayUrl("http://216.43.117.145/flashservices/gateway");
var myService = my_conn.getService("FlashRemoting.ProductsAdmin");

NetServices.setDefaultGatewayUrl("http://dummy/flashservices/gateway");
var myService = my_conn.getService("dummy.ProductsAdmin");

Save and test the movie then change back and save and test the movie it works fine.

Jeff Craig
Re: Search, Previous/Next n-records, Detail page Tom Muck
12/7/2003 10:10:41 AM
[quoted text, click to view]

If you have CF 6.1 or CF 6.0 updater 3, you will have it. Check:
http://www.macromedia.com/support/coldfusion/ts/documents/enable_flash_webservices.htm

If you don't have CF 6.1, I'd suggest you get it. Prior versions of CFMX
were unstable.

[quoted text, click to view]
NetServices.setDefaultGatewayUrl("http://216.43.117.145/flashservices/gatewa
y");
[quoted text, click to view]

I have a section in the book detailing the service path and gateway path.
Essentially your gateway path on ColdFusion will be the URL of your web site
along with /flashservices/gateway. So on a local machine it would be
http://localhost/flashservices/gateway, but on a remote site it would have
the remote site url.

The service path is essentially the directory path from the web root to your
file. For example, if your site is at http://216.43.117.145 and the file
ProductsAdmin.cfc is under the c:\inetpub\wwwroot\mysite\ directory, your
path would be "mysite.ProductsAdmin".

If you are using a web address, like www.somedomain.com, this can be
problematic unless your server admin has set up virtual directories within
the CF administrator.

Tom
Re: Search, Previous/Next n-records, Detail page jeffcg2
12/7/2003 9:46:38 PM
Tom,

I didn't say it very well but I understand the webservices, .cfc, and how to invoke them in ColdFusion.

Flash is another story.

What I was trying to say is that even though I had the correct GatewayURL and dot notation directory I was getting errors. This was causing me lots of headaches, wasted time trying to find what I had missed.

It seems to be caching somewhere in the .fla file the correct entry as incorrect.

Entering "dummy" (a bad entry) saving and testing the movie seems to flush whatever is causing the correct entry to not work, so that it can be entered again correctly and it will then work.



Jeff Craig
Re: Search, Previous/Next n-records, Detail page Jens Hauser
12/10/2003 9:25:23 PM
I have experienced problems when I set the gateway to localhost instead of
http://127.0.0.1/flashservices/gateway. If I change it there is no problems.
So now on I always set the IP instead.


Jens


"jeffcg2" <jeff@holipub.com> skrev i meddelandet
news:br073u$4jn$1@forums.macromedia.com...
[quoted text, click to view]
and dot notation directory I was getting errors. This was causing me lots of
headaches, wasted time trying to find what I had missed.
[quoted text, click to view]
whatever is causing the correct entry to not work, so that it can be
entered again correctly and it will then work.
[quoted text, click to view]

Re: Search, Previous/Next n-records, Detail page ItaconDev
12/13/2003 4:37:32 PM
There is no reason to pull out 10,000 records from the database just to show 10 or 20 at a time, the user mite never navigate to the 9,999 record. So thats just putting extra stress on your server. If you want to have the *next and back * functionality or to show 50 records or 20 at a time you should do it on your sql 2000. Use a few stored procedures and have Sql send you the amount of records you need.

Itacon Developer
Omar
AddThis Social Bookmark Button