开发者

powerbuilder: link a drop down datawindow with its parent window

I have a datawindow(let its name be parent), in which I am displaying another datawindow(let us call it the child) as a drop down list. The parent takes two retrieval argument, named org_id and pccc_id. The child takes one retrieval argument named org_id, which should have the same value as the parent's org_id. Now I want to link these two retrieval arguments.

How can I do th开发者_C百科at ?


Firstly, I'd like confirm you are implementing the relationship using what's called a drop down datawindow (often referred to as a dddw)? Dddw's are very common in PB, so it should not be hard to find examples in the online help or elsewhere.

If you're in fact already doing it via dddw's, then I'm assuming the dddw represents a column in the result set of the parent datawindow? In the window, you can code for retrieval of the dddw. This is how it's done in many applications, sometimes in the window's initialization events or the parent datawindow control's events.

In many cases, the dddw is displaying code table data and doesn't require arguments, and can be set to autoretrieve in its properties. If the datawindow behind the dddw requires an argument, look up datawindowchild in the help files. You can manipulate the dddw's underlying dw once you have a handle to it. Check out the help files for method getChild().


In Parent Window..Item focus changed event for Getcolumname() of that column of drop down datawindow...write the following code..

integer morderid
DataWindowChild dwc_child

morderid = dw_parent.GetColumnNumber(dw_parent.getrow(),"ord_id")

dw_parent.GetChild("<field name>", dwc_child)
dwc_child.SetTransObject(SQLCA)
dwc_child.Retrieve(morderid)

morderid = dw_parent.GetColumnNumber(dw_parent.getrow(),"ord_id")

Ensure that, Auto Retrieve property off in DropDown.Datawindow. make sure that you give retrieval argument for that dropdown datawindow.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