Combo não funciona

Discussão em 'Progress 4GL' iniciado por lunho, Setembro 6, 2011.

  1. lunho

    lunho Membro Participativo

    Galera aprendiz ta com mais uma dificuldade.
    Fiz uma tela para orçamento, essa tela é chamada por uma tela principal. Até ai tudo bem. Acontece
    que quando chamo a tela de orçamento, tem um combo-box que não esta funcionando, aparece os campos
    vazio. So que quando rodo a mesma tela direto, sem passar pela tela principal funciona normalmente.
    Alguém pode me ajudar?
  2. baltazar

    baltazar Membro Participativo

    Envie ou poste o código
  3. lunho

    lunho Membro Participativo

    Código:
    /* Connected Databases 
              tec              PROGRESS
    */
    &Scoped-define WINDOW-NAME wWin
    /*------------------------------------------------------------------------
    
      File: 
    
      Description: from cntnrwin.w - ADM SmartWindow Template
    
      Input Parameters:
          <none>
    
      Output Parameters:
          <none>
    
      History: New V9 Version - January 15, 1998
              
    ------------------------------------------------------------------------*/
    /*          This .W file was created with the Progress AB.              */
    /*----------------------------------------------------------------------*/
    
    /* Create an unnamed pool to store all the widgets created 
         by this procedure. This is a good default which assures
         that this procedure's triggers and internal procedures 
         will execute in this procedure's storage, and that proper
         cleanup will occur on deletion of the procedure. */
    
    CREATE WIDGET-POOL.
    
    /* ***************************  Definitions  ************************** */
    
    /* Parameters Definitions ---                                           */
    
    /* Local Variable Definitions ---                                       */
    
    
    
    /* ********************  Preprocessor Definitions  ******************** */
    
    &Scoped-define PROCEDURE-TYPE SmartWindow
    &Scoped-define DB-AWARE no
    
    &Scoped-define ADM-CONTAINER WINDOW
    
    &Scoped-define ADM-SUPPORTED-LINKS Data-Target,Data-Source,Page-Target,Update-Source,Update-Target,Filter-target,Filter-Source
    
    /* Name of first Frame and/or Browse and/or first Query                 */
    &Scoped-define FRAME-NAME fMain
    
    /* Internal Tables (found by Frame, Query & Browse Queries)             */
    &Scoped-define INTERNAL-TABLES orcamento
    
    /* Definitions for FRAME fMain                                          */
    &Scoped-define FIELDS-IN-QUERY-fMain orcamento.num orcamento.data ~
    orcamento.numdes 
    &Scoped-define ENABLED-FIELDS-IN-QUERY-fMain orcamento.num orcamento.data ~
    orcamento.numdes 
    &Scoped-define ENABLED-TABLES-IN-QUERY-fMain orcamento
    &Scoped-define FIRST-ENABLED-TABLE-IN-QUERY-fMain orcamento
    &Scoped-define OPEN-QUERY-fMain OPEN QUERY fMain FOR EACH orcamento SHARE-LOCK.
    &Scoped-define TABLES-IN-QUERY-fMain orcamento
    &Scoped-define FIRST-TABLE-IN-QUERY-fMain orcamento
    
    
    /* Standard List Definitions                                            */
    &Scoped-Define ENABLED-FIELDS orcamento.num orcamento.data orcamento.numdes 
    &Scoped-define ENABLED-TABLES orcamento
    &Scoped-define FIRST-ENABLED-TABLE orcamento
    &Scoped-define DISPLAYED-TABLES orcamento
    &Scoped-define FIRST-DISPLAYED-TABLE orcamento
    &Scoped-Define ENABLED-OBJECTS cbcliente 
    &Scoped-Define DISPLAYED-FIELDS orcamento.num orcamento.data ~
    orcamento.numdes 
    &Scoped-Define DISPLAYED-OBJECTS cbcliente 
    
    /* Custom List Definitions                                              */
    /* List-1,List-2,List-3,List-4,List-5,List-6                            */
    
    /* ***********************  Control Definitions  ********************** */
    
    /* Define the widget handle for the window                              */
    DEFINE VAR wWin AS WIDGET-HANDLE NO-UNDO.
    
    /* Definitions of the field level widgets                               */
    DEFINE VARIABLE cbcliente AS CHARACTER FORMAT "X(256)":U 
         LABEL "Cliente" 
         VIEW-AS COMBO-BOX INNER-LINES 5
         DROP-DOWN-LIST
         SIZE 71 BY 1 NO-UNDO.
    
    /* Query definitions                                                    */
    DEFINE QUERY fMain FOR 
          orcamento SCROLLING.
    
    /* ************************  Frame Definitions  *********************** */
    
    DEFINE FRAME fMain
         orcamento.num AT ROW 4.81 COL 13.6 COLON-ALIGNED
              LABEL "Orc.Nº"
              VIEW-AS FILL-IN 
              SIZE 6.2 BY 1
         orcamento.data AT ROW 4.81 COL 83.6 COLON-ALIGNED
              LABEL "Data"
              VIEW-AS FILL-IN 
              SIZE 16 BY 1
         cbcliente AT ROW 6.48 COL 13.8 COLON-ALIGNED
         orcamento.numdes AT ROW 7.91 COL 13.8 COLON-ALIGNED
              LABEL "Desenho nº"
              VIEW-AS FILL-IN 
              SIZE 7.6 BY 1
         "ORÇAMENTO TEC MOLDFER - Filial -" VIEW-AS TEXT
              SIZE 76 BY 1.91 AT ROW 1.71 COL 21
              FGCOLOR 4 FONT 11
        WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY 
             SIDE-LABELS NO-UNDERLINE THREE-D 
             AT COL 1 ROW 1
             SIZE 116.4 BY 16.76.
    
    
    /* *********************** Procedure Settings ************************ */
    
    /* Settings for THIS-PROCEDURE
       Type: SmartWindow
       Allow: Basic,Browse,DB-Fields,Query,Smart,Window
       Container Links: Data-Target,Data-Source,Page-Target,Update-Source,Update-Target,Filter-target,Filter-Source
     */
    
    /* *************************  Create Window  ************************** */
    
    IF SESSION:DISPLAY-TYPE = "GUI":U THEN
      CREATE WINDOW wWin ASSIGN
             HIDDEN             = YES
             TITLE              = "<insert SmartWindow title>"
             HEIGHT             = 16.76
             WIDTH              = 116.4
             MAX-HEIGHT         = 34.1
             MAX-WIDTH          = 273.2
             VIRTUAL-HEIGHT     = 34.1
             VIRTUAL-WIDTH      = 273.2
             RESIZE             = no
             SCROLL-BARS        = no
             STATUS-AREA        = no
             BGCOLOR            = ?
             FGCOLOR            = ?
             THREE-D            = yes
             MESSAGE-AREA       = no
             SENSITIVE          = yes.
    ELSE {&WINDOW-NAME} = CURRENT-WINDOW.
    /* END WINDOW DEFINITION                                                */
    
    /* ************************* Included-Libraries *********************** */
    
    {src/adm2/containr.i}
    
    
    
    
    /* ***********  Runtime Attributes and AppBuilder Settings  *********** */
    
    /* SETTINGS FOR WINDOW wWin
      VISIBLE,,RUN-PERSISTENT                                               */
    /* SETTINGS FOR FRAME fMain
                                                                            */
    /* SETTINGS FOR FILL-IN orcamento.data IN FRAME fMain
       EXP-LABEL                                                            */
    /* SETTINGS FOR FILL-IN orcamento.num IN FRAME fMain
       EXP-LABEL                                                            */
    /* SETTINGS FOR FILL-IN orcamento.numdes IN FRAME fMain
       EXP-LABEL                                                            */
    IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(wWin)
    THEN wWin:HIDDEN = yes.
    
    
    
    /* Setting information for Queries and Browse Widgets fields            */
    
    /* Query rebuild information for FRAME fMain
         _TblList          = "tec.orcamento"
         _Query            is OPENED
    */  /* FRAME fMain */
    
     
    
    
    
    /* ************************  Control Triggers  ************************ */
    
    &Scoped-define SELF-NAME wWin
    ON END-ERROR OF wWin /* <insert SmartWindow title> */
    OR ENDKEY OF {&WINDOW-NAME} ANYWHERE DO:
      /* This case occurs when the user presses the "Esc" key.
         In a persistently run window, just ignore this.  If we did not, the
         application would exit. */
      IF THIS-PROCEDURE:PERSISTENT THEN RETURN NO-APPLY.
    END.
    
    
    ON WINDOW-CLOSE OF wWin /* <insert SmartWindow title> */
    DO:
      /* This ADM code must be left here in order for the SmartWindow
         and its descendents to terminate properly on exit. */
      APPLY "CLOSE":U TO THIS-PROCEDURE.
      RETURN NO-APPLY.
    END.
    
    
    &UNDEFINE SELF-NAME
    
    
    
    /* ***************************  Main Block  *************************** */
    
    /* Include custom  Main Block code for SmartWindows. */
    {src/adm2/windowmn.i}
    
    FOR EACH clientes
        NO-LOCK:
           cbcliente:ADD-last(/*usuario.id + " - " +*/ clientes.cnome).
    END.
    
    
    /* **********************  Internal Procedures  *********************** */
    
    PROCEDURE adm-create-objects :
    /*------------------------------------------------------------------------------
      Purpose:     Create handles for all SmartObjects used in this procedure.
                   After SmartObjects are initialized, then SmartLinks are added.
      Parameters:  <none>
    ------------------------------------------------------------------------------*/
    
    END PROCEDURE.
    
    PROCEDURE disable_UI :
    /*------------------------------------------------------------------------------
      Purpose:     DISABLE the User Interface
      Parameters:  <none>
      Notes:       Here we clean-up the user-interface by deleting
                   dynamic widgets we have created and/or hide 
                   frames.  This procedure is usually called when
                   we are ready to "clean-up" after running.
    ------------------------------------------------------------------------------*/
      /* Delete the WINDOW we created */
      IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(wWin)
      THEN DELETE WIDGET wWin.
      IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
    END PROCEDURE.
    
    PROCEDURE enable_UI :
    /*------------------------------------------------------------------------------
      Purpose:     ENABLE the User Interface
      Parameters:  <none>
      Notes:       Here we display/view/enable the widgets in the
                   user-interface.  In addition, OPEN all queries
                   associated with each FRAME and BROWSE.
                   These statements here are based on the "Other 
                   Settings" section of the widget Property Sheets.
    ------------------------------------------------------------------------------*/
    
      {&OPEN-QUERY-fMain}
      GET FIRST fMain.
      DISPLAY cbcliente 
          WITH FRAME fMain IN WINDOW wWin.
      IF AVAILABLE orcamento THEN 
        DISPLAY orcamento.num orcamento.data orcamento.numdes 
          WITH FRAME fMain IN WINDOW wWin.
      ENABLE orcamento.num orcamento.data cbcliente orcamento.numdes 
          WITH FRAME fMain IN WINDOW wWin.
      {&OPEN-BROWSERS-IN-QUERY-fMain}
      VIEW wWin.
    END PROCEDURE.
    
    PROCEDURE exitObject :
    /*------------------------------------------------------------------------------
      Purpose:  Window-specific override of this procedure which destroys 
                its contents and itself.
        Notes:  
    ------------------------------------------------------------------------------*/
    
      APPLY "CLOSE":U TO THIS-PROCEDURE.
      RETURN.
    
    END PROCEDURE.
    
    PROCEDURE pro_combo :
    /*------------------------------------------------------------------------------
      Purpose:     
      Parameters:  <none>
      Notes:       
    ------------------------------------------------------------------------------*/
    
    END PROCEDURE.
    


    essa é a tela que não esta funcionando a combo, quando é chamada pela outra tela.
    Estou usando o comando qdo clica no botão orçamento da tela 1
    DO:
    RUN tec\orcamento2.w.
    END.
  4. baltazar

    baltazar Membro Participativo

    Aparentemente está tudo bem.

    Tente meter uma 'message' no Main Block a ver se corre esse código.

Compartilhe esta Página