Skip to main content

I am creating a custom control that will display an unordered list containing information from a table. At the moment the SmartObject that is being used to return the data is hardcoded, but I would like to know how I can do this in a way that allows the user to drag the control onto the view and then assign a smartobject to it.

 

An example of the XML and the C# would be great. 

 

Thanks

+1

Same request here.

I need to know how to include the SMO selector for a Prop of a custom control.

Furthermore, and i believe this is the even harder one, how to set the "configure" dialog of a custom control method to SMO method configuration (to be able to configure the selected SMO method using a rule).

 

Background: I need to create a custom Picker Control with possibility to enter any text value (we will need this quite often so we believe a custom control makes sense).


I'm not sure how you guys made out on your custom controls, but for any other developers reading this.  Here is K2's starting point for developeing custom controls.

 

https://help.k2.com/onlinehelp/k2smartforms/devref/current/default.htm

 


Unfortunately, like with populating drop down lists, there isn't any documentation on the XML structure required make that work. If you look at some of the custom controls they often contain the example of what you are looking to accomplish.


 


For now, here is the XML required to wire up a smart object:


 


<Prop ID="DataSourceType" mappable="false" friendlyname="Type" type="complex" serverControlType="property" category="Data Source" InitializeServerControl="initializeAssociationPropertyConfig" ClearServerControl="clearComplexPropertyConfig" ServerControl="SourceCode.Forms.Controls.Web.PropertyConfiguration.AssociationPropertyConfig,SourceCode.Forms.Controls.Web" />


 


If you take a look at the K2 database --> Forms.ControlType table. This is where all the K2 controls get registered and you can see examples of what the property XML should look like.  Not the most ideal way to do things, but a good reference in an information vacuum.  


 


Hope this helps.


 


S.


Thanks Scott, good point.  I often wish for more sample code; examples; etc. for my K2 apps, good post!  :)


Reply