CodeCharge Studio
search Register Login  

Visual PHP Web Development

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Function Before Show. Problems ?

Print topic Send  topic

Author Message
Rudi
Posted: 05/06/2003, 1:38 AM

Hi,

asp !!
I would like to display a textbox only if there are certain parmeters set.

I have started with the html and entered the Begin and End.

<!-- BEGIN TextBox TextArea4 -->
<tr>
<td class="GiantStepsFieldCaptionTD" valign="top"></td>
<td class="GiantStepsDataTD"><textarea class="GiantStepsTextarea"
style="WIDTH: 450px; HEIGHT: 60px" name="{TextArea4_Name}" rows="1"
cols="64">{TextArea4}</textarea></td>
</tr>
<!-- END TextBox TextArea4 -->

Then I have in the "Before Show" for the form entered the following code:

directory_categories.TextArea4.Visible = True



I am not able to make this textbox visible again.

Here's the complete events code:
<%
'BindEvents Method @1-21E66028
Sub BindEvents()
Set directory_categories.CCSEvents("BeforeShow") =
GetRef("directory_categories_BeforeShow")
End Sub
'End BindEvents Method

Function directory_categories_BeforeShow() 'directory_categories_BeforeShow
@2-8F689663

'Custom Code @19-73254650
' -------------------------
directory_categories.TextArea4.Visible = True
' -------------------------
'End Custom Code

End Function 'Close directory_categories_BeforeShow @2-54C34B28


%>


I have used the example in CCS help-file named "Hiding a Record Form
Control"

Any suggestion on where I go wrong ?

Regards
Rudi




Robert Rodgers
Posted: 05/06/2003, 4:55 AM

Rudi,

>>> I am not able to make this textbox visible again.
I think all controls start visible. How/where are you making it hidden?

Are you sure the data is returned from the db? Is it in the result set?
In your event code where you set it visible I would try to print the
contents with this line...

print "<BR>TextArea4: " & directory_categories.TextArea4.Value

This should print the raw data on the form. If it isn't there then nothing
is returned from the db.

This is a place to start. Reply back with your results.

rob

--
"Every absurdity has a champion to defend it"
Oliver Goldsmith
++++++++++++++++++++++++++++++

"Rudi" <tomymail@online.no> wrote in message
news:b97s9q$63p$1@news.codecharge.com...
> Hi,
>
> asp !!
> I would like to display a textbox only if there are certain parmeters set.
>
> I have started with the html and entered the Begin and End.
>
> <!-- BEGIN TextBox TextArea4 -->
> <tr>
> <td class="GiantStepsFieldCaptionTD" valign="top"></td>
> <td class="GiantStepsDataTD"><textarea class="GiantStepsTextarea"
> style="WIDTH: 450px; HEIGHT: 60px" name="{TextArea4_Name}" rows="1"
> cols="64">{TextArea4}</textarea></td>
> </tr>
> <!-- END TextBox TextArea4 -->
>
> Then I have in the "Before Show" for the form entered the following code:
>
> directory_categories.TextArea4.Visible = True
>
>
>
> I am not able to make this textbox visible again.
>
> Here's the complete events code:
> <%
> 'BindEvents Method @1-21E66028
> Sub BindEvents()
> Set directory_categories.CCSEvents("BeforeShow") =
> GetRef("directory_categories_BeforeShow")
> End Sub
> 'End BindEvents Method
>
> Function directory_categories_BeforeShow()
'directory_categories_BeforeShow
> @2-8F689663
>
> 'Custom Code @19-73254650
> ' -------------------------
> directory_categories.TextArea4.Visible = True
> ' -------------------------
> 'End Custom Code
>
> End Function 'Close directory_categories_BeforeShow @2-54C34B28
>
>
> %>
>
>
> I have used the example in CCS help-file named "Hiding a Record Form
> Control"
>
> Any suggestion on where I go wrong ?
>
> Regards
> Rudi
>
>
>
>
>

DonB
Posted: 05/06/2003, 7:10 AM

You cannot use "visible = false" on an HTML "input" element. I think this
is because of the use of templates - the html is created and placed in the
template object and to "hide it" what you really need to do (in terms of the
way CCS works) is to remove that element from the template. So
"visible=false" won't do that. The "visible" property only affects CCS
objects (e.g., grids and records).

