tag:blogger.com,1999:blog-2157078164517103759.post2730917703814057440..comments2023-07-31T03:31:57.774-07:00Comments on A Static State: Silverlight RIA Data Validation Best PracticesJason Apergishttp://www.blogger.com/profile/01817509015412502702noreply@blogger.comBlogger19125tag:blogger.com,1999:blog-2157078164517103759.post-9312614953585399892011-09-01T06:36:21.841-07:002011-09-01T06:36:21.841-07:00Eyad,
Thanks for the feedback.
Sorry for delayed...Eyad,<br /><br />Thanks for the feedback.<br /><br />Sorry for delayed response. Have to say these were the best patterns I could come up with at the time because there was really not much out. To be honest, I have not messed around with this code in a while, so my memory is limited :-) <br /><br />Hopefully this will give you some good direction in finding your answer.<br /><br />Thanks,<br />JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-51351345502388840332011-08-28T01:09:42.461-07:002011-08-28T01:09:42.461-07:00Hi Jason,
Firt I would like to thank you for this ...Hi Jason,<br />Firt I would like to thank you for this great article.<br />This is also realted to the duplicat field validation, I really would like to know your thought. <br />After a while trying to find a solution, the only to do it is as you suggested (async validation). However, this must be with one condition, you have to submit directly after commit the edits whcih means saving one record at a time. No way to take advantage of the changeset that comes with ria services. Swapping two records values, would be something impossible. <br />What do think ?<br /><br />Thanks in advance.<br /><br />EyadEyadhttps://www.blogger.com/profile/02387849847946639354noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-57530719556290501392011-08-17T14:55:22.585-07:002011-08-17T14:55:22.585-07:00Annadatha - thanks for the feedback. I had no clu...Annadatha - thanks for the feedback. I had no clue this Silverlight series would take off the way it did. I just happened to do a Silverlight engagement between some SharePoint work and this was a series was based on it.<br /><br />As for your question, not exactly sure. Note this entire project was about integrating custom Oralce stored procedures with Silverlight application. So all of these patterns I used for calling those stored procedures. You are just not seeing the actual calls to the data access layer we wrote. I have patterns in here to do the validations on the client side or on the RIA Services side. Sorry for not being able to give exact answer.Jason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-55207368440496271552011-08-17T09:11:57.093-07:002011-08-17T09:11:57.093-07:00Hi Jason,
can you give any tips on how to do meta...Hi Jason,<br /><br />can you give any tips on how to do meta data validations while using stored procedures with wcf ria. My primary question regarding meta data is not having meta data available on server side while using stored procedures, so i can't specify any attributes on data members. Any work around that you know is appreciated.<br /><br />Than you,<br /><br />Fan of your blog.Annadathahttps://www.blogger.com/profile/01601585343873845144noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-32232033388866681912011-04-21T13:44:46.175-07:002011-04-21T13:44:46.175-07:00I do not mention, my solution in production was to...I do not mention, my solution in production was to use a resource file with all the messages centrally defined. That worked well. Use this as a reference - http://www.astaticstate.com/2010/04/silverlight-localization-and-resource.htmlJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-86015564414302948382011-04-21T13:36:06.244-07:002011-04-21T13:36:06.244-07:00Jason,
Thanks for your suggestions, I understand ...Jason,<br /><br />Thanks for your suggestions, I understand that it is going to load up lots of messages in the Silverlight application. I am going to experiment on this and I will see the performance and update you the status.<br /><br />Thanks again.<br />SundharSundhar Kasinathanhttps://www.blogger.com/profile/13454157529823660297noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-46045529547367489232011-04-19T19:29:32.134-07:002011-04-19T19:29:32.134-07:00You can go down that path, I choose not too in thi...You can go down that path, I choose not too in this implementation. You are going to have to do a bunch of extra code to load up all your messages from the database when the applications loads. Then in the code where I set the message text, you will need set in the messages. The problem with that approach will be if you have tons of messages, the load of the silverlight application will be slow. So you will have to move towards a solution that will load up a message from a database and then create some sort of singleton to managed loaded messages...Jason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-91944731962102626822011-04-19T17:51:28.630-07:002011-04-19T17:51:28.630-07:00Hi Jason,
I am using a Silverlight Ria Domain Ser...Hi Jason,<br /><br />I am using a Silverlight Ria Domain Service Validation. I want to keep all the Validation Messages (for example:“The Post Employeement Date must be set if the Employee is inactive.<br />”) in a database and cache it in the application level. How can I retrieve a cached validation message and use it in the Ria Validation ( using RIA generated proxy)Sundhar Kasinathanhttps://www.blogger.com/profile/13454157529823660297noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-86162611437550512792011-03-11T08:22:34.303-08:002011-03-11T08:22:34.303-08:00Subha,
Your question sounds very familiar but unf...Subha,<br /><br />Your question sounds very familiar but unfortunately I cannot recall what I did.<br /><br />Sorry - but the code in this blog will work at showing error messages.<br /><br />Thanks,<br />JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-6458491281627771622011-03-10T10:34:04.353-08:002011-03-10T10:34:04.353-08:00Thank you for your response Jason.
One last quest...Thank you for your response Jason.<br /><br />One last question, is there anything specific that you need to do for int variables in DTO to show these custom messages? I have an int variable in my DTO and I specified custom message in onXXXChanged event, but it is still showing "Input is not in the correct format". How to get rid of this and show the defined message?<br /><br />Thanks for your help in advance.<br /><br />SubhaUnknownhttps://www.blogger.com/profile/10158454934127502378noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-35790244376514519052011-03-09T18:11:49.376-08:002011-03-09T18:11:49.376-08:00Subha,
Yes - option 4 will fire when values are c...Subha,<br /><br />Yes - option 4 will fire when values are changed in a grid cell. It is all based on bindings - so that worked very well for me when I was doing this.<br /><br />JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-44761879521404654702011-03-09T11:12:54.123-08:002011-03-09T11:12:54.123-08:00Hi Jason,
With the approach 4, do the validations...Hi Jason,<br /><br />With the approach 4, do the validations fire as soon as user tabs out on the grid row? I am trying to implement said procedure but not successful in showing these messages on tab out of a cell.<br /><br />Could you share your thoughts?<br /><br />Thanks,<br />SubhaUnknownhttps://www.blogger.com/profile/10158454934127502378noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-41080136471585256972010-10-07T11:51:48.681-07:002010-10-07T11:51:48.681-07:00Alessandro - that is just an example. Rename the ...Alessandro - that is just an example. Rename the methods to what ever you want. It is basically demonstrating an async callback.<br /><br />JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-59245249576363525082010-10-07T00:05:16.840-07:002010-10-07T00:05:16.840-07:00I don't understand This:
//Call RIA Method ...I don't understand This:<br /><br />//Call RIA Method SimpleContext _simpleContext = new SimpleContext(); _simpleContext.SomeValidation(this.PostEmployeementDate, SomeValidationComplete, null); <br /><br />Please Help me!Pilonehttps://www.blogger.com/profile/16951389947191202893noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-64645153263461968682010-09-19T20:20:02.334-07:002010-09-19T20:20:02.334-07:00sjoshi,
I was just about to say your namespace wa...sjoshi,<br /><br />I was just about to say your namespace was off but you figured it out. For other folks reading, the namespace for your partial class in the Silverlight application must match the namespace of where the DTO is define. You can also look at the projected (generated) code to see what the namespace.<br /><br />Thanks for the feedback.<br /><br />JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-639763014168621492010-09-19T14:20:07.838-07:002010-09-19T14:20:07.838-07:00Forget the last comment, I realised my namespace w...Forget the last comment, I realised my namespace was off. Very nice article though...I was looking at a way to do the validation asynch & this cleared it up.Unknownhttps://www.blogger.com/profile/08572574200876997751noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-68645011904258760142010-09-19T14:03:30.021-07:002010-09-19T14:03:30.021-07:00I created a partial Class in my Silverlight Client...I created a partial Class in my Silverlight Client app to extend the generated SupportDbDTO but I keep getting this error:<br />No defining declaration found for implementing declaration of partial method 'SP3DRepos.SupportDbDTO.OnBackupInfoChanged()'<br /><br />Any thoughts ??Unknownhttps://www.blogger.com/profile/08572574200876997751noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-82549859299430974322010-09-05T12:29:54.525-07:002010-09-05T12:29:54.525-07:00Javier,
Thanks for the feedback.
We had to solve...Javier,<br /><br />Thanks for the feedback.<br /><br />We had to solve this for an Oracle database we are integrating with. In our scenario, sense to generate the key of the table when the object was created. This would occur well before the validation.<br /><br />Doing validations in the Domain Service can be challenging because the service does not have knowlegde of why it is being called. Personally I would not want this validation have to fire or to be evaluated every time the domain service is called.<br /><br />What I would do is follow the pattern I described in this blog to create a partial class for the patient. Then I would add a public method onto Patient DTO called IsSSNValid. In this method I would call RIA Service to peform the check for the duplicate SSN. If on the callback it succeeds, I would call SubmitChanged.<br /><br />JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-35644943376507639352010-09-05T12:11:37.302-07:002010-09-05T12:11:37.302-07:00Hi, what recommendation would you give to validate...Hi, what recommendation would you give to validate that a new record inserted doesn't have a duplicate key. For example, I am inserting a new pacient with his/her SSNum (is PK besides the autogen PK), and that pacient is already in the DB. Should I trap that exception once it's thrown in the Domain Service?<br />Thanks and great article.Javierhttps://www.blogger.com/profile/00626401911989237702noreply@blogger.com