CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 remove hyperlink to dead end

Print topic Send  topic

Author Message
ddmcse

Posts: 24
Posted: 02/26/2008, 3:54 AM

i have a link label that links to uploaded pictures the pathto the picture is stored in a field named picture
the link is in a field called vendor_proof_number
so i have a list of hyperlinked vendor_proof_numbers only problem is not every record has a picture that has been uploaded yet
so i would like to kill the hyperlink on records were there is no picture so users don't go down a dead end

if $form->picture->getvalue()!=null
drop the <a href images/{picture}
i'm confused as to where to write code i have added "images/" directory to the picture path in HTML

thanks
DD
_________________
http://www.buyrfidlabels.com
View profile  Send private message
wkempees
Posted: 02/26/2008, 5:06 AM

have you tried this:
If there is no picture then the flename of the picture will probably be
empty.
Test for empty filename and replace it with a '#'
The hash will point nowhere and the link will go nowhere.
You could (MySQL) do this with an ifnull() around your photoname.
Just a quick response.
Walter

datadoit
Posted: 02/26/2008, 6:08 AM

You can put your code in the grid's BeforeShowRow event.

if (!$Container->picture->GetValue()) {
$Container->vendor_proof_number_Link->Visible = false;
}

Make sure that your vendor proof number link's visibility property is
set to Dynamic.
datadoit
Posted: 02/26/2008, 6:12 AM

datadoit wrote:
> You can put your code in the grid's BeforeShowRow event.
>
> if (!$Container->picture->GetValue()) {
> $Container->vendor_proof_number_Link->Visible = false;
> }
>
> Make sure that your vendor proof number link's visibility property is
> set to Dynamic.
------------------------------

Additional note on this:

If you're not actually displaying the field "picture" in your grid, then
you'll not be able to check it's value using the GetValue() function.
You'll have to check for it's value via:

if ($!Container->ds->f("picture")) {
ddmcse

Posts: 24
Posted: 02/26/2008, 3:12 PM

that works and it removes the Vendor_proof_Number. i use the vendor P number to link when a file has been uploaded to show that file
I want to neuter the hyperlink when there is no file and stop the user from getting an error page not found type thing
maybe i need to go at it the other way and make the field a plain label and add a hyperlink where there is a file to link to
after pulling hair i'll have to settle with this for now
   
 global $YProofing;  
  if ($YProofing->picture->GetValue()=="")  
  {  
  $YProofining->Vendor_Proof_Number->SetValue("no_file ".$YProofing->Vendor_Proof_Number->GetValue());   
 } //   <a href="images/{Vendor_Proof_Number_Src}" target="_blank">{Vendor_Proof_Number}</a>      
// -------------------------  
//End Custom Code 

this adds " no_file" to the Vendor # i.e.
Vendor_Proof_Number
no_file 000008
but it's still a hyperlink that leads to a dead end /images i guess i could make a page that redirects back

this part is in my HTML
 <a href="images/{Vendor_Proof_Number_Src}" target="_blank">{Vendor_Proof_Number}</a> 

_________________
http://www.buyrfidlabels.com
View profile  Send private message
ddmcse

Posts: 24
Posted: 02/27/2008, 6:21 AM

I just realized that i don't have a beforeshowrow event on the grid i guess because it's report grid ?
i was going to just add the picture field and use that link instead of vendor_proof_number making my printing issue harder to fix
_________________
http://www.buyrfidlabels.com
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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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