CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 help with dynamic listbox containing dates

Print topic Send  topic

Author Message
Jason Lingle
Posted: 05/28/2002, 9:51 AM

I need to create a listbox that has 15 dates in it (for SA's to disable
monitoring on any particular server for up to 15 days), created
automatically from currentdate thru the 15th day. Without using CodeCharge,
this would be really simple in ASP:

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<form>
<select>
<%
Dim currentdate
Dim newdate
Dim i
currentdate = now
newdate = DateAdd("d", 1, currentdate)

for i=1 to 15
If i = 1 Then
Response.Write("<option selected value=" & cdate(newdate) & ">" &
newdate & "</option>")
Else
Response.Write("<option value=" & cdate(newdate) & ">" & newdate &
"</option>")
End If
newdate = DateAdd("d", 1, newdate)
Next
%>
</select>
</form>
</BODY>
</HTML>

However, the way that CodeCharge Studio uses HTML templates, it is
impossible to just add the code into the HTML file. I tried inserting the
code into the before_show event of the server control dropdown, and append a
variable with the <option> tags, then assign the variable to the HTML page
value - but no luck. Any ideas on how to do this in CodeCharge Studio?
Thanks, Jason.

Shawn Mason
Posted: 05/28/2002, 11:34 AM

Why are you hardcoding each server? Now, if you add a new server you must
go and change your db plus all your pages. Why not have each server be a
record (two fields, 1)server id 2)date, and whatever other data is needed)
and then you can add a new server anytime you need to w/o code change.

JAT,

Shawn Mason

"Jason Lingle" <jlingle1@carolina.rr.com> wrote in message
news:ad0cja$4ok$1@news.codecharge.com...
> I need to create a listbox that has 15 dates in it (for SA's to disable
> monitoring on any particular server for up to 15 days), created
> automatically from currentdate thru the 15th day. Without using
CodeCharge,
> this would be really simple in ASP:
>
> <%@ Language=VBScript %>
> <HTML>
> <HEAD>
> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
> </HEAD>
> <BODY>
> <form>
> <select>
> <%
> Dim currentdate
> Dim newdate
> Dim i
> currentdate = now
> newdate = DateAdd("d", 1, currentdate)
>
> for i=1 to 15
> If i = 1 Then
> Response.Write("<option selected value=" & cdate(newdate) & ">" &
> newdate & "</option>")
> Else
> Response.Write("<option value=" & cdate(newdate) & ">" & newdate &
> "</option>")
> End If
> newdate = DateAdd("d", 1, newdate)
> Next
> %>
> </select>
> </form>
> </BODY>
> </HTML>
>
> However, the way that CodeCharge Studio uses HTML templates, it is
> impossible to just add the code into the HTML file. I tried inserting the
> code into the before_show event of the server control dropdown, and append
a
> variable with the <option> tags, then assign the variable to the HTML page
> value - but no luck. Any ideas on how to do this in CodeCharge Studio?
> Thanks, Jason.
>
>

Jason Lingle
Posted: 05/28/2002, 6:33 PM

I am a member of the Systems Management and Automation group for my company.
I am creating a website that will allow SA's to manage monitoring
thresholds, notification info, etc, for 8,000 servers. I am reading the
UNIX box names and their associated SA's and more directly from the UNIX
Oracle DB. I need to set an epoch date flag in the 'REENABLETIME' field for
each server, so that our Tivoli TEC rulebase can compare current epoch date
to the date in the fields at regular polling intervals. When the date in
the db is older than current date, monitoring will be reenabled for that
particular box, and the field value will be erased. SA's have requested the
ability to disable all monitoring for up to 2 weeks, so that is why I am
trying to dynamically populate the dropdown box with 15 days from the time
the page is loaded. Once they select the boxes that they wish to disable, I
take them to a verification page, where they will have to enter an
explanation for each action, and a reenabletime for each box. Back to my
question - does anyone know how to do this using CodeCharge? It is not as
simple as creating a plain ASP page, given the way that CC uses HTML
templates, I can't just put the server code into the HTML. Thanks, Jason.

