iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi
We prepare own app model using some experiences from template: Intersoft ClientUI MVVM Data Application (DevForce).
Class EditableGridViewModelBase.cs has method ExecutePrepareNewRow.
I'd like to prepare NewItem without adding its to EntityManager, so I comment one line:
private void ExecutePrepareNewRow(object parameter) { // It's possible to initialize the new row with default values // Example: // product.ProductName = "New Product"; this.NewItem = this.EditableProductsSource.Create() as T; //this.EditableProductsSource.Insert(this.NewItem); }
I assumend that in the process of adding a row I'll validate (ExecuteValidateRow) a row, next add this one to EntityManager (Context). But what's happend?: First event which is fired is ExecuteRejectRow.
Could you explain me why?:
1. ExecuteValidationRow is not trigger
2. Why I have to add entity do EntityManager prior confirm to add process new record in UXGrid
I'd like to operate on detached entity.
Other interesting experience:
1. Start new project with unmodified template Intersoft ClientUI MVVM Data Application (DevForce)
2. go to product and add one row (without saving changes)
3. next click on other item in menu (ex. About) and go to Product again - you'll see added row without possibility of saving it.
I understand we can clear entity nad query cache but I thing it should be much better to work on detached entity.
Kind regards
Andrzej
Hi Andrzej,
For your experience with a cache, I have informed our development teams for this issue.
Regarding to your question about ExecuteValidateRow, your sample in this thread show me that you used ExecuteValidateRow event. Is it still not trigger as you expect ?
Regards.Riendy
Hi Riendy,
if I don't add entity to EntityManager like on example below:
only RejectRowCommand ( ExecuteRejectRow method) is executed.
I expect it should be extecuted: ValidateRowCommand, InsertRowCommand too.
You can try it (file: EditableGridViewModelGenericBase.cs)
EntityManager is an item from devforce. The process that you did in UXGrid would be save on entityManager before you save or cancel the processes (save all changes/reject all changes) to dataSource. In simply, we can call it client caching. That is why batch update not available in all data providers such as WCF RIA service.
In brief, you have to add NewItem to EntityManager, because you use DevForce service.
For your other experience with our template, if you want to clear the processes that haven't click save all changes button, you may add following code in you xaml, ie :
ProductRepository repository = this.DataSource as ProductRepository; Repository.Context.Clear();
When this code applied, the "cache" will be clear when the xaml opened.
Please let me know if it is not answered yet.
Thank you.Riendy
Anyway ..
I would imagine the following process:
1. user click on new row:
a. ExecutePrepareNewRow is raising - in code we create new object(entity) and set some default value
2. user add new row to list
a. ExecuteValidateRow is raising - in code we validate object (entity), if 'ok' than insert it into EntityManager
b. ExecuteInsertRow is raising
3. user click Save and all new added entity are saved via DevForce to DB
UXGrid offer me another life cycle:
when user click new row I have to add new entity to EntityManager (in ExecutePrepareNewRow) - I don't do that, because there is no my accept at this moment.
Have you ever tried some kind of magic:
1. go to Product
2. click on new row and write ProductName="abc" and Category="Beverages"
3. next click on Home
4. and back again to Product -what you see : new added row
Why I have to take care to clear cache or permanently use sandbox with new instance of EntityManager
I think it's not good practic which required more control.
Kind Regards
BTW
Sandbox is very good practic
I meant, if you have to clear the cache, but it is not suggested because it same as remove some DevForce service. The batch update on this state should be enabled. Unfortunately in the fact, the batch update is disabled. Our development team has been known this issue and I ensure they will fix it as soon as possible.
Regarding to your scenario, I'm currently still investigating to provide a solution for you.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname