On Fri, Jul 6, 2012 at 7:42 AM, Roger Bilau <s...@bilau.de> wrote:
>
> in the past I used ooRexx without the object oriented part. Now I make my 
> first step's
> with classes and methods because I want to integrate some dialog functions in 
> my scripts.
> My first try is to combine a routine that read column name from DB2 and I 
> like to show it in a
> list view window. For this I take the columnClickListView.rex sample and 
> modified it.


Sounds like a good start.  But, I would suggest that you think of it
as taking a list view dialog and combining it with your routine.  It's
a subtle point, but I think you will have less trouble trying to add a
routine to a list view dialog than you will have trying to force a
routine to use a dialog.


>
>
> My problem is: the variables I filled with the data from DB2 I cannot read in 
> the ::method initDialog


Why not? ;-)  Post a little more information on what you routine that
reads the column names from DB2 looks like.

Here is a rough sketch of an approach.

::method initDialog

  -- Get a reference to the list view.
  list = self~newListView(IDC_LISTVIEW)

  list~addExtendedStyle("FULLROWSELECT GRIDLINES CHECKBOXES HEADERDRAGDROP")

  -- Call your routine to get the column names, but I don't have any
idea what you routine
  -- looks like so it is hard to do this part.

  col1Name = getDB2columnName(1)
  list~insertColumn(0, col1Name, 80)

  col2Name = getDB2columnName(2)
  list~insertColumn(1, col2Name, 80)

  col3Name = getDB2columnName(3)
  list~insertColumn(2, col3Name, 70)

  do i = 1 to 200
    data = getDB2rowData(i)
    list~addRow(i, data~col1, data~col2, data~col3)
  end

There is no reason you can not call your routine from the dialog code.

The above code's idea is this: call your routine to get the column
names for a table in DB2 that has 3 columns.  Set the column names in
the list view to those 3 column names.  Call your routine to get the
row data for 200 rows and fill in the list view with that data.

The other approach would be to assemble your data first using your DB2
routines and pass it into the dialog.  But, the approach above would
be better I think.

As is usual in trying to give help, the more information you provide
the better help you will get.  Without knowing anything about what
your existing routines are like, it is difficult to give you back
specifics.

--
Mark Miesfeld

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to