Status | ID | Priority | Type |
Closed | 33336 | Major | Question |
Profile | Reply |
gabossoloClient | Hi ! Could you please assist me on how to add dynamic properties from a SimpleAction and see them on my DetailView without reload the view? Thank you! Regards, |
User | Description | Posted On |
MariyaVoytovichAgent | Hello gabossolo! You can see in the Feature Center demo how to add dynamic properties from SimpleAction. To see this action in action: Feel free to contact us if you need further assistance or have additional questions. Regards, | |
gabossoloClient | Hi Mariya ! Thanks for your reply. Indeed, I want to add dynamic properties from the code without showing parameters in a pop-up Windows to the user. addFlightStopAction.Execute += AddFlightStopActionOnExecute; private void AddFlightStopActionOnExecute(object sender, SimpleActionExecuteEventArgs e) ... Thanks! | |
MariyaVoytovichAgent | Hi! This is a code example for adding a dynamic property to an object. void mySimpleActionForDynamicParameter_Execute(object sender, SimpleActionExecuteEventArgs e) { var currentObject = View.CurrentObject as PersistentXafariBaseObject; if (currentObject == null) return; var _objectSpace = Application.CreateObjectSpace(); var myDefaultValueObject = _objectSpace.CreateObject(); myDefaultValueObject.Name = "myDinamicProperty"; myDefaultValueObject.PropertyType = typeof(DateTime);myDefaultValueObject.ValueDateTime = DateTime.Now; currentObject.AddProperty(myDefaultValueObject.Name, myDefaultValueObject.PropertyType); currentObject.Session.CommitTransaction(); foreach (var property in currentObject.Dpo.DpoProperties.Values.Where(property => property.PropertyType == myDefaultValueObject.PropertyType && property.Name == myDefaultValueObject.Name)) currentObject.Session.CommitTransaction(); Feel free to contact us if you need further assistance or have additional questions. Regards, | |
gabossoloClient | Hi Mariya! I'm using DC (XafariObject) and not PersistentXafariBaseObject. This code doesn't works: currentObject.Session.CommitTransaction(); Thanks, Regards, | |
MariyaVoytovichAgent | Hello gabossolo! Our apologies for the delay. Can you send me an example of the code of your object? Regards, | |
gabossoloClient | Thanks Mariya! I have changed my code and it's working now. public AddDynamicPropertyController() var addDynamicProperty = private void AddDynamicPropertyOnExecuted(object sender, ActionBaseEventArgs actionBaseEventArgs) objectSpace.CommitChanges(); //currentObject.Session.CommitTransaction(); foreach (var property in currentObject.Dpo.DpoProperties.Values.Where(property => objectSpace.CommitChanges(); //currentObject.Session.CommitTransaction(); View.ObjectSpace.CommitChanges(); |