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!

drop down datawindow

Status
Not open for further replies.

beti

Programmer
Oct 6, 2002
26
US
Hi all,

I wonder how to pass in a parameter to the child datawindow?
I need to pass in a parameter for the dwc_drop_down, so it will retrieve the proper data according to the parameter.

Here is my script:
DataWindowChild dwc_drop_down

dw_project.getChild('project', dwc_drop_down)
dwc_drop_down.setTransObject(sqlca)


if dwc_drop_down.retrieve('Project') = 0 then
dwc_drop_down.insertrow(0)
end if

dwc_drop_down.insertRow(1)
dw_project.setTransObject(sqlca)
dw_project.retrieve()
dw_project.insertrow(0)

Thanks
 
Beti,

Your parameter could be the value of the Project itself instead of just a string - 'Project'. If your Project is stored in a column, get it into a variable. Then pass this var to the dwc_drop_down.Retrieve() function. I guess, your situation may be like this:

string/long l_Project
dataWindowChild dwc_dropdown
//
IF dw_Project.GetChild( "project", dwc_dropdown ) = 1 THEN
//
l_Project = dw_Project.Object.Project[ dw_Project.GetRow() ]
// OR: l_Project = dw.GetItemXxx( row, "project" )
//
dwc_dropdown.SetTransObject( SQLCA )
//
IF dwc_dropdown.Retrieve( l_Project ) <= 0 THEN
dwc_dropdown.InsertRow( 0 )
END IF
//
END IF
//
...
...
...

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

Part and Inventory Search

Sponsor

Back
Top