Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Treeveiw and Conditional Branching (InsertFirstItem)

2 posts in Objects Last posting was on 2004-09-29 15:28:48.0Z
mdavis Posted on 2004-09-17 17:53:11.0Z
Sender: 3c46.414b2031.1804289383@sybase.com
From: mdavis@espeed.com
Newsgroups: sybase.public.powerbuilder.objects
Subject: Treeveiw and Conditional Branching (InsertFirstItem)
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <414b2487.3cc6.1681692777@sybase.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="-=_forums-1-dub414b2487"
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 Sep 2004 10:53:11 -0700
X-Trace: forums-1-dub 1095443591 10.22.241.41 (17 Sep 2004 10:53:11 -0700)
X-Original-Trace: 17 Sep 2004 10:53:11 -0700, 10.22.241.41
Lines: 2112
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8012
Article PK: 735284

I'm using PB 8.0.1 Build 8004.

OK no one answered (and included afterwards) and I figured
pretty much of this out using InsertItemFirst. My problem
is if the EditLabel Property is set to False as part of the
Control's Properties where do I set it to True.

I have put it in Clicked Event (Case level = 3) but I see
that is not the right place because the 2nd click fires this
Event again and the box never appears to indicate editing is
allowed .. maybe the use of some variable to indicate the
EditLabel Property state so it executes setting to true only
when it's False.

I'll play around some mor but any tips or alternatives very
welcome.

My initial submittance no follows
------------------------------------------------
I have a treeview that has been in place and consists of 2
levels ..
See attached for Print Screen. The first level represents
what is
called a Business and the 2nd level a Service Type ... A
Service
Type is selected and then for every Business it shows
whether that
Service Type is ON or OFF via checkboxes. Only one checkbox
can be checked at a time.

+---Business1
--- ServiceType1 (if checked ON)
--- No ServiceType1 (else if checked OFF)
+--Business2
--- ServiceType1
--- No ServiceType1
+--Business3
--- ServiceType1
--- No Service Type1

The new feature being asked will only apply to a single
Service
Type lets say "ServiceType25". It will have the 2 initials
levels as
above ..

+--Business1
--- ServiceType25
--- No ServiceType25
+--Business2
--- ServiceType25
--- No ServiceType25

but there has been a column added to the table which
represents
a "Service Value". This "Service Value" should display as
the label
at the 3rd level only when "ServiceType25" is checked ON and
show be modifiable.

So I guess I'm asking help regarding 2 things:
- how to create 3rd level based on checkbox of Service being
turned ON and getting rid of it if turned off

- having a label editable and capturing the value for
storage into
database.

Or direct me to supporting documents.

Thanks In Advance,
Vita


Wallace Inman Posted on 2004-09-29 15:28:48.0Z
Sender: 1b2f.415acf33.1804289383@sybase.com
From: Wallace Inman
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Treeveiw and Conditional Branching (InsertFirstItem)
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <415ad4b0.1b91.1681692777@sybase.com>
References: <414b2487.3cc6.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 29 Sep 2004 08:28:48 -0700
X-Trace: forums-1-dub 1096471728 10.22.241.41 (29 Sep 2004 08:28:48 -0700)
X-Original-Trace: 29 Sep 2004 08:28:48 -0700, 10.22.241.41
Lines: 111
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8029
Article PK: 735298


> I'm using PB 8.0.1 Build 8004.
>
> OK no one answered (and included afterwards) and I figured
> pretty much of this out using InsertItemFirst. My problem
> is if the EditLabel Property is set to False as part of
> the Control's Properties where do I set it to True.
>
> I have put it in Clicked Event (Case level = 3) but I see
> that is not the right place because the 2nd click fires
> this Event again and the box never appears to indicate
> editing is allowed .. maybe the use of some variable to
> indicate the EditLabel Property state so it executes
> setting to true only when it's False.
>
> I'll play around some mor but any tips or alternatives
> very welcome.
>
> My initial submittance no follows
> ------------------------------------------------
> I have a treeview that has been in place and consists of 2
> levels ..
> See attached for Print Screen. The first level represents
> what is
> called a Business and the 2nd level a Service Type ... A
> Service
> Type is selected and then for every Business it shows
> whether that
> Service Type is ON or OFF via checkboxes. Only one
> checkbox can be checked at a time.
>
> +---Business1
> --- ServiceType1 (if checked ON)
> --- No ServiceType1 (else if checked OFF)
> +--Business2
> --- ServiceType1
> --- No ServiceType1
> +--Business3
> --- ServiceType1
> --- No Service Type1
>
> The new feature being asked will only apply to a single
> Service
> Type lets say "ServiceType25". It will have the 2
> initials levels as
> above ..
>
> +--Business1
> --- ServiceType25
> --- No ServiceType25
> +--Business2
> --- ServiceType25
> --- No ServiceType25
>
> but there has been a column added to the table which
> represents
> a "Service Value". This "Service Value" should display as
> the label
> at the 3rd level only when "ServiceType25" is checked ON
> and show be modifiable.
>
> So I guess I'm asking help regarding 2 things:
> - how to create 3rd level based on checkbox of Service
> being turned ON and getting rid of it if turned off
>

@@@@ Selectionchanged event on second level

treeviewitem l_tvitem

tv_list.GetItem(newhandle, l_tvitem)

This.SetItem(handle, l_tvitem)

//Get the value of your current levels "Service
Value"

If service_value = 'Y' Then
l_tvitem.Children = True
Else
l_tvitem.Children = False
End If

This.SetItem(newhandle, l_tvitem)
This will turn on and off the expansion "+" sign box for the
branch.

> - having a label editable and capturing the value for
> storage into
> database.

@@@@ How about stuffing it into the Tag value and parsing it
out when you save. In the tree I currently use I store
arguments for the next level's retrieval in the current
branch's tag with "arguments="preceding a comma delineated
string list (i.e.
"Arguments=15824,Jackson,whateveryouneed").
Thess are parsed into a structure which is passed to the
datastore componenet to rerieve the information. You might
be able to reverse that and send the data needed to update
your labels. Then refresh and redisplay the tree with the
new labels in place.

Hope this helps.....
Wally

> Or direct me to supporting documents.
>
> Thanks In Advance,
> Vita
>
>
> [Attachment: tv1.doc]