ADM2 || Proc name after adm-create-object and before postCre

Posted by Admin on 08-Oct-2009 07:18

HI all,

I have a small problem,

Please suggest for any procedure name which are execute after adm-create-object and before postCreateObject.

Please suggest me.
Its very urgent.

Regards,
Sharma Kartikeya

All Replies

Posted by Admin on 08-Oct-2009 07:57

kartikvbn schrieb:

HI all,

I have a small problem,

Do you have Details of your requirements? postCreateObjects should be exactly what you are looking for.

Please suggest for any procedure name which are execute after adm-create-object and before postCreateObject.

There isn't much to choose from. In any contained SmartObject (won't work from within the SmartWindow itself) you may subscribe to the "createObjects" event which is published between adm-create-objects and before postCreateObjects (don't forget to RUN SUPER). See the following code from containr.p (10.2A).

PROCEDURE createObjects :

/*------------------------------------------------------------------------------

   Purpose: Standard code for running the objects in a Container. It runs

            the AppBuilder-generated procedure named adm-create-objects.

Parameters:

     Notes: The ObjectsCreated flag protects agains multiple starts of page 0.

            Other pages are protected in changePage.

------------------------------------------------------------------------------*/

  DEFINE VARIABLE iPage           AS INTEGER    NO-UNDO.

  DEFINE VARIABLE lObjectsCreated AS LOGICAL    NO-UNDO.

  DEFINE VARIABLE iStartPage      AS INTEGER    NO-UNDO.

  {get CurrentPage iPage}.

  IF iPage = 0 THEN

    {get ObjectsCreated lObjectsCreated}.

  IF iPage <> 0 OR NOT lObjectsCreated THEN

  DO:

    RUN adm-create-objects IN TARGET-PROCEDURE NO-ERROR.

    /* Deep create.

       Create the contained objects for certain classes of objects: dynamic containers,

       both object and widget containers. This excludes data objects. */

    PUBLISH "createObjects":U FROM TARGET-PROCEDURE.       

    /* new for 9.1B: run an additional optional procedure in the container,

       which can do any work that must be done after all the contained objects

       have been created and the links established, but before initializeObject.*/

    RUN postCreateObjects IN TARGET-PROCEDURE NO-ERROR.

    /* if page 0 then this is the start up so ensure that we run the startpage */

    IF iPage = 0 THEN

    DO:

      /*  Use NO-ERROR as a non visual (server side) container does not inherit

          Visual */

      RUN SUPER NO-ERROR.

      {get StartPage iStartPage}.

      IF iStartPage NE ? AND iStartPage NE 0 THEN

        RUN selectPage IN TARGET-PROCEDURE (iStartPage).

      {set ObjectsCreated TRUE}.

    END.

  END.

  RETURN.

END PROCEDURE.

This thread is closed