No Error mess, no text

8 views
Skip to first unread message

Mike Diaz

unread,
Mar 14, 2010, 7:20:17 PM3/14/10
to asp-ajaxed
Trying to use Ajaved for the first time with somew difficulties. Don't
have to tell you about documentation, but could not find saolution for
my problem. I'm trying to add a link after producing a dropdown list.
The problem is it appends the link text to the dropdown list. It
shouldn't be doing that.

Sub pagepart_getISInstructor
set rsII = db.getRS("SELECT * FROM Users WHERE Enable='Yes' AND
Users.ID=" & db.SQLSafe(Request.Cookies("ID")) & " Order By Lname",
empty)
If NOT rsII.EOF Then
str.Write("<Select name='frmInstructor'>")
While Not rsII.EOF
str.Write("<Option value='" & Encrypt1(rsII("UserID")) & "%" &
rsII("LName") & ">" & rsII("LName") & "," & rsII("FName") & "</
Option>")
rsII.MoveNext()
Wend
str.Write("</Select>")
Else
str.Write("No Instructors found.")
End If
str.Write("<A HREF='#'
onclick='ajaxed.callback('getOSInstructor','Instructor')'>switch to
outside instructor</A>")
End Sub


I can write anything after 'wend' statement but nothing shows up????

artjc

unread,
Mar 15, 2010, 4:59:03 PM3/15/10
to asp-ajaxed
Hi Mike,

I recommend you see this guide on ajaxed.org
http://www.ajaxed.org/article/Creating-dependent-dropdowns/20/, or you
could also see the option in the dropdown api http://www.ajaxed.org/api/#class_9

well, anything here we are!

artjc :-)

ItHurtsWhenIThink

unread,
Mar 15, 2010, 11:15:28 PM3/15/10
to asp-ajaxed
Thanks,

Is there a list of articles avaialble?

The one you listed was great.

One other question. How could I call my own encryption function on the
"datavaluefield" of the dropdown?

Mike...


On Mar 15, 1:59 pm, artjc <aleph...@gmail.com> wrote:
> Hi Mike,
>

> I recommend you see this guide on ajaxed.orghttp://www.ajaxed.org/article/Creating-dependent-dropdowns/20/, or you
> could also see the option in the dropdown apihttp://www.ajaxed.org/api/#class_9

> > I can write anything after 'wend' statement but nothing shows up????- Hide quoted text -
>
> - Show quoted text -

artjc

unread,
Mar 16, 2010, 6:14:56 PM3/16/10
to asp-ajaxed
Well, I'm writing you an example:

sub drawProductDD()
with new Dropdown
.datasource = "SELECT * FROM Products ORDER BY product"
.dataTextField = "product"
.dataValueField = "id"
.name = "prod"
.commonFieldText = "-- product --"
.commonFieldValue = ""
.onItemCreated = "onEncript" ' this is the key for you question
.draw()
end with
end sub

sub onEncript(it)
it.value = encript(it.value) ' here you encript script
end sub

artjc :-) Juan Carlos

artjc

unread,
Mar 16, 2010, 6:15:17 PM3/16/10
to asp-ajaxed
Well, I'm writing you an example:

sub drawProductDD()
with new Dropdown
.datasource = "SELECT * FROM Products ORDER BY product"
.dataTextField = "product"
.dataValueField = "id"
.name = "prod"
.commonFieldText = "-- product --"
.commonFieldValue = ""
.onItemCreated = "onEncript" ' this is the key for you question
.draw()
end with
end sub

sub onEncript(it)
it.value = encript(it.value) ' here you encript script
end sub

artjc :-) Juan Carlos

On 15 mar, 22:15, ItHurtsWhenIThink <madiaz91...@gmail.com> wrote:

ItHurtsWhenIThink

unread,
Mar 17, 2010, 2:28:49 AM3/17/10
to asp-ajaxed
Thanks Juan, That was easy enough.

Got everything going, except one thing. Cannot seem to be able to pass
a value from my first page part (getShift) to my second page part
(getWho)
Need to send shift to next page part to filter dropdown.

I set the name: .name = "frmShift"
Then called it on the next page: page.RF("frmShift")


