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 -> General/Other

 Dependant ListBoxes for ASP

Print topic Send  topic

Author Message
jhoan


Posts: 8
Posted: 06/27/2006, 7:14 AM

Hi everybody, someone know something for build Dependant ListBoxes for ASP.

The Dependant ListBoxes Action V3 only run in PHP, to the run for build ASP say me.

Warning:XSL definition of the Action was not found in the Action's XML file.

Thank's for all.
View profile  Send private message
peterr


Posts: 5971
Posted: 06/28/2006, 11:58 PM

There is no such action in CodeCharge Studio. Possibly someone created it for PHP.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
WKempees
Posted: 06/29/2006, 3:22 AM

SIXTO did
I merely adopted it for 3+
And yes it's PhP only

Walter

"jhoan" <jhoan@forum.codecharge> schreef in bericht
news:244a13d28d7033@news.codecharge.com...
> Hi everybody, someone know something for build Dependant ListBoxes for
> ASP.
>
> The Dependant ListBoxes Action V3 only run in PHP, to the run for build
> ASP say
> me.
>
> Warning:XSL definition of the Action was not found in the Action's XML
> file.
>
> Thank's for all.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Sam
Posted: 06/29/2006, 2:09 PM

I am also looking for the same solution for ASP, so far no luck!

Sixto's solution for PHP is very nice, I wish we could have had a similar solution for ASP too.
Benjamin Krajmalnik
Posted: 06/29/2006, 10:18 PM

To do this, you need 3 javascript functions and some Ajax to populate.
The first function will clear the dependant select box.
The second function will populate a single item into the select box.
The third is a wrapper which calls the clear function and then calls some
ajax code which will dynamically populate the dependant box.

The 3 functions will look something like:

function getActions(sCode){
if (sCode == 0 || sCode == ''){
clearcombo(document.tblTasks.TaskAction);
addopt1(0, 'Select a Task Type to view Actions');
} else {
// a non-empty area
clearcombo(document.tblTasks.TaskAction);
addopt1('', 'Select Value');
AjaxCall("ajaxprovider.asp?action=fetchtaskaction&TaskType=" +
sCode);
}
}
function addopt1(nValue, sText){
// this routine adds a new item to our listbox
document.tblTasks.TaskAction.options[document.tblTasks.TaskAction.length]
= new Option(sText, nValue);
}


function clearcombo(el){
// this routine clears out a listbox or combo box
for (var i = el.options.length; i >= 0; i--){
el.options = null;
}
el.selectedIndex = -1;

}

You trigger this via the onChange event for the parent listbox.

<select name="{TaskType_Name}" class="Select"
onchange="javascript:getActions(document.{HTMLFormName}.{TaskType_Name}.options[document.{HTMLFormName}.{TaskType_Name}.selectedIndex].value)">
<option value="" selected>Select Value</option>
{TaskType_Options}
</select>


I am using the Ajax with IFRAME Fallback which was posted in one of these
forums.
Now, my AjaxProvider is driven by the action parameter to call the correct
function.

The code which does the dependent list population looks like:

Sub FetchTaskAction()

Dim SQL, rqTaskType, rs
rqTaskType = CCGetParam("TaskType","")
SQL = "Select * From tblTaskActions Where TaskType = '" &
Trim(rqTaskType) &"'"
Set rs = MyDBConnection.Execute(SQL)
If rs.EOF Then
MyScript = MyScript & "addopt1('0','No Actions Available');" & vbcrlf
Else
Do Until rs.EOF
MyScript = MyScript & "addopt1('" & rs("TaskAction") &"','" &
Replace(Trim(rs("TaskAction")), "'", "\'") & "');" & vbCrlf
rs.MoveNext
Loop
End If
On Error Resume Next
rs.close
Set rs = Nothing

End Sub


This should be all you need to get going. The results are lightning fast -
totally undiscernible.
I have Ajax code performing Stored procedure calls to calcualte all sorts of
totals, which then get posted to the form, and it is so fast you don;t even
see anything happening.

addopt1 could be further abstracted to get an element as a parameter, and
both it and clearcombo could be moved into the ajax layer.

HTH

"Sam" <Sam@forum.codecharge> wrote in message
news:244a4417460a48@news.codecharge.com...
>I am also looking for the same solution for ASP, so far no luck!
>
> Sixto's solution for PHP is very nice, I wish we could have had a similar
> solution for ASP too.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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