As an alternative, you can place a label control on your form and set it to
have "html" content. Then, in the Before Show event (of the label) you can
put code to:

(1) change it to a textbox (by setting its .text to the appropriate html,
e.g.: <INPUT type='TEXT' value='myvalue'>) if you want to display it

or

(2) leave it as a label and set .value=''' to effectively hide it.

The label will need its datasource set to "Code Expression" so that CCS does
not generate code to "bind" the label to a field in you datasource.

DonB


"Rudi" <tomymail@online.no> wrote in message
news:b97s9q$63p$1@news.codecharge.com...
> Hi,
>
> asp !!
> I would like to display a textbox only if there are certain parmeters set.
>
> I have started with the html and entered the Begin and End.
>
> <!-- BEGIN TextBox TextArea4 -->
> <tr>
> <td class="GiantStepsFieldCaptionTD" valign="top"></td>
> <td class="GiantStepsDataTD"><textarea class="GiantStepsTextarea"
> style="WIDTH: 450px; HEIGHT: 60px" name="{TextArea4_Name}" rows="1"
> cols="64">{TextArea4}</textarea></td>
> </tr>
> <!-- END TextBox TextArea4 -->
>
> Then I have in the "Before Show" for the form entered the following code:
>
> directory_categories.TextArea4.Visible = True
>
>
>
> I am not able to make this textbox visible again.
>
> Here's the complete events code:
> <%
> 'BindEvents Method @1-21E66028
> Sub BindEvents()
> Set directory_categories.CCSEvents("BeforeShow") =
> GetRef("directory_categories_BeforeShow")
> End Sub
> 'End BindEvents Method
>
> Function directory_categories_BeforeShow()
'directory_categories_BeforeShow
> @2-8F689663
>
> 'Custom Code @19-73254650
> ' -------------------------
> directory_categories.TextArea4.Visible = True
> ' -------------------------
> 'End Custom Code
>
> End Function 'Close directory_categories_BeforeShow @2-54C34B28
>
>
> %>
>
>
> I have used the example in CCS help-file named "Hiding a Record Form
> Control"
>
> Any suggestion on where I go wrong ?
>
> Regards
> Rudi
>
>
>
>
>

Rudi
Posted: 05/06/2003, 7:47 AM

Hi Rob,

It's a empty textbox for input I would like to hide (Sometimes). So it's not
supposed to present any data. The user is supposed to fill inn data.. I am
checking if there is anything in the label that belongs to the textbox, if
it's not, then I would like to hide the textbox.

How have I tried to do this ?
I have followed the example that I found in the CCS helpfile called "Hiding
a Record Form Control". Have a look at it!
Step by step, how I have done this:
I have the page open in CCS.
I have in CCS pressed the HTML Tab for the page with the textbox.
Then I have putted <!-- BEGIN TextBox TextArea4 --> in the start of the HTML
code for the textbox, and <!-- END TextBox TextArea4 --> at the end of the
HTML code for the textbox.

Then I have in the form properties selected "events", "before show", "custom
code" and entered : directory_categories.TextArea4.Visible = True

The complete event code that is generated by CCS is listed further down.

Regards,
Rudi





"Robert Rodgers" <rrodgers@sylvancomputing.com> wrote in message
news:b987rp$vlr$1@news.codecharge.com...
> Rudi,
>
> >>> I am not able to make this textbox visible again.
> I think all controls start visible. How/where are you making it hidden?
>
> Are you sure the data is returned from the db? Is it in the result set?
> In your event code where you set it visible I would try to print the
> contents with this line...
>
> print "<BR>TextArea4: " & directory_categories.TextArea4.Value
>
> This should print the raw data on the form. If it isn't there then
nothing
> is returned from the db.
>
> This is a place to start. Reply back with your results.
>
> rob
>
> --
> "Every absurdity has a champion to defend it"
> Oliver Goldsmith
> ++++++++++++++++++++++++++++++
>
> "Rudi" <tomymail@online.no> wrote in message
>news:b97s9q$63p$1@news.codecharge.com...
> > Hi,
> >
> > asp !!
> > I would like to display a textbox only if there are certain parmeters
set.
> >
> > I have started with the html and entered the Begin and End.
> >
> > <!-- BEGIN TextBox TextArea4 -->
> > <tr>
> > <td class="GiantStepsFieldCaptionTD" valign="top"></td>
> > <td class="GiantStepsDataTD"><textarea class="GiantStepsTextarea"
> > style="WIDTH: 450px; HEIGHT: 60px" name="{TextArea4_Name}" rows="1"
> > cols="64">{TextArea4}</textarea></td>
> > </tr>
> > <!-- END TextBox TextArea4 -->
> >
> > Then I have in the "Before Show" for the form entered the following
code:
> >
> > directory_categories.TextArea4.Visible = True
> >
> >
> >
> > I am not able to make this textbox visible again.
> >
> > Here's the complete events code:
> > <%
> > 'BindEvents Method @1-21E66028
> > Sub BindEvents()
> > Set directory_categories.CCSEvents("BeforeShow") =
> > GetRef("directory_categories_BeforeShow")
> > End Sub
> > 'End BindEvents Method
> >
> > Function directory_categories_BeforeShow()
> 'directory_categories_BeforeShow
> > @2-8F689663
> >
> > 'Custom Code @19-73254650
> > ' -------------------------
> > directory_categories.TextArea4.Visible = True
> > ' -------------------------
> > 'End Custom Code
> >
> > End Function 'Close directory_categories_BeforeShow @2-54C34B28
> >
> >
> > %>
> >
> >
> > I have used the example in CCS help-file named "Hiding a Record Form
> > Control"
> >
> > Any suggestion on where I go wrong ?
> >
> > Regards
> > Rudi
> >
> >
> >
> >
> >
>
>

Rudi
Posted: 05/08/2003, 4:33 AM

I have solved it.

The sample in the CCS help file told me to add like this:
Switch to HTML mode and locate the code for the Author Textbox control. Just
before the code for the Author Textbox control, add the code <!-- BEGIN
TextBox Author --> then after the code for the Author Textbox control, add
the code <!-- END TextBox Author -->:
<tr>
<td>Author</td>
<td>
<!-- BEGIN TextBox Author -->
<input name="Author" value="{Author}">
<!-- END TextBox Author -->
</td>
</tr>

I skipped this because the control already has a BEGIN and END.

So I just added "custom code" to the form's "Before Show" :

'Custom Code @54-73254650
' -------------------------
directory_requests.fax.Visible = False
' -------------------------
'End Custom Code


Now I can control it by setting it to False or True.

Regards,
Rudi



"DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
news:b98fol$hte$1@news.codecharge.com...
> You cannot use "visible = false" on an HTML "input" element. I think
this
> is because of the use of templates - the html is created and placed in the
> template object and to "hide it" what you really need to do (in terms of
the
> way CCS works) is to remove that element from the template. So
> "visible=false" won't do that. The "visible" property only affects CCS
> objects (e.g., grids and records).
>
> As an alternative, you can place a label control on your form and set it
to
> have "html" content. Then, in the Before Show event (of the label) you
can
> put code to:
>
> (1) change it to a textbox (by setting its .text to the appropriate html,
> e.g.: <INPUT type='TEXT' value='myvalue'>) if you want to display it
>
> or
>
> (2) leave it as a label and set .value=''' to effectively hide it.
>
> The label will need its datasource set to "Code Expression" so that CCS
does
> not generate code to "bind" the label to a field in you datasource.
>
> DonB
>
>
> "Rudi" <tomymail@online.no> wrote in message
>news:b97s9q$63p$1@news.codecharge.com...
> > Hi,
> >
> > asp !!
> > I would like to display a textbox only if there are certain parmeters
set.
> >
> > I have started with the html and entered the Begin and End.
> >
> > <!-- BEGIN TextBox TextArea4 -->
> > <tr>
> > <td class="GiantStepsFieldCaptionTD" valign="top"></td>
> > <td class="GiantStepsDataTD"><textarea class="GiantStepsTextarea"
> > style="WIDTH: 450px; HEIGHT: 60px" name="{TextArea4_Name}" rows="1"
> > cols="64">{TextArea4}</textarea></td>
> > </tr>
> > <!-- END TextBox TextArea4 -->
> >
> > Then I have in the "Before Show" for the form entered the following
code:
> >
> > directory_categories.TextArea4.Visible = True
> >
> >
> >
> > I am not able to make this textbox visible again.
> >
> > Here's the complete events code:
> > <%
> > 'BindEvents Method @1-21E66028
> > Sub BindEvents()
> > Set directory_categories.CCSEvents("BeforeShow") =
> > GetRef("directory_categories_BeforeShow")
> > End Sub
> > 'End BindEvents Method
> >
> > Function directory_categories_BeforeShow()
> 'directory_categories_BeforeShow
> > @2-8F689663
> >
> > 'Custom Code @19-73254650
> > ' -------------------------
> > directory_categories.TextArea4.Visible = True
> > ' -------------------------
> > 'End Custom Code
> >
> > End Function 'Close directory_categories_BeforeShow @2-54C34B28
> >
> >
> > %>
> >
> >
> > I have used the example in CCS help-file named "Hiding a Record Form
> > Control"
> >
> > Any suggestion on where I go wrong ?
> >
> > Regards
> > Rudi
> >
> >
> >
> >
> >
>
>

