Try this example.

Nuno

Joshua M. Andrews wrote:

Opps, accidently hit sedn hehe.  Here ya go..

CustomerType.Class (or Wizard.csp)
---------------------

 /// Individual/Business/Etc..
Class IREI.CustomerType Extends %Persistent [ ClassType = persistent,
ProcedureBlock ]
{

Property AccountType As %String [ Required ];

}

------
END

After the employee answers that question I want it to go on to the next one
of:

BizPlanType.Class (or Plan.csp)
-------------------

 /// Business Internet Access Plans
Class IREI.BizAccessPlans Extends %Persistent [ ClassType = persistent,
ProcedureBlock ]
{

/// What plan they chose.
Property BizPlan As %String [ Required ];

}

"Joshua M. Andrews" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

Here ya go...

CustomerType.Class
---------------------


"Nuno Canas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

Can you post a sample of two classes that you are using ?

Nuno

Joshua M. Andrews wrote:


Nuno:

Can you provide me an example.  I'm not understanding what you mean.

Thanks.

Joshua

"Nuno Canas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]


Joshua,
With CSP and DOM you don't even need to go to step 2.
You can execute a Method using 'OnChange' in the select TAG.
Even you can use an <IFRAME> thet is feeded with an URL and parameters
depending in what you have selected in the first select field.

(Cache is Hi-Tech) !!
Nuno
Joshua M. Andrews wrote:



Sorry ya'll but I'm new to programming and I'm just learning how to

use

Cache/CSP. I really like it and would like to learn more about it

but

I'm


not a very good programming. What would be an example code of how I

can

submit a form and then go on to the next page in the wizard I'm

making?

Example...

Please enter the account type: (This will display a drop-down

listbox

with


their options).


From there I would like them to hit NEXT and when done it will go to

step2.csp in the wizard and save the current information. This is a

wizard


for adding a new customer to the database.  Thanks ya'll!

Joshua








--------------080203050300060703060208 Content-Type: text/xml; name="Josh.xml" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Josh.xml"

<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="9" zv="Cache for Windows NT (Intel/P4) 5.0.4 (Build 829)" 
ts="2004-04-14 16:18:50">
<Class name="Josh.BizPlanType">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>59639,57154.426415</TimeChanged>
<ClassDefinitionError>0</ClassDefinitionError>

<Property name="Customer">
<Type>Josh.Customer</Type>
<Cardinality>many</Cardinality>
<Inverse>BizType</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="BizPlan">
<Type>%String</Type>
<Required>1</Required>
</Property>

<Property name="BizTypes">
<Type>Josh.CustomerType</Type>
<Cardinality>one</Cardinality>
<Inverse>BizType</Inverse>
<Relationship>1</Relationship>
</Property>

<Query name="ByBiz">
<Type>%SQLQuery</Type>
<FormalSpec>biz:%String=""</FormalSpec>
<SqlQuery>        SELECT %ID, BizPlan FROM Josh.BizPlanType
        WHERE BizPlan %STARTSWITH :biz
        ORDER BY %ID</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Josh.BizPlanTypeD</DataLocation>
<DefaultData>BizPlanTypeDefaultData</DefaultData>
<IdLocation>^Josh.BizPlanTypeD</IdLocation>
<IndexLocation>^Josh.BizPlanTypeI</IndexLocation>
<StreamLocation>^Josh.BizPlanTypeS</StreamLocation>
<Data name="BizPlanTypeDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>BizPlan</Value>
</Value>
<Value name="3">
<Value>Customer</Value>
</Value>
<Value name="4">
<Value>BizTypes</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="Josh.Customer">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>59639,46789.030762</TimeChanged>
<ClassDefinitionError>0</ClassDefinitionError>

<Property name="AccountType">
<Type>Josh.CustomerType</Type>
<Cardinality>one</Cardinality>
<Inverse>Customer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="BizType">
<Type>Josh.BizPlanType</Type>
<Cardinality>one</Cardinality>
<Inverse>Customer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Name">
<Type>%String</Type>
<Required>1</Required>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Josh.CustomerD</DataLocation>
<DefaultData>CustomerDefaultData</DefaultData>
<IdLocation>^Josh.CustomerD</IdLocation>
<IndexLocation>^Josh.CustomerI</IndexLocation>
<StreamLocation>^Josh.CustomerS</StreamLocation>
<Data name="CustomerDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Name</Value>
</Value>
<Value name="3">
<Value>AccountType</Value>
</Value>
<Value name="4">
<Value>BizType</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="Josh.CustomerType">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>59639,57144.471151</TimeChanged>
<ClassDefinitionError>0</ClassDefinitionError>

<Property name="AccountType">
<Type>%String</Type>
<Required>1</Required>
</Property>

<Property name="Customer">
<Type>Josh.Customer</Type>
<Cardinality>many</Cardinality>
<Inverse>AccountType</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="BizType">
<Type>Josh.BizPlanType</Type>
<Cardinality>many</Cardinality>
<Inverse>BizTypes</Inverse>
<Relationship>1</Relationship>
</Property>

<Query name="ByType">
<Type>%SQLQuery</Type>
<FormalSpec>biz:%String=""</FormalSpec>
<SqlQuery>        SELECT %ID, AccountType FROM Josh.CustomerType
        WHERE AccountType %STARTSWITH :biz
        ORDER BY %ID</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^Josh.CustomerTypeD</DataLocation>
