Navigation Panel Code

Posted by tomar on 18-Feb-2010 09:59

I created in Visual Designer a CustomControl (OE 10.2B) Update Panel. Where I can find the code for ADD, SAVE, DELETE, CANCEL Buttons ? For Navigation Panel I have found the code on John Sadd presentation “Building a navigation panel as an ABL User Control”.

All Replies

Posted by Admin on 18-Feb-2010 10:22

You won't find general purpose code for CRUD. That's absolutely

dependent on your data access architecture and client modell.

Tell us more so that we can help you.

Posted by tomar on 18-Feb-2010 10:52

Mike,

I am trying to create a general object that I can use for almost any interface. When I click the Add, Save,Edit,Cancel buttons I would like to have the same result as a smart object Update Panel. I am trying to learn the .net technology and I want to write good code (ProBindingSource, ProDataSet), to not use the old smart object code. I loved the John Sadd presentation for the Navigation Panel and I would like to have the same presentation for the Update Panel or something similar.

Thank you,

Romica Toma

Chief Informatics Office | Bureau de l'informatique

Small Business and Marketplace Services | Services axés sur le marché et les petites entreprises

Industry Canada | Industrie Canada

300 Slater Street, Ottawa ON K1A 0C8 | 300, rue Slater, Ottawa ON K1A 0C8

romica.toma@ic.gc.ca

Telephone | Téléphone 613-952-0403

Facsimile | Télécopieur 613-946-3939

Teletypewriter | Téléimprimeur 1-866-694-8389

Government of Canada | Gouvernement du Canada

Posted by Admin on 18-Feb-2010 13:37

There is sample code (almost a full chapter) in the "GUI for .NET"

developers guide. You'll have to modify it to match your way of

dealing with ProDatasets on the UI / Backend and bring it into a

structure that matches your panel concept.

The panel should be rather passive, just sending messages (method

calls/events) to another object manipulating the ProDataset and

BindingSource.

Posted by Admin on 19-Feb-2010 00:51

There is sample code (almost a full chapter) in the "GUI for .NET" 

developers guide.

I was referring to the "Example of an updatable grid" in the "OpenEdge Development: GUI for .NET Programming" PDF.

Posted by danielStafford on 19-Feb-2010 06:17

This is how I am doing CRUD at the moment.

I use an MVC pattern and drop the CRUD user control onto a form, in this case a person/contact is the application context.

/* ucCRUDTool - user control */

/* contactView constructor - subscribeToButtonEvents(). */

    METHOD PUBLIC VOID subscribeToButtonEvents():

        ucCRUDTool:addButton:Click:Subscribe( oContactControl:addButtonChoose ).

        ucCRUDTool:saveButton:Click:Subscribe( oContactControl:saveButtonChoose ).

        ucCRUDTool:deleteButton:Click:Subscribe( oContactControl:deleteButtonChoose ).

        ucCRUDTool:cancelButton:Click:Subscribe( oContactControl:cancelButtonChoose ).

        ucCRUDTool:searchButton:Click:Subscribe( oContactControl:searchButtonChoose ).

        RETURN.

    END METHOD.

/* contactControl methods -  */

    METHOD PUBLIC VOID addButtonChoose(o AS System.Object, e AS System.EventArgs):

        oContactModel:addRecord(). /*  hContactBuffer:buffer-create() , etc */

    END METHOD.

In the model, the view has previously registered as an observer and is notified appropriately:

for each ttObserver:

     cast(ttObserver.oObserver, interface.iObserver):addRecord().

end.

    METHOD PUBLIC VOID saveButtonChoose(o AS System.Object, e AS System.EventArgs):

        oContactView:assignRecord().

        oContactModel:saveRecord().

    END METHOD.

    METHOD PUBLIC VOID deleteButtonChoose(o AS System.Object, e AS System.EventArgs):

        IF oContactView:preDeleteRecord() THEN

            oContactModel:deleteRecord().

    END METHOD.

    METHOD PUBLIC VOID cancelButtonChoose(o AS System.Object, e AS System.EventArgs):

        oContactModel:cancelChanges().

    END METHOD.

    METHOD PUBLIC VOID searchButtonChoose(o AS System.Object, e AS System.EventArgs):

        oContactView:searchKeyPressed().

    END METHOD.        

Posted by tomar on 19-Feb-2010 07:52

Thank you for your answer.

What I want, is the code for the methods addRecord(), saveRecord(), deleteRecord() and cancelChanges().

Thank you.

This thread is closed