Looking for a simple solution model example to create listvw

I am looking for a very simple solution model example that will dynamically create a list view of a table. I am trying to create a very simple table editor where the only inputs are the database name and the table name. I looked at the solution model sample solution and I’m sure the answer to my question is in there somewhere. Unfortunately, there is so much more functionality that I don’t need that it is obscuring the basic process of constructing the list view form. As I understand it the steps should be

  1. Check to see if the form exists using solutionModel.getForm(‘theForm’) If yes:
    A. theForm.visible = false;
    B. history.removeForm(theForm)
    C. solutionModel.removeForm(theForm)
  2. Create the new list view form using the solutionModel.newForm()
  3. Get a listing of the datasources in the table
  4. Use a loop and solutionModel.cloneComponent() to copy components from a template form for each field in the table?
    A. I’m a little fuzzy here on whether this is necessary or if I can just create the field directly using the solution model
  5. Add a tab to a tabpanel on an existing static form to display the new form. I really don’t need the parent form to be dynamic
    (just need to be able to display the listview form just created in the tabpanel).

I’ve tried the above steps in various combinations and I’ve looked at the code examples and the sample solutions. Just can’t seem to put 2&2 together though (I’ve succeeded in creating forms but I also get various runtime errors).

Any help to get me on my way would be greatly appreciated.

I was able to get the dynamic form part working properly but I still haven’t figured out how to attach the new form to an existing tab panel on a static form. I have a main for that is basically the controller for the module and it allows the user to select a database and table. Upon selection, the dynamic listview form is created. What I want to do is add this new form to the tab panel I’ve placed on the main form. I’ve added the code below but the tab panel does not populate:

// Add new form to existing tab panel
elements.tabs_gridview.removeAllTabs();
elements.tabs_gridview.addTab(frmwk_dbmaintenance_var_fname,‘Tab_test’,‘Test’,‘’,null,null,null,null,1);
elements.tabs_gridview.visible = true;

Hi Chuck,

To add a dynamic form to a tabpanel you use the forms[“nameOfForm”] syntax.
So your code would be :

elements.tabs_gridview.addTab(forms[frmwk_dbmaintenance_var_fname],'Tab_test','Test',null,null,null,null,null);

Hope this helps.

That worked. I’m all set now. Thank you very much.