selectionchanged


pfcutil.pbl   >   pfc_u_tabpg_dwproperty_status   >   ddlb_rowstatus   >   selectionchanged   

Full name pfc_u_tabpg_dwproperty_status.ddlb_rowstatus.selectionchanged
Access public
Extend of
Return value
Prototype event selectionchanged()

Name Datatype
No Data

Name Datatype
le_currentstatus dwItemStatus
le_desiredstatus dwItemStatus
li_rc integer
ll_currow long
lnv_conversion n_cst_conversion
ls_desiredstatus string

event selectionchanged;call super::selectionchanged;//////////////////////////////////////////////////////////////////////////////
//
//	Event:  selectionchanged
//	
//	Description:
//	Attempt to change the rowstatus to the new selection.
//
//	Note:
//	From PB help.
//	For rows, not all status changes are valid. 
//	For example, you cannot change NewModified! to New!. 
//	Some status changes, although allowed, result in a different status than you specify. 
//	For example, changing DataModified! to New! results in a status of NewModified!. 
//
//	The following table illustrates the effect of changing the row's original status 
//	to another status specified with SetItemStatus. If the table says Yes, 
//	then the specified status takes effect. If the table says No, 
//	specifying that status in SetItemStatus has no effect. 
//	If the table specifies a different status, it is the status that results
//	from the status you specify.
//	
//	Specified status 
//	Original status	|	New!				NewModified!	DataModified!	NotModified!
//							------------------------------------------------------------
//	New!					|	-					Yes				Yes				No
//	NewModified!		|	No					-					Yes				New!
//	DataModified!		|	NewModified!	Yes				-					Yes
//	NotModified!		|	Yes				Yes				Yes				-
//
//	When a particular status change is not allowed, you can call SetItemStatus 
//	more than once to set the row to the desired setting. For example, if you
//	want to set a row with New! status to NotModified!, you can set it first
//	to DataModified! and then to NotModified!.
//
//////////////////////////////////////////////////////////////////////////////
//	
//	Revision History
//
//	Version
//	6.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1997 Sybase, Inc. and its subsidiaries.  All rights reserved.
//	Any distribution of the PowerBuilder Foundation Classes (PFC)
//	source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////

integer		li_rc
long			ll_currow
string		ls_desiredstatus
dwItemStatus le_currentstatus
dwItemStatus le_desiredstatus
n_cst_conversion lnv_conversion

// Get the current datawindow row.
ll_currow = dw_requestorview.GetRow()

If ll_currow > 0 Then
	// Get the desired Row status.
	ls_desiredstatus = this.Text
	li_rc = lnv_conversion.of_dwItemStatus(ls_desiredstatus, le_desiredstatus)
	
	// Get the current Row status.
	le_currentstatus = dw_requestorview.GetItemStatus(ll_currow, 0, Primary!)
			
	If le_currentstatus = le_desiredstatus Then 
		// Row status requested is the same as the current.
		Return
	End If	
	
	If li_rc > 0 Then
		If ib_assistrowstatus  Then
			// Depending on the desired status, there may be a need for intermediate settings.
			If le_currentstatus = New! and le_desiredstatus = NotModified! Then
				li_rc = dw_requestorview.SetItemStatus(ll_currow, 0, Primary!, DataModified!	)	
			ElseIf le_currentstatus = NewModified! and le_desiredstatus = New! Then
				li_rc = dw_requestorview.SetItemStatus(ll_currow, 0, Primary!, DataModified!	)		
				li_rc = dw_requestorview.SetItemStatus(ll_currow, 0, Primary!, NotModified!)
			ElseIf le_currentstatus = NewModified! and le_desiredstatus = NotModified! Then
				li_rc = dw_requestorview.SetItemStatus(ll_currow, 0, Primary!, DataModified!)
			ElseIf le_currentstatus = DataModified! and le_desiredstatus = New! Then
				li_rc = dw_requestorview.SetItemStatus(ll_currow, 0, Primary!, NotModified!)
			End If
		End If
		
		// Perform final or firstAndOnly step to change the staus.
		li_rc = dw_requestorview.SetItemStatus(ll_currow, 0, Primary!, le_desiredstatus)

	End If
End If

// Update the onscreen stats.
Parent.Event pfc_PropertyStats()
end event

     
Name Owner
No Data

     
Name Owner
datawindow.getitemstatus datawindow
datawindow.getrow datawindow
datawindow.setitemstatus datawindow
pfc_n_cst_conversion.of_dwitemstatus pfc_n_cst_conversion
dropdownlistbox.selectionchanged dropdownlistbox
pfc_u_tabpg_dwproperty_status.pfc_propertystats pfc_u_tabpg_dwproperty_status

     
Full name
pfc_u_tabpg_dwproperty_status

     
Name Scope
No Data