"Shawn Mason" <shawn@issda.com> wrote in message
news:ad0ijs$ga8$1@news.codecharge.com...
> Why are you hardcoding each server? Now, if you add a new server you must
> go and change your db plus all your pages. Why not have each server be a
> record (two fields, 1)server id 2)date, and whatever other data is needed)
> and then you can add a new server anytime you need to w/o code change.
>
> JAT,
>
> Shawn Mason
>
> "Jason Lingle" <jlingle1@carolina.rr.com> wrote in message
>news:ad0cja$4ok$1@news.codecharge.com...
> > I need to create a listbox that has 15 dates in it (for SA's to disable
> > monitoring on any particular server for up to 15 days), created
> > automatically from currentdate thru the 15th day. Without using
> CodeCharge,
> > this would be really simple in ASP:
> >
> > <%@ Language=VBScript %>
> > <HTML>
> > <HEAD>
> > <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
> > </HEAD>
> > <BODY>
> > <form>
> > <select>
> > <%
> > Dim currentdate
> > Dim newdate
> > Dim i
> > currentdate = now
> > newdate = DateAdd("d", 1, currentdate)
> >
> > for i=1 to 15
> > If i = 1 Then
> > Response.Write("<option selected value=" & cdate(newdate) & ">" &
> > newdate & "</option>")
> > Else
> > Response.Write("<option value=" & cdate(newdate) & ">" & newdate &
> > "</option>")
> > End If
> > newdate = DateAdd("d", 1, newdate)
> > Next
> > %>
> > </select>
> > </form>
> > </BODY>
> > </HTML>
> >
> > However, the way that CodeCharge Studio uses HTML templates, it is
> > impossible to just add the code into the HTML file. I tried inserting
the
> > code into the before_show event of the server control dropdown, and
append
> a
> > variable with the <option> tags, then assign the variable to the HTML
page
> > value - but no luck. Any ideas on how to do this in CodeCharge Studio?
> > Thanks, Jason.
> >
> >
>
>

RonB
Posted: 05/29/2002, 1:52 AM


"Jason Lingle" <jlingle1@carolina.rr.com> schreef in bericht
news:ad1b4e$ttj$1@news.codecharge.com...
> I am a member of the Systems Management and Automation group for my
company.
> I am creating a website that will allow SA's to manage monitoring
> thresholds, notification info, etc, for 8,000 servers. I am reading the
> UNIX box names and their associated SA's and more directly from the UNIX
> Oracle DB. I need to set an epoch date flag in the 'REENABLETIME' field
for
> each server, so that our Tivoli TEC rulebase can compare current epoch
date
> to the date in the fields at regular polling intervals.
>
If you are using an oracle DB it might be possible to write a function wich
you then use in the sql statement to fill the listbox? I'm not an asp
programmer but looking at the code it should be possible tp make an pl sql
rule wich you put in the function.

RonB


Sixto Luis Santos
Posted: 05/29/2002, 4:30 AM

Jason,

You could create such a listbox with some clever hacks. This is what i would
do:

1. Add a field and set its type to listbox
2. In the List tab of the field's property, add this to List of Values
(including the quotes):
" & DateList & "

3. In the form's Before Show event add the following code to create a
delimited dates list:
' ----------------------------------------
DateList=""
For i = 1 to 15
DateList=DateList & ";" & Date + i & ";" & Date + i
Next
DateList=Mid(DateList,2)
' ----------------------------------------
' Notice there is no need to use DateAdd...

4. Generate your form


Regards,

Sixto


