pfc_accepttext


pfcmain.pbl   >   pfc_n_ds   >   pfc_accepttext   

Full name pfc_n_ds.pfc_accepttext
Access public
Extend of integer
Return value integer
Prototype event integer pfc_accepttext(boolean)

Name Datatype
No Data

Name Datatype
lb_skipmessage boolean
li_rc integer
ls_message string
ls_msgparm string[2]
lw_parent window
lw_pfcparent w_master

event pfc_accepttext;//////////////////////////////////////////////////////////////////////////////
//
//	Event:  pfc_accepttext
//
//	Arguments:
//	ab_focusonerror Disregarded parameter.
//
//	Returns:  Integer
//	 1 = success
//	-1 = error
//	
//	Description:	 
//	Perform an accepttext.
//
//	Note:
//	In most cases, since users cannot enter data into a datastore, the
//	accepttext operation should not be allowed to fail by the developer.
//	Since a datastore is a nonvisual object, the accepttext does not
//	generate fail messages.
//
//////////////////////////////////////////////////////////////////////////////
//	
//	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
string	ls_message
string	ls_msgparm[2]
boolean	lb_skipmessage
window	lw_parent
w_master	lw_pfcparent

// Perform AcceptText, check rc
li_rc = this.AcceptText()
If li_rc < 0 Then 

	// Get a reference to the window
	this.of_GetParentWindow (lw_parent) 
	if IsValid (lw_parent) then
		if lw_parent.TriggerEvent ("pfc_descendant") = 1 then
			lw_pfcparent = lw_parent
		end if
	end if
	
	// Make sure the window is not closing.  
	if IsValid (lw_pfcparent) then
		if lw_pfcparent.of_GetCloseStatus() then
			// It is closing, so don't show errors now.	
			lb_skipmessage = True
		end if
	end if
		
	// Determine if the message should be displayed.
	If Not lb_skipmessage Then
		// Get the column information for the message.
		ls_msgparm[1] = this.GetColumnName()
		ls_msgparm[2] = string(this.GetRow())

		If IsValid(gnv_app.inv_error) Then
			gnv_app.inv_error.of_Message ('pfc_dsaccepttext', ls_msgparm, &
						gnv_app.iapp_object.DisplayName)					
		Else
			ls_message = "Failed accepttext validation on datastore.  "+&
							 "Column "+ ls_msgparm[1] + &
							 " on row "+ ls_msgparm[2] + "."
			of_Messagebox ("pfc_acceptext_failedvalidation", gnv_app.iapp_object.DisplayName, &
				ls_message, Exclamation!, Ok!, 1)
		End If
	End If
	
	Return -1
End If
	
Return 1
end event

     
Name Owner
pfc_n_ds.of_AcceptText pfc_n_ds

     
Name Owner
powerobject.triggerevent powerobject
datastore.accepttext datastore
datastore.getcolumnname datastore
datastore.getrow datastore
systemfunctions.isvalid systemfunctions
systemfunctions.string systemfunctions
pfc_n_cst_error.of_message pfc_n_cst_error
pfc_w_master.of_getclosestatus pfc_w_master
pfc_n_ds.of_getparentwindow pfc_n_ds
pfc_n_ds.of_messagebox pfc_n_ds

     
Full name
demopfc

     
Name Scope
No Data