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
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.
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 */
Thanks for answers & you suggestions. This is not related to progress objects, this related to .net controls, both are diff.