Is there a way to get access to the Current View from a Custom Control

  • 30 April 2014
  • 2 replies
  • 0 views

Badge +2

I'm creating a custom control that is being used on a list view.   I need to be able to access the SmartObject that has been associated with the list view.  Is there anyway to get a handle to this particular SmartObject instead of just getting the SmartObject directly via the SmartObjectClient?


2 replies

Badge +6

Hi,


 


Would you need to set the SmartObject as the datasource on the Custom Control?


 


Regards

Badge +2

Yes, that would be ideal if that would allow data to be passed to it along with parameters, etc.

 

Let me describe what i'm trying to accomplish.

 

I've been working on expanding the autocomplete control that is in the marketplace to meet the needs of my smartforms application i am building for a client.

 

In the add/edit row of the list view i have a dropdown field and then the autocomplete field.  When a user chooses an option from the dropdown i need the autocomplete field to filter the results based on that option selected. 

 

Currently the autocomplete control reads from a defined smartobject by using the CurrentClass.GetSmartObjectContext function in the API.  So i cannot "pass" or read any data from the control in order to filter what the smartobject returns for the autocomplete dropdown.  I've coded a work around currently using a label and then reading the value from the label to filter the smartobject but i would rather, if possible, be able to just use the smartobject bound to the listview in the autocomplete control.

 

I would like to change the autocomplete control from reading the smartobject via the CurrentClass.GetSmartObjectContext function to be able to use the smartobject that is being bound to the list view, this way i can transfer data to that smartobject when another control on the form changes and be able to have access to that data value.

Reply