Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SelectRow in DW using PFC!!!

97 views
Skip to first unread message

Peter Tam

unread,
Jan 15, 2001, 6:22:36 AM1/15/01
to
hi

I am using datawindow that is instance from u_dw
and set the pfc service.

of_setRowSelect(TRUE)
of_setRowManager(TRUE)
of_SetSort(TRUE)
of_SetProperty(TRUE)
this.inv_rowselect.of_SetStyle(this.inv_rowselect.EXTENDED)

in the run-time, I can select the datawindw in extended row that is
hightlighted .....( not black color ) only deep blue color..

but while I use the
########################################################
For li_Index = 1 to ll_RowCount
IF dw_master.IsSelected(li_Index) Then
istr_rp.ls_Row[UPPERBOUND(ls_Row)+1] =
string(dw_master.Object.stockcode[li_Index])
lb_Selected = TRUE
END IF
Next
########################################################

But I only selected the last clicked row ..... but I very don't know why
...may be i make a misunderstand of
PFC service of select row..

what can I do to select all row (data) into a array like the above code !!!

John Evenosky

unread,
Jan 15, 2001, 8:34:55 AM1/15/01
to
Try using a DataWindow data expression.

For example: dw_master.Object.stockcode.Selected to get the values from the
stockcode column for all the selected rows.
or
dw_master.Object.stockcode.Current to get the values
from the stockcode column for all rows.

Peter Tam <pe...@cdma.com.hk> wrote in message
news:iDCsrcu...@forums.sybase.com...

Philip Salgannik

unread,
Jan 15, 2001, 11:05:05 AM1/15/01
to
First of all rowselection service (not surprisingly) has a nice method:

long RetV = pfc_n_cst_dwsrv_rowselection.FUNCTION STATIC|DYNAMIC
TRIGGER|POST of_selectedcount(long al_selectedrows[])


"John Evenosky" <jevenosky 'at' colburn.com> wrote in message
news:UnFQDrv...@forums.sybase.com...

John Evenosky

unread,
Jan 15, 2001, 11:22:57 AM1/15/01
to
But then he still has to use a for loop to read all of the individual values
into his array. Using the data expression will still be more efficient
besides being easier and faster to code and maintain.


Philip Salgannik <NOSPAM_p...@phtcorp.com> wrote in message
news:VFezo8w...@forums.sybase.com...

Philip Salgannik

unread,
Jan 15, 2001, 12:55:56 PM1/15/01
to
If he does his loop on the array of row numbers set by of_selectedcount(..)
he will be all set with his existing code.

"John Evenosky" <jevenosky 'at' colburn.com> wrote in message

news:26cp8Ix...@forums.sybase.com...

Peter Tam

unread,
Jan 15, 2001, 9:31:24 PM1/15/01
to
Sorry, I don't understand the code of_selectedcount().. can you explain it
more
and with my code that is posted in the first one !!!

I don't know how to select the highlighted row in datawindow using PFC

thx


"Philip Salgannik" <NOSPAM_p...@phtcorp.com> wrote in message

news:X1fTl6x...@forums.sybase.com...

Peter Tam

unread,
Jan 15, 2001, 11:00:08 PM1/15/01
to
also, I don't know the syntax of "of_selectedcount(long Row[])"

i don't know what can I pass into the of_selectedcount(XXX) <--- here !!

can you give me an example ?

my case is like that

there is a datawindow (grid format) called "dw_1"
allow user to select more than one row

after that , there is a button called "ok"
after trigger the event of clicked in button
It will assign the selected row into the string array called ls_Row[]
So I use a for-loop to scan the selected one...

but it fails, it only show the last selected one to me .... what is the
problem ?
where I make mistake ?
thx


"Peter Tam" <pe...@cdma.com.hk> wrote in message

news:a6N2fY2...@forums.sybase.com...

Russell Harvey

unread,
Jan 18, 2001, 9:00:51 PM1/18/01
to
try something like:

long ll_selectedCount
long ll_row[]
long i
string ls_code[]

// This function puts the row numbers of the selected rows in ll_row.
// The return value (in ll_selectedCount) is the number of selected rows.
ll_selectedCount = dw_1.inv_rowSelect.of_selectedCount(ll_row)

FOR i=1 TO ll_selectedCount
// Process the row. For example, if you wanted to read all the values of a
field
// into a string array:
ls_code[i] = dw_1.getItemString(ll_row[i], 'code')
NEXT

hth
Russell Harvey
ITG, Inc.

0 new messages