OMG. ABL user control simply rocks

Posted by jmls on 28-Jul-2008 08:38

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.

All Replies

Posted by jmls on 28-Jul-2008 10:01

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.

Posted by rbf on 31-Jul-2008 06:07

I am trying this and notice that the user control is not visualized. Why would that be?

Posted by jmls on 31-Jul-2008 06:25

I added it to my toolbox, and dragged it onto a new form. Works perfectly, and it is visualized.

Posted by jmls on 31-Jul-2008 07:01

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]

Posted by Simon de Kraa on 31-Jul-2008 08:50

It works. Thanks.

Posted by jmls on 31-Jul-2008 09:48

Cool, isn't it ?

Posted by rbf on 05-Aug-2008 03:03

Would creating all the field-level controls WITH labels be a proper use case for this? Has anyone had a stab at that already?

Posted by jmls on 05-Aug-2008 03:26

Nope, but please feel free to do so, and let us know the results

Posted by Admin on 05-Aug-2008 14:48

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.

Posted by jmls on 06-Aug-2008 16:49

Eeek. Could we see a code snippet of this ? It would be most enlightening.

Posted by rbf on 26-Feb-2009 02:27

OwningControl?

This thread is closed