+ checkbox level_1
+ checkbox level_2 row1
+ checkbox level_2 row2
+ checkbox level_2 row3
+ checkbox_level_3 row1
+ checkbox_level_3 row2
and so on
so, if I select the checkbox in leve_1 I want to select automaticaly all
checkboxes of level_2 and level_3
if I select the checkbox in leve_2 I want to select automaticaly select all
checkboxes of level_3
the same should work if I deselect a checkbox.
thanks for answer.
(I'am working with PB11.5 / Vista)
Definitions
Client - highest level
region - any value that splits out the entities below
management company - a conglomerate that manages the entities
brand - a manufacturer's various brands
store - a specific retail store location, such as as McDonald's restaurant
on 10 th street , each has a unique ID
I have the following levels
1 - Client
2 - Region
3 - Management Company
4 - brand
store detail (detail band)
example data
1 - Star
2 - West
3 - IHG
4 - Craft
A craft store id = 101
B craft store id = 120
4 - office
C craft store id = 102
4 - N/A //the brand is null in the Db, thus set the value =
'N/A'
D craft store id = 102
E craft store id = 300
X craft store id = 202
2 - East
3 - IHG
4 - Craft
Z craft store id = 999
3 - N/A
4 - Craft
S craft store id = 444
U craft store id = 555
if the user selects a level then an entry in another table needs to be added
stating the level and value that they want.
IE: if they select the brand CRAFT under the Management Company IHG, under
the Region EAST, under the client Star, then the following entries should be
made
Level Value
4 Craft
3 IHG
2 EAST
1 Star
if the user selects one or more detail band stores then the IDs of the
stores are to be palced in the table.
IE:if they select store S and store U, then following entries should be
made.
Level Value
null 444
null 555
if the user did both selections above the table values would be
Level Value
4 Craft
3 IHG
2 EAST
1 Star
null 444
null 555
it would be interpreted as all stores who are under the Star client, East
region, IHG management company, Craft brand OR the specific store of ids in
(444,555)
The problem that I had which I think is similar to what you are trying to do
is, if the level has the value N/A I was lost as to what stores to tag, thus
I decided that if the user clicks on the level that has N/A I will
automatically select the store ids directly below that level.
in the TreeNodeSelected event I capture the level the user selected and test
that the user didn't select a detail band row and build a string to use with
the FIND() method in a user event elsewhere.
Initially I used a filter process, but once you un-filter the rows the view
is colapsed again, and doesn't bring you back to where you were.
ROW in this event seems to be the first row in the detail band that is under
your tree level, so to get the value I needed I made sure the column that
represented the tree level was in the detail band, but invisible.
Level dwo.name
1 valuetrakclient_1
2 region_1
3 mgmtco_1
4 brand_1
detail valuetrackclient, region, mgmtco, brand <-invisible
visible -> operatorid, operator_name, operator_address
//TreeNodeSelected
ll_selectedrow = this.getselectedrow( 0)
If row > 0 then
ls_brand = this.object.brand[row]
ls_mgmtco = this.object.mgmtco[row]
ls_region = this.object.region[row]
ls_valuetrakclient = this.object.valuetrakclient[row]
If ll_selectedrow = 0 and row<> 0 then
Choose case grouplevel
case 4
//brand
if ls_brand = 'N/A' then
ls_filter = 'brand ="'+ ls_brand + '" and mgmtco = "'+ ls_mgmtco + '"
and region = "'+ls_region + '" and valuetrakclient = "' + ls_valuetrakclient
+ '"'
this.event ue_find_and_select(ls_filter, row)
// this.setredraw( False)
// ll_rtc = this.setfilter( ls_filter)
// ll_rtc = this.filter( )
// ll_rtc = this.selectrow( 0, true)
//
// ll_rtc = this.setfilter( blankfilter )
// ll_rtc = this.filter( )
// this.setredraw( true)
END IF
Case 3
//mgmtco
If ls_mgmtco = 'N/A' then
ls_filter = 'mgmtco = "'+ ls_mgmtco + '" and region = "'+ls_region + '"
and valuetrakclient = "' + ls_valuetrakclient + '"'
this.event ue_find_and_select(ls_filter, row)
END IF
case 2
//region
IF ls_region = 'N/A' then
ls_filter = 'region = "'+ls_region + '" and valuetrakclient = "' +
ls_valuetrakclient + '"'
this.event ue_find_and_select(ls_filter, row)
END IF
Case 1
//valutrackclient
if ls_valuetrakclient = 'N/A' then
ls_filter = 'valuetrakclient = "' + ls_valuetrakclient + '"'
this.event ue_find_and_select(ls_filter, row)
END IF
end choose
END IF
End IF
//ue_find_and_select
long ll_foundrow, ll_rowcount
this.selectrow( 0, false)
ll_rowcount = this.rowcount()
ll_foundrow = this.find( as_find , al_startrow ,ll_rowcount)
Do While ll_foundrow <> 0
SetPointer(hourglass!)
this.selectrow( ll_foundrow, true)
ll_foundrow = this.find( as_find , ll_foundrow + 1 ,ll_rowcount)
Loop
SetPointer(ARROW!)
We pass in the ROW parm to the userevent, since the value is the first row
that in under the tree level selected. We loop thru each detail band until
the combination of the various levels are no longer found.
In your case you would leave off these if statements in the treeNodeSelected
event
IF ls_valuetrakclient = 'N/A' then
IF ls_region = 'N/A' then
IF ls_brand = 'N/A' then
IF ls_mgmtco = 'N/A' then
I believe the Filter() approach will still work, because you can "expand"
after the unfilter..
My problem is I don't know how to get the value of the levels outside of the
treeNodeSelected event.
"Andreas" <abas...@uniplus.de> wrote in message
news:48f5a337@forums-1-dub...