Schultz’s PowerBuilder Notes

PFC DataWindow Service Questions


I get the error “DataWindow is not Updateable” but I am trying to save a different datawindow.

If you have a datawindow which you will not want to update, such as a external source datawindow containing a DDDW, you need to call the function of_SetUpdateable(False) in the dw control’s constructor event

this.of_SetUpdateable ( False )

The function instance_name.of_Isupdateable() will return a boolean showing the update property of the dw.

I am doing a sharedata and when I attempt to save changes I get the error Message “Rows changed between retrieve and update – rollback”

Only one datawindow can be updatable at a time. Make sure the other dw which are sharing data have the following:

this.of_SetUpdateable(False)

How do I append data to a datastore (n_ds)?

ids_loans.of_SetAppend(true)

How do I make a datawindow not updateable?

this.of_SetUpdateable(False)

You probably don’t want the RMB pop-up menu functionality

this.ib_rmbmenu = False

How do I update a datawindow?

Trigger the window’s pfc_save event to update all datawindows in the window. If you want to just save a particular datawindow and not the others, trigger that datawindow’s pfc_save. If you want to be old-fashioned and save the dw:

dw_1.of_update(true, true)

Note: arguments are ( accepttext, resetflags {, insert, update, delete } ) Of_update updates the DataWindow. If the multitable update service is enabled, this event updates all specified tables.

How do I set a u_dw control as the active dw.

You don’t have to do anything. The last dw with focus is considered to be the active dw. So simply SetFocus(dw_1). This works even if the dw is buried in several layers of user objects.

It seems like most DataWindows turn on the same services. Could you list the script to turn on these commonly used services?

this.of_SetFind(True)
this.of_SetFilter(True)
this.of_SetPrintPreview(True)
this.of_SetSort(True)

What should I do to make a grid view read only?

this.of_SetUpdateable(False)
this.of_SetRowSelect(True)
this.inv_rowselect.of_SetStyle(0)
this.Modify("DataWindow.ReadOnly=Yes")
Advertisements

July 10, 2008 - Posted by | 3. PFC, Datawindow Services | , , , ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: