I thought of adding a checkbox object to the dw control, but I think a
checkbox object has to be associated with a column in the dw, whereas
this checkbox would just be for selection purposes and I don't think
you could select multiple rows. Then I thought to make a separate
listbox control and populate it from the dw, but I'm not sure
Powerbuilder listboxes allow for multiple selection. Any thoughts
would be appreciated.
We had to deal with the exact case just a few months ago. Yes the PB
listbox does allow for multi select. In our case, we ended up
replacing the DW with a listview control (also allows for multi
select, and in addition, allows for more options than listbox
control).
I guess I was hoping to somehow allow the users to check checkboxes
(rather than just selecting the items in a listview). I just don't
think that you can select multiple rows in a dw, and I can't think how
I could incorporate checkboxes into that even if you could.
You can then use dot notation to get all the selected values from a
single column (or multiple) into an array with a single line of code
The checkbox solution is also very easy to implement. Your SELECT
statement would return a dummy column used for the selection
checkbox. Something like:
SELECT 0 AS Selected
FROM ....
Mike
As noted by another reply, the pfc has an example implementation.
Then once the rows are selected, there are a number of ways to find
them and use the values from these rows.
eg;
ll_row = getselectedrow( ...
ll_row = find('isselected()', ...
lsa_values = dw_1.object.column.selected
the same as dummy column in sql, you could also just use computed
column in sql painter like 0 as 'selected_flag'
However, I'd prefer to stick with the dw I have and to implement a
solution using checkboxes, but I'm not sure I'm on the right path. In
the SQL painter, I added a column in the SELECT clause of the dw's SQL
so it now reads:
SELECT col1, col2, col3, 0 AS 'selected_flag'
FROM mytable
which added a new column object in my dw. I then set that col object
as StyleType checkbox. But I'm not sure how to set the Update
Properties of the dw. The actual columns of mytable shouldn't be
updated, but I do want users to be able to check col object
'selected_flag' when the app is running. Could someone push me in the
right direction here? Thanks.
(btw, the solution involving a checkbox object in the dw is a
different idea than the solution involving multiple row selection,
right?)
> column in sql painter like 0 as 'selected_flag'- Hide quoted text -
>
> - Show quoted text -