CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Dynamically Change src property

Print topic Send  topic

Author Message
DrivenTooFar

Posts: 10
Posted: 10/23/2007, 12:29 PM

I have a button that is of type image that gets it's image from the src property. What I want to do is, depending on the query string, dynamically change this property. I would imagine that this property is a string but I can't figure out how to pass it a variable. It only seems that you have to hard code one path. Is this true or is there a way to dynamically alter it? Thanks.
View profile  Send private message
mrachow


Posts: 509
Posted: 10/24/2007, 12:04 AM

I recommend looking in Examples and Techniques manual subsection Other (around page 92).
The examples there should give you an idea what to do.
If the direct way setting the image link as an attribute of the image control shouldn't be possible using an component attribute should always do.
_________________
Best regards,
Michael
View profile  Send private message
DrivenTooFar

Posts: 10
Posted: 10/24/2007, 8:42 AM

Thank you mrachow for your response. If anyone is interested, this is how I accomplished it.

For the button, I added an attribute. The name is "img", the source type is "Expression" and I left the Source Name blank. In the HTML, I replaced the src property with the attribute, which look like src="{button:img}".

The next step was to add a Before Show on the button. I used a querystring in order to decide which image to show. Here is what the code looks like in VB:

If Request.QueryString("mystring") Then
Sender.Attributes("img") = "MyImage.gif"
Else
Sender.Attributes("img") = "OtherImage.gif"
End If

That is it and I hope that this can help anyone in the future. Thanks!
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.

MS Access to Web

Convert MS Access to Web.
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.