on 07-17-2014 11:21 PM
Hi All,
I'm trying to implement a OpenUI add-in for the Windows (WPF) Agentry client which updates Agentry properties and calls an action. I'm having trouble understanding the OpenUI interface of the Windows Agentry client.
Scenario:
I've added a new property called ZTest of type String to the MainObject of Work Manager (6.1).
I've also added a new field ZOpenUITest of type "String" to the WorkOrderTileListView screen (it's basically shown below the order list)
In the ZOpenUITest screen field, I've set the Class Name to "MyStringEditAdapter", added "ZTestExternalValue" to the External Values list and I've added an action ZTestUpdate to the action list
I used the sample control project from the OpenUI SDK for WPF as a start and started playing around with the MyStringEditAdapter class. But I'm unclear on how to expose a string to the external value (ZTestExternalValue) and how to call the ZTestUpdate action. I'm able to debug into the code - so this is not an issue of getting the add-in running.
I tried something like this:
AgentryClientSDK.IAgentryControlViewModelStringEdit vm = DataContext as AgentryClientSDK.IAgentryControlViewModelStringEdit;
but it's returning null.
This returns a valid reference:
AgentryClientSDK.IAgentryControlViewModelStringDisplay vm = DataContext as AgentryClientSDK.IAgentryControlViewModelStringDisplay;
But I didn't find a way a way to expose the external values or trigger the Agentry action. For exposing the external values, I would assume there is an even which I need to implement.
Unfortunately the documentation on OpenUI for WPF is rather thin imho. I appreciate any input.
Thanks!
Hi Christian,
1. Is the ZOpenUITest string field set as read-only? If so, you may need to uncheck that. That might be the problem for vm being null :
AgentryClientSDK.IAgentryControlViewModelStringEdit vm = DataContext as AgentryClientSDK.IAgentryControlViewModelStringEdit;
2. External Values - External Values are a way to pass data FROM open UI control TO agentry screen/action. To do that:
a. Define an external value string, say , "myExtValue" in the External Values section in editor.
b. Implement GetExtensionStirng(String key) method of ICustomAgentryControl interface.
Public string GetExtensionString(string key){
if(key.Equals("myExtValue"){
Return “some string”;
}
}
c. In an agentry action/rule, when you access this external value field, Agentry will call your open UI control's GetExtensionStirng() method to ask for the value. This is the basic mechanism to get data from open ui to agentry.
3. Agentry Actions: Here, you can specify any Agentry action defined in your application to be called from OpenUI control. To run an agentry action , you would call: SMPActionResult result = viewModel.ExecuteAgentryAction(action);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.