sub pagepart_getShift
with new Dropdown
Set .datasource = db.getUnlockedRS("SELECT ShiftName FROM Shifts WHERE
DeptID='{0}'",Request.Cookies("DeptID"))
.dataTextField = "ShiftName"
.dataValueField = "ShiftName"
.commonFieldText = "-- Shift --"
.name = "frmShift"
.attributes = "onchange=""ajaxed.callback('getWho', 'peeps')"""
.onItemCreated = "onEncript"


.draw()
end with
end sub

Sub pagepart_getWho
with new Dropdown
Set .datasource = db.getUnlockedRS("SELECT UserID,LName + SPACE(1)
+ SPACE(1) + FName + SPACE(1) + SPACE(1) + EmployeeID FROM Users WHERE
Enable='Yes' AND DeptID=" & db.SQLSafe(Request.Cookies("DeptID")) & "
AND Shift= '{0}' Order By Lname", page.RF("frmShift"))
.dataTextField = 1 '"LName"
.dataValueField = 0 '"UserID"
.commonFieldText = "-- User --"
.name = "frmStudent"
.draw()
end with
str.write("<br>val=" & page.RF("frmShift"))
End Sub

sub onEncript(it)
it.value = Encrypt1(it.value)
end sub

> > > - Show quoted text -- Hide quoted text -

artjc

unread,
Mar 17, 2010, 4:44:56 AM3/17/10
to asp-ajaxed
Everything seems fine. I do not quite understand you want to do with
this:

.dataTextField = 1 '"LName"
.dataValueField = 0 '"UserID"

Maybe if you leave the table values?
Later I help you, I have a little longer.

Juan Carlos :-)

ItHurtsWhenIThink

unread,
Mar 17, 2010, 2:54:17 PM3/17/10
to asp-ajaxed
Thanks Juan,

The issue is that the value from the selected dropdown list is not
been passed onto the next pagepart. The value from the first dropdown
is used in the SQL statement to filter the second droprdown list. The
first page part that gets fired is the "getShift" pagepart. Then it
takes the value from the dropdown over to the next pagepart sub
"getWho"

artjc

unread,
Mar 17, 2010, 6:51:29 PM3/17/10
to asp-ajaxed
No, no ... I, if understand you want to do, a dependent dropdown, I
meant is to try to show the value 1 and value 0, leaves the data from
the DB you should work.
.dataTextField = 1 '"LName" ==> .dataTextField = "LName"
.dataValueField = 0 '"UserID" ==> .dataValueField = "UserID"

Look, this example I work very well, looks like what you do:

sub drawProductDD()
with new Dropdown

.datasource = "SELECT * FROM Productos ORDER BY producto"
.dataTextField = "producto"
.dataValueField = "idProducto"
.name = "prod"
.commonFieldText = "-- producto --"
.commonFieldValue = ""
.attributes = "onchange=""ajaxed.callback('compositeDD',
'composite')"""
.selectedValue = initialValue("prod")


.draw()
end with
end sub

sub pagePart_compositeDD()
idpart = page.RFP("prod", 0)
with new Dropdown
set .datasource = db.getUnlockedRS( _
"SELECT * FROM PreguntaClasCompuesto WHERE idProducto = '{0}'
ORDER BY compuesto", _
idpart _
)
.dataTextField = "compuesto"
.dataValueField = "idCompuesto"
.name = "comp"
.commonFieldText = "-- compuesto --"
.commonFieldValue = ""
.disabled = idpart = 0
.selectedValue = initialValue("comp")


.draw()
end with
end sub

I think the problem is in the query, Check it well to see:

"SELECT UserID,LName+SPACE(1)+SPACE(1)+FName
+SPACE(1)+SPACE(1)+EmployeeID "& _


"FROM Users WHERE Enable='Yes' AND

DeptID="&db.SQLSafe(Request.Cookies("DeptID"))& _
" AND Shift='{0}' ORDER BY Lname"

artjc :-)

ItHurtsWhenIThink

unread,
Mar 17, 2010, 8:11:45 PM3/17/10
to asp-ajaxed
Juan,

The value not passing was due to my form name, it was not named "frm".
So it passes the data to the next pagePart just fine, EXCEPT for the
value is cancanated with "NONE,"

if the value selected was "B" then the value I get is "NONE,B". Where
is the "NONE," coming from????? Value should be a single character.

Here is the code:

sub pagepart_getShift
with new Dropdown
Set .datasource = db.getUnlockedRS("SELECT ShiftName FROM Shifts WHERE

DeptID='" & Request.Cookies("DeptID") & "'",empty)


.dataTextField = "ShiftName"
.dataValueField = "ShiftName"
.commonFieldText = "-- Shift --"
.name = "frmShift"
.attributes = "onchange=""ajaxed.callback('getWho', 'peeps')"""

.draw()
end with
end sub

Only issue now is that my last dropdown

artjc

unread,
Mar 18, 2010, 6:05:54 PM3/18/10
to asp-ajaxed
I really do not understand why you returns "NONE,"

I wonder!. It is necessary that your sub is a pagepart because I see
no dynamic data, unless the cookie is dynamic, you could not leave him
alone as getShift.

Change as you had it:

myDeptID = db.SQLSafe(Request.Cookies("DeptID"))


Set .datasource = db.getUnlockedRS("SELECT ShiftName FROM Shifts WHERE

DeptID='{0}'",myDeptID)

The other also depends on where you use this code, try using it before
the <html> tag, this is important to use cookies.

You've made some changes to the class dropdown?

The truth, I do not know how to help more.

artjc :-)

Reply all
Reply to author
Forward
0 new messages