Resolved How to handle a ProBindingSource ?

Pioux

New Member
Hi everyone !

I'm doing my first steps with the .net features of the 10.2b version of OpenEdge. I have to convert a screen made with the AppBuilder tool, into a .net screen using Eclipse.

The old screen was doing an AppServer request and get back a filled temp-table from the remote process. So I've made a new ABL Form, and added a DataGrid into it. Then I've created a ProBindingSource, and I've seen that we can fill it with a physical table (from the connected DB) by using the GUI, but I haven't seen how to use a temp-table to fill the ProBindingSource.

I've searched on the Internet, but haven't found something useful. Could anyone help me ?
 

Stefan

Well-Known Member
Set the BindingSource:HANDLE to the query (other options available - see help) on your temp-table. In the BindingSource designer you can determine which fields are used.

Code:
DEFINE PRIVATE VARIABLE bindingSource1 AS Progress.Data.BindingSource NO-UNDO.

DEFINE TEMP-TABLE tt no-undo
   FIELD cc AS CHARACTER.

CREATE tt. tt.cc = "hello".
CREATE tt. tt.cc = "world".

DEFINE VARIABLE hq AS HANDLE.

CREATE QUERY hq.
hq:ADD-BUFFER( BUFFER tt:HANDLE ).
hq:QUERY-PREPARE( "for each tt" ).
hq:QUERY-OPEN().

bindingsource1:HANDLE = hq.

The bindingSource code generated by the designer:

Code:
      /*  */
      /* bindingSource1 */
      /*  */
      THIS-OBJECT:bindingSource1:MaxDataGuess = 0.
      THIS-OBJECT:bindingSource1:NoLOBs = FALSE.
      THIS-OBJECT:bindingSource1:Position = 0.
      @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
      DEFINE VARIABLE arrayvar1 AS "Progress.Data.TableDesc[]" NO-UNDO.
      arrayvar1 = NEW "Progress.Data.TableDesc[]"(0).
      tableDesc1:ChildTables = arrayvar1.
      @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
      DEFINE VARIABLE arrayvar2 AS Progress.Data.ColumnPropDesc EXTENT 1 NO-UNDO.
      arrayvar2[1] = NEW Progress.Data.ColumnPropDesc("cc", "Field1", Progress.Data.DataType:CHARACTER).
      tableDesc1:Columns = arrayvar2.
      THIS-OBJECT:bindingSource1:TableSchema = tableDesc1.

All of the above was done using 11.2.1.
 

Pioux

New Member
Thanks a lot Stefan ! It's works perfectly. It was very simple, I think I was searching something too complicated :)
 
Top