Availability of Widget in a particular frame

Posted by Sachin Acharya on 23-Feb-2016 03:20

Hi,

I am trying to find whether any widget (FILL-IN) with particular name using code.

Based on the availability of the particular widget, I need to perform some operation.

Eg:

If avail vSearch then

    ON VALUE-CHANGE OF vSearch IN FRAME {&FRAME-NAME}

DO:

APPLY "ANY-KEY" TO vSearch IN FRAME {&FRAME-NAME}.

END.

Can anyone tell me how exactly I can perform the same operation.

Thanks in advance,

Sachin

All Replies

Posted by James Palmer on 23-Feb-2016 03:31

You can walk the widget tree to find the widget (there's loads of documentation on how to do this). Once you have the widget you will also have the widget handle. You can attach triggers and apply triggers to that handle.

So on value-change of vhandle do something.

Posted by Gunnar.Vogt on 29-Mar-2016 06:37

This should get you started:

FUNCTION hyGetWidgetByName returns widget-handle

 ( INPUT pcWidgetName  AS character,

   INPUT phFrameHandle AS handle ) :

/* Description ---------------------------------------------------------------*/

/*                                                                            */

/* returns a widget handle                                                    */

/*                                                                            */

/* Notes ---------------------------------------------------------------------*/

/*                                                                            */

/*                                                                            */

/*                                                                            */

/* Parameters ----------------------------------------------------------------*/

/*                                                                            */

/* pcWidgetName       internal Widget Name                                    */

/*                                                                            */

/* Examples ------------------------------------------------------------------*/

/*                                                                            */

/*                                                                            */

/*                                                                            */

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

/* Variables -----------------------------------------------------------------*/

 define variable hField  as widget-handle no-undo.

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

/* Processing                                                                 */

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

 assign

   hField = phFrameHandle

   hField = hField:first-child  /* widget group handle  */

   hField = hField:first-child  /* first child in group */

   .

 do while valid-handle(hField):

   if hField:Name = pcWidgetName then

     return hField:handle.

   hField = hField:next-sibling.

 end. /* do */

 return ?.

end function. /* hyGetWidgetByName */

Posted by shireeshn on 29-Mar-2016 09:30

Thanks for answers & you suggestions. This is not related to progress objects, this related to .net controls, both are diff.

This thread is closed