Just discovered this little beauty.
You can create an item with all the objects / components you need, save it and then add it to any other form just like a .net component.
wow.
Heh. Just created a user control that has a drop-down combo attached to a dynamic datasource, and the combo now displays the data from the table parameter.
I added my user control to the toolbox, and now all I do is drop my control onto a new form and I have a dynamic table-driven lookup. Not one line of manual code added to the new form.
This has effectively replaced over 2200+ lines of appbuilder code with a single component.
wow again
Once I've tidied up the code, I'll post it.
I am trying this and notice that the user control is not visualized. Why would that be?
I added it to my toolbox, and dragged it onto a new form. Works perfectly, and it is visualized.
ok, here we go.
you need to be connected to the sports2000 database
create a com.dotr.demo directory in the root of your project, and add the attached files
create a new toolbox category (ABL Controls)
create a new toolbox control group (Combo)
add new control to toolbox
go to ABL controls, select the com.dotr.combobox
create a new abl form.
drop the ComboBox control onto the form
run
[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/ComboUserControl.cls:550:0]
[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/ComboUserControl.resx:550:0]
[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/SimpleTable.cls:550:0]
It works. Thanks.
Cool, isn't it ?
Would creating all the field-level controls WITH labels be a proper use case for this? Has anyone had a stab at that already?
Nope, but please feel free to do so, and let us know the results
Hi Peter,
that's exactly what I've done (I don't know if for all, but for those that I needed so far). Works really nice!
I've implemented a SideLabel Control first. This Control knows once it's OwningControl is set how to do the rest. It subscribed to View/Hide/Resize/Move/ParentChanged events of this OwningControl. So the Owning Control just needs to create it's own instance of the Label and set the Label Text.
The User Control just needs
- a Variable for the SideLabel instance
- a setter for the LABEL property that creates the SideLabel instance at first usage and assigns the SideLabels Text Property
- a getter for teh LABEL property
Everything else (if I did not forget something here) is handled by the Label itself.
Eeek. Could we see a code snippet of this ? It would be most enlightening.
OwningControl?