Select to view content in your preferred language

Publishing Silverlight 4 app

984
5
09-08-2010 10:31 AM
WilliamKimrey
Emerging Contributor
Hello all,

I have no idea what I'm doing wrong here.  I've developed a Silverlight 4 Application and published it to my webserver.  However, it's breaking on 2 very important points.

1) RIA Services:  when the application loads, a record is created and added to a table.  That's all that happens, but this is failing on the SubmitChanges() method which is located in the MainPage_Loaded event handler.

2) Can't see the Map:  I see it just fine when I debug in VS2010, but after publishing, I just see white space.  However, I can still click on that white space and get a result from querying the map service and the Graphics Layer add the appropriate graphic.

I've tried loads of different options to get the first problem resolved (with no luck) but I've not seen anything that would help with the second problem.

Any ideas or suggestions are more than welcome.

Will
0 Kudos
5 Replies
dotMorten_esri
Esri Notable Contributor
For the blank map issue, see this blogpost: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2009/08/24/Troubleshooting-blank-layers.aspx

Regarding RIA services, I suggest you try asking at http://forums.silverlight.net
0 Kudos
KirkKuykendall
Deactivated User
Hey Will -

Sorry to go (slightly) off topic here, but was wanting to inquire if you made any progress in your efforts to edit via RIA Services as described on this thread you started (which is now closed for comment).

Cross posted here.

Thanks, Kirk
0 Kudos
DanielWalton
Frequent Contributor
Will,

Regarding issue #2, are you passing a callback handler to SubmitChanges() like this:

            
        using System.ServiceModel.DomainServices.Client;
....
            domaincontext.SubmitChanges(Changes_Submitted, null);
....
        private void Changes_Submitted(SubmitOperation sop)
        {
            if (sop.HasError)
            {
                ErrorWindow.CreateNew(sop.Error);
                sop.MarkErrorAsHandled();
            }
        }
0 Kudos
WilliamKimrey
Emerging Contributor
Kirk,

Yes, I've made quite a bit of progress in editing via RIA Services.  In my old post that you linked to, I was asking about restricting the domain data source to a spatial query.  The idea was that I draw a shape, and my DDS populates my DataGrid with those features that intersect the drawing.

I've pretty much kept that same concept, but I no longer work with the DDS in Xaml to perform this function.  Here's my workflow:

1) I have a draw function that the user selects, while it's active the user draws on a GraphicsLayer.  When the 'OnDrawComplete' event fires, I take that graphic's geometry and use it in a QueryTask to get the parcels that intersect the drawing.

2) On 'QueryExecuteCompleted' I loop through the returned features and grab a field which contains a GUID.  That guid is used to load that particular parcel into my DomainServiceContext (created in code-behind) using a custom Query function in the DomainServiceClass.

3) When I"m done looping through, I set my DataGrid's Itemsource to be the DomainServiceContext.  The Grid populates with all the information which is then edited by the user.

Other than that, when I'm looping through the features, I take that time to add new graphics to a GraphicsLayer so the user can see the selected parcels.  There's also a DataGrid_SelectionChanged event that highlights the selected parcel.

So yeah, I've written about ten editors using this method, or very similar to it so far, but all of them are mainly editing tables which are joined to feature classes.  Anytime I've had to edit geometries, I either use FeatureLayers, or if the edits are rare enough, do it in ArcMap and let the user edit the attributes through a table editor.
0 Kudos
WilliamKimrey
Emerging Contributor
Daniel,

No, I'm not using a callback handler for SubmitChanges.  I can't remember how I fixed the issues I was having as described in this thread, but I seem to remember that it was a permissions error on the server's end.  We had just gotten a new server and were in the process of moving applications over, but had missed a couple of settings.
0 Kudos