Rudi
Posted: 05/08/2003, 4:33 AM

I have solved it.

The sample in the CCS help file told me to add like this:
Switch to HTML mode and locate the code for the Author Textbox control. Just
before the code for the Author Textbox control, add the code <!-- BEGIN
TextBox Author --> then after the code for the Author Textbox control, add
the code <!-- END TextBox Author -->:
<tr>
<td>Author</td>
<td>
<!-- BEGIN TextBox Author -->
<input name="Author" value="{Author}">
<!-- END TextBox Author -->
</td>
</tr>

I skipped this because the control already has a BEGIN and END.

So I just added "custom code" to the form's "Before Show" :

'Custom Code @54-73254650
' -------------------------
directory_requests.fax.Visible = False
' -------------------------
'End Custom Code


Now I can control it by setting it to False or True.

Regards,
Rudi

"Robert Rodgers" <rrodgers@sylvancomputing.com> wrote in message
news:b987rp$vlr$1@news.codecharge.com...
> Rudi,
>
> >>> I am not able to make this textbox visible again.
> I think all controls start visible. How/where are you making it hidden?
>
> Are you sure the data is returned from the db? Is it in the result set?
> In your event code where you set it visible I would try to print the
> contents with this line...
>
> print "<BR>TextArea4: " & directory_categories.TextArea4.Value
>
> This should print the raw data on the form. If it isn't there then
nothing
> is returned from the db.
>
> This is a place to start. Reply back with your results.
>
> rob
>
> --
> "Every absurdity has a champion to defend it"
> Oliver Goldsmith
> ++++++++++++++++++++++++++++++
>
> "Rudi" <tomymail@online.no> wrote in message
>news:b97s9q$63p$1@news.codecharge.com...
> > Hi,
> >
> > asp !!
> > I would like to display a textbox only if there are certain parmeters
set.
> >
> > I have started with the html and entered the Begin and End.
> >
> > <!-- BEGIN TextBox TextArea4 -->
> > <tr>
> > <td class="GiantStepsFieldCaptionTD" valign="top"></td>
> > <td class="GiantStepsDataTD"><textarea class="GiantStepsTextarea"
> > style="WIDTH: 450px; HEIGHT: 60px" name="{TextArea4_Name}" rows="1"
> > cols="64">{TextArea4}</textarea></td>
> > </tr>
> > <!-- END TextBox TextArea4 -->
> >
> > Then I have in the "Before Show" for the form entered the following
code:
> >
> > directory_categories.TextArea4.Visible = True
> >
> >
> >
> > I am not able to make this textbox visible again.
> >
> > Here's the complete events code:
> > <%
> > 'BindEvents Method @1-21E66028
> > Sub BindEvents()
> > Set directory_categories.CCSEvents("BeforeShow") =
> > GetRef("directory_categories_BeforeShow")
> > End Sub
> > 'End BindEvents Method
> >
> > Function directory_categories_BeforeShow()
> 'directory_categories_BeforeShow
> > @2-8F689663
> >
> > 'Custom Code @19-73254650
> > ' -------------------------
> > directory_categories.TextArea4.Visible = True
> > ' -------------------------
> > 'End Custom Code
> >
> > End Function 'Close directory_categories_BeforeShow @2-54C34B28
> >
> >
> > %>
> >
> >
> > I have used the example in CCS help-file named "Hiding a Record Form
> > Control"
> >
> > Any suggestion on where I go wrong ?
> >
> > Regards
> > Rudi
> >
> >
> >
> >
> >
>
>


   


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

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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