CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Hiding hyperlinks

Print topic Send  topic

Author Message
Dante S.
Posted: 01/20/2004, 5:01 PM

Hello to all.

How do I control the visibility of hyperlinks created on a page using the
Add Link button on the Forms tab on the toolbox? I'm using CCS 2.2.2.40.
Advance thanks for any help.

DonB
Posted: 01/20/2004, 6:23 PM

There are two ways:

1. set the Visible property to False: Link1.Visible = false
2. change the Value property to an empty string (in the controls's Before
Show event): Link1.Value = ""

I usually do it the second way, because I often set the Value in the event
anyway. If the link happens to be bound to a field in the database, then
there is a third option - the link being hidden when the data field is empty
( a variation of #2 above).
--
DonB

http://www.gotodon.com/ccbth


"Dante S." <disandigan@loyolaplans.com> wrote in message
news:bukj1a$ost$1@news.codecharge.com...
> Hello to all.
>
> How do I control the visibility of hyperlinks created on a page using the
> Add Link button on the Forms tab on the toolbox? I'm using CCS 2.2.2.40.
> Advance thanks for any help.
>
>

Dante S.
Posted: 01/20/2004, 11:31 PM

Don, thank you very much! Worked like a charm.

Another question though. My links is listed with bullets on it's left side,
eg.

o Link1
o Link2
o Link3

So depending on the access level, I need to disable/enable or display/not
display Link2, so if the user is not allowed to view Link2, the list should
show

o Link1
o Link2

How can I go about this? Thanks again for the help.

----- Original Message -----
From: "DonB" <~ccbth~@gotodon.com>
Newsgroups: codechargestudio.asp
Sent: Wednesday, January 21, 2004 10:23 AM
Subject: Re: Hiding hyperlinks


> There are two ways:
>
> 1. set the Visible property to False: Link1.Visible = false
> 2. change the Value property to an empty string (in the controls's Before
> Show event): Link1.Value = ""
>
> I usually do it the second way, because I often set the Value in the event
> anyway. If the link happens to be bound to a field in the database, then
> there is a third option - the link being hidden when the data field is
empty
> ( a variation of #2 above).
> --
> DonB

peterr


Posts: 5971
Posted: 01/21/2004, 12:04 AM

Please try using custom code in the page's or form's "Before Show" event like this one:
  
'Lookup user's security level  
Dim security_level  
security_level = CCDLookup("sec_level", "users", "user_id=" & CCGetUserID(), DBConnection1)  
  
'Hide appropriate Links  
Select Case security_level  
 Case 1  
   Link1.Value = ""  
 Case 2  
   Link2.Value = ""  
End Select  
(of course you may need to replace various variables above with the ones that correspond to your database/system)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
DonB
Posted: 01/21/2004, 5:58 AM

Hiding the label does not remove the <LI> tag that exists in the HTML
template, so you will have to move the tag into the label:

If <condition for showing the list item> Then
Link1.Value = "<LI>" & Label1.Value
Else
Link1.Value = ""
End If

Do this within the Before Show event and be sure the Link is set to "Html"
Content type (not the default of "Text"). Remove the <LI> from the HTML
template.

Your HTML should end up looking something like this:

<UL>
{Link1}
{Link2}
{Link3}
</UL>

--
DonB

http://www.gotodon.com/ccbth


"Dante S." <disandigan@loyolaplans.com> wrote in message
news:bul9r5$fam$1@news.codecharge.com...
> Don, thank you very much! Worked like a charm.
>
> Another question though. My links is listed with bullets on it's left
side,
> eg.
>
> o Link1
> o Link2
> o Link3
>
> So depending on the access level, I need to disable/enable or display/not
> display Link2, so if the user is not allowed to view Link2, the list
should
> show
>
> o Link1
> o Link2
>
> How can I go about this? Thanks again for the help.
>
> ----- Original Message -----
> From: "DonB" <~ccbth~@gotodon.com>
> Newsgroups: codechargestudio.asp
> Sent: Wednesday, January 21, 2004 10:23 AM
> Subject: Re: Hiding hyperlinks
>
>
> > There are two ways:
> >
> > 1. set the Visible property to False: Link1.Visible = false
> > 2. change the Value property to an empty string (in the controls's
Before
> > Show event): Link1.Value = ""
> >
> > I usually do it the second way, because I often set the Value in the
event
> > anyway. If the link happens to be bound to a field in the database,
then
> > there is a third option - the link being hidden when the data field is
> empty
> > ( a variation of #2 above).
> > --
> > DonB
>
>

Dante S.
Posted: 01/21/2004, 3:36 PM

Thanks again so much Don. While waiting for your help, I did find another
way of accomplishing this. I right-click on the link and choose Edit Link
<NameOfLink> Layout... item on the context menu. I then checked the Extended
HTML checkbox. I then edited the HTML code to include the <li> tag between
the <!-- BEGIN {Link NameOfLink} --> and <!-- END {Link NameOfLink} -->
blocks (where {Link NameOfLink} is the name of the link). I added the code
in the Before Show event that will render the link visible or not visible
( I used the Link1.Visible=false or true method).

But I guess your method is better and will try it out. Thanks so much for
the help. :)

"DonB" <~ccbth~@gotodon.com> wrote in message
news:bum0hs$50j$1@news.codecharge.com...
> Hiding the label does not remove the <LI> tag that exists in the HTML
> template, so you will have to move the tag into the label:
>
> If <condition for showing the list item> Then
> Link1.Value = "<LI>" & Label1.Value
> Else
> Link1.Value = ""
> End If
>
> Do this within the Before Show event and be sure the Link is set to "Html"
> Content type (not the default of "Text"). Remove the <LI> from the HTML
> template.
>
> Your HTML should end up looking something like this:
>
> <UL>
> {Link1}
> {Link2}
> {Link3}
> </UL>
>
> --
> DonB
>
> http://www.gotodon.com/ccbth
>

DonB
Posted: 01/21/2004, 5:04 PM

This is a good point. The when HTML controls are enclosed in a Template
Block (that pair of comments which CCS recognizes and interprets), then they
will obey the Visible property. This will not work with a Label, however,
since Labels are not contained in a Template block.

The HTML is just a template - which means it is defining the just layout not
the data. CCS only cares that it can find and replace the various tags and
Template Blocks with data when the page renders - feel free to move the HTML
around or change it if you want to change the appearance from what you see
by default.

You can use this principle with Grids (and their HTML table layout) to
produce interesting results. The HTML table "row" is not constrained to
being a single row from your data source. As long as you understand that
the Grid control contains several Template Blocks which define how the rows
of your datasource (recordset) are handled, you can rearrange the HTML as
you like - you can even eliminate all the table HTML and replace it with
<LI> or <BR> or even fabricate XML elements if you like. Just be sure not
to alter the nesting of Template Blocks.

--
DonB

http://www.gotodon.com/ccbth


"Dante S." <disandigan@loyolaplans.com> wrote in message
news:bun2do$p91$1@news.codecharge.com...
> Thanks again so much Don. While waiting for your help, I did find another
> way of accomplishing this. I right-click on the link and choose Edit Link
> <NameOfLink> Layout... item on the context menu. I then checked the
Extended
> HTML checkbox. I then edited the HTML code to include the <li> tag between
> the <!-- BEGIN {Link NameOfLink} --> and <!-- END {Link NameOfLink} -->
> blocks (where {Link NameOfLink} is the name of the link). I added the code
> in the Before Show event that will render the link visible or not visible
> ( I used the Link1.Visible=false or true method).
>
> But I guess your method is better and will try it out. Thanks so much for
> the help. :)
>
> "DonB" <~ccbth~@gotodon.com> wrote in message
>news:bum0hs$50j$1@news.codecharge.com...
> > Hiding the label does not remove the <LI> tag that exists in the HTML
> > template, so you will have to move the tag into the label:
> >
> > If <condition for showing the list item> Then
> > Link1.Value = "<LI>" & Label1.Value
> > Else
> > Link1.Value = ""
> > End If
> >
> > Do this within the Before Show event and be sure the Link is set to
"Html"
> > Content type (not the default of "Text"). Remove the <LI> from the HTML
> > template.
> >
> > Your HTML should end up looking something like this:
> >
> > <UL>
> > {Link1}
> > {Link2}
> > {Link3}
> > </UL>
> >
> > --
> > DonB
> >
> > http://www.gotodon.com/ccbth
> >
>
>

nkdba

Posts: 3
Posted: 06/14/2004, 12:10 PM

Hi All,
I have another situation with LINKs.

We have record editor page, which is refered by 2-3 pages. Our requirement is to check the source and once record is edited, then it should return to the same source.

Ex.
Search Page1 --> Grid Page1 --> Record Page1 --> Grid Page1
Editable Grid Page2--> Record Page1 --> Editable Grid Page2

So, Buttons (Add/Submit/Delete/Cancel) Return Page parameters should returned to the source page only.

Thanks
NK
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.