"Jason Lingle" <jlingle1@carolina.rr.com> wrote in message
news:ad0cja$4ok$1@news.codecharge.com...
> I need to create a listbox that has 15 dates in it (for SA's to disable
> monitoring on any particular server for up to 15 days), created
> automatically from currentdate thru the 15th day. Without using
CodeCharge,
> this would be really simple in ASP:
>
> <%@ Language=VBScript %>
> <HTML>
> <HEAD>
> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
> </HEAD>
> <BODY>
> <form>
> <select>
> <%
> Dim currentdate
> Dim newdate
> Dim i
> currentdate = now
> newdate = DateAdd("d", 1, currentdate)
>
> for i=1 to 15
> If i = 1 Then
> Response.Write("<option selected value=" & cdate(newdate) & ">" &
> newdate & "</option>")
> Else
> Response.Write("<option value=" & cdate(newdate) & ">" & newdate &
> "</option>")
> End If
> newdate = DateAdd("d", 1, newdate)
> Next
> %>
> </select>
> </form>
> </BODY>
> </HTML>
>
> However, the way that CodeCharge Studio uses HTML templates, it is
> impossible to just add the code into the HTML file. I tried inserting the
> code into the before_show event of the server control dropdown, and append
a
> variable with the <option> tags, then assign the variable to the HTML page
> value - but no luck. Any ideas on how to do this in CodeCharge Studio?
> Thanks, Jason.
>
>

Sixto Luis Santos
Posted: 05/29/2002, 4:36 AM


Ooops!! This' what happens when one reply to messages while
sleep-deprived... This example is for plain old CC2, not CCS... But the
general idea should be the same.

Sorry...!

"Sixto Luis Santos" <sixto@tecnoapoyo.com> wrote in message
news:ad2e5g$tr9$1@news.codecharge.com...
> Jason,
>
> You could create such a listbox with some clever hacks. This is what i
would
> do:
>
> 1. Add a field and set its type to listbox
> 2. In the List tab of the field's property, add this to List of Values
> (including the quotes):
> " & DateList & "
>
> 3. In the form's Before Show event add the following code to create a
> delimited dates list:
> ' ----------------------------------------
> DateList=""
> For i = 1 to 15
> DateList=DateList & ";" & Date + i & ";" & Date + i
> Next
> DateList=Mid(DateList,2)
> ' ----------------------------------------
> ' Notice there is no need to use DateAdd...
>
> 4. Generate your form
>
>
> Regards,
>
> Sixto
>
>
> "Jason Lingle" <jlingle1@carolina.rr.com> wrote in message
>news:ad0cja$4ok$1@news.codecharge.com...
> > I need to create a listbox that has 15 dates in it (for SA's to disable
> > monitoring on any particular server for up to 15 days), created
> > automatically from currentdate thru the 15th day. Without using
> CodeCharge,
> > this would be really simple in ASP:
> >
> > <%@ Language=VBScript %>
> > <HTML>
> > <HEAD>
> > <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
> > </HEAD>
> > <BODY>
> > <form>
> > <select>
> > <%
> > Dim currentdate
> > Dim newdate
> > Dim i
> > currentdate = now
> > newdate = DateAdd("d", 1, currentdate)
> >
> > for i=1 to 15
> > If i = 1 Then
> > Response.Write("<option selected value=" & cdate(newdate) & ">" &
> > newdate & "</option>")
> > Else
> > Response.Write("<option value=" & cdate(newdate) & ">" & newdate &
> > "</option>")
> > End If
> > newdate = DateAdd("d", 1, newdate)
> > Next
> > %>
> > </select>
> > </form>
> > </BODY>
> > </HTML>
> >
> > However, the way that CodeCharge Studio uses HTML templates, it is
> > impossible to just add the code into the HTML file. I tried inserting
the
> > code into the before_show event of the server control dropdown, and
append
> a
> > variable with the <option> tags, then assign the variable to the HTML
page
> > value - but no luck. Any ideas on how to do this in CodeCharge Studio?
> > Thanks, Jason.
> >
> >
>
>


   


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.