<DefaultData>CustomerTypeDefaultData</DefaultData>
<IdLocation>^Josh.CustomerTypeD</IdLocation>
<IndexLocation>^Josh.CustomerTypeI</IndexLocation>
<StreamLocation>^Josh.CustomerTypeS</StreamLocation>
<Data name="CustomerTypeDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>AccountType</Value>
</Value>
<Value name="3">
<Value>Customer</Value>
</Value>
</Data>
</Storage>
</Class>
<Project name="Josh" LastModified="2004-04-14 16:18:50">
 <Items>
   <ProjectItem name="Josh.BizPlanType" type="CLS"/>
   <ProjectItem name="Josh.Customer" type="CLS"/>
   <ProjectItem name="Josh.CustomerType" type="CLS"/>
   <ProjectItem name="csp/teste/Cust1.csp" type="CSP"/>
 </Items>
</Project>
<CSP name="Cust1.csp" application="/csp/teste/" default="1">
<![CDATA[<HTML>
<HEAD>

<!-- Put your page Title here -->
<TITLE>   Cache Server Page </TITLE>

</HEAD>

<BODY>
<H1 ALIGN="CENTER">Josh.Customer</H1>
<SCRIPT Language=JavaScript>
<!--
function update(id)
{
    #server(..formLoad(id))#;
    #server(..FilterBiz(document.form.AccountType.value))#;
  return true;
}
// -->
</SCRIPT>

<!-- use CSP:OBJECT tag to create a reference to an instance of the class -->
<CSP:OBJECT NAME="objForm" CLASSNAME="Josh.Customer" OBJID=#(%request.Get("OBJID"))#>

<!-- use CSP:SEARCH tag to create a javascript function to invoke a search page --> <CSP:SEARCH NAME="form_search" CLASSNAME="Josh.Customer" WHERE="%Id()" OPTIONS="popup,clearbtn,predicates" ONSELECT="update">

<FORM NAME="form" CSPBIND="objForm" CSPJS="All" ONSUBMIT='return form_validate();'>
<CENTER>
<TABLE CELLPADDING="3">
 <TR>
   <TD><FONT COLOR="#666666"><B><DIV ALIGN="RIGHT">ID:</DIV></B></FONT></TD>
   <TD><INPUT TYPE="TEXT" NAME="sys_Id" CSPBIND="%Id()" SIZE="10" READONLY></TD>
 </TR>
 <TR>
   <TD><B><DIV ALIGN="RIGHT">*Name:</DIV></B></TD>
   <TD><INPUT TYPE="TEXT" NAME="Name" CSPBIND="Name" SIZE="50" CSPREQUIRED></TD>
 </TR>
 <TR>
   <TD><FONT COLOR="#666666"><B><DIV ALIGN="RIGHT">AccountType:</DIV></B></FONT></TD>
   <TD><SELECT NAME="AccountType" CSPBIND="AccountType" CLASSNAME="Josh.CustomerType" QUERY="ByType" 
FIELD="AccountType" OnChange="#server(..FilterBiz(document.form.AccountType.value))#"></SELECT></TD>
 </TR>
 <TR>
   <TD><FONT COLOR="#666666"><B><DIV ALIGN="RIGHT">BizType ID:</DIV></B></FONT></TD>
   <TD><SELECT NAME="BizType" CSPBIND="BizType" CLASSNAME="Josh.BizPlanType" QUERY="ByBiz" 
FIELD="BizPlan"></SELECT></TD>
 </TR>
 <TR>
   <TD>&nbsp;</TD>
   <TD><INPUT TYPE="BUTTON" NAME="btnClear" VALUE="Clear" ONCLICK='form_new();'>
     <INPUT TYPE="BUTTON" NAME="btnSave" VALUE="Save" ONCLICK='form_save();'>
     <INPUT TYPE="BUTTON" NAME="btnSearch" VALUE="Search" 
ONCLICK='form_search();'></TD>
 </TR>
 <TR>
   <TD>&nbsp;</TD>
   <TD><FONT COLOR="#000088" SIZE="2">(* Denotes required fields)</FONT></TD>
 </TR>
</TABLE>
</CENTER>
</FORM>
<script language="Cache" method="FilterBiz" arguments="CustType:%Integer" 
returntype="%Boolean">
        w "document.form.BizType.length=0;"
   Set result=##class(%ResultSet).%New()
   Do result.Prepare("SELECT ID, BizPlan FROM Josh.BizPlanType WHERE BizTypes = ?")
   Do result.Execute(CustType)
   Set i=0
   while(result.Next()) {
        Write "document.form.BizType.options[",i,"] =",
       "new Option('",$Get(result.Data("BizPlan")),"','",
       $Get(result.Data("ID")),"');",!
                set i = i+1
   }
        Do result.Close()
   Quit ""
</script>
<script language="Cache" method="OnPostHTTP" arguments="" returntype="%Boolean">
w $$$cspJavaScriptStart,!
w "document.form.BizType.length=0;"
w "update(document.form.AccountType.value);",!
w $$$cspJavaScriptEnd,!
</script>
</BODY>
</HTML>
]]></CSP>
<Checksum value="568778780"/>
</Export>

--------------080203050300060703060208--




Reply via email to