Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Getparent window name of a userobject

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I have past datawindow on user object and uo name is uo_invoice. I have past this object on a window (w_invoice). this window has a instant varialbe
il_pName. My problem is when user enter party name in datawindow then il_pName value change to TRUE in datawindow editchanged event. How I get this window instant variable in dw editchanged event. What I tried but not working is

UserObject uo_invoice
Window w_invoice

w_invocie = uo_invoice.GetParent()

But its not working. Anyone can give me idea how I changed the window instant
variable value in dw editchanged event and this dw is pasted on user object.

Thanks for HELP
 
Hi,

You are declaring the variable as:

window w_Invoice

This is incorrect. You already have a window by name w_Invoice and also a "class" by that name declared globally by PowerBuilder when you created it whereas you are trying to declare a variable name of an existing class! Your syntax should be:

w_Invoice lw_Invoice ;


However, there are a couple of other ways to achieve this:

1. In dw.EditChanged! event:

w_Invoice lw_Invoice ;
lw_Invoice = GetParent().GetParent() ;
lw_Invoice.il_PName = TRUE/FALSE or
lw_Invoice.of_SetPName( TRUE/FALSE )

2. Event mapping:

Declare a user-event on the u_Invoice:
event ue_EditChanged( <boolean value> )
Parent.Event DYNAMIC ue_EditChanged( <boolean value> ) ;

In the EditChanged! event of dw, script:
Parent.Event ue_EditChanged( <boolean value> )

Declare a user-event on the w_Invoice:
event ue_EditChanged( <boolean value> )
il_PName = <boolean value>

However, il_PName should actually be ib_PName by convention as it is of boolean type.

Regards,

--
PowerObject!
------------------------------------------
PowerBuilder/PFC Developers' Group
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top