how to use javascript functions in input form
I want to implement my java script function through form rather than workflow. When user put values in form at that moment i want to data to get reflected to user.
Thanks,
Diksha
I want to implement my java script function through form rather than workflow. When user put values in form at that moment i want to data to get reflected to user.
Thanks,
Diksha
Hello dikshac45201755,
You need to implement input button in your form which will call method in your schema
Some information can be found here:
1. In your form add input
<input enabledIf="" img="" label="Label" type="button">
<enter>
<soapCall name="soapCallName" service="namespace:schema"> // xtk:workflow
<param exprIn="[@attribute1]" type="boolean"/>
<param exprIn="[element/@attribute2]" type="int"/>
<param exprIn="[attribute3]" type="string"/>
..
..
</soapCall>
<reload/>
</enter>
</input>
2. In your schema add method
<method library="namespace:yourJavaScript.js" name="soapCallName" static="true">
<parameters>
<param inout="in" name="attribute1" type="boolean"/>
<param inout="in" name="attribute2" type="long"/> // it does not know int type :)
<param inout="in" name="attribute3" type="string"/>
..
..
</parameters>
</method>
3. Last but not least add your JS function to JavaScript codes folder:
Can be something as below:
function namespace_schema_soapCallName(attribute1, attribute2, attribute3,..,..){
xtk.session.Write(<schema xtkschema="namespace:schema"
_operation="update" attribute1={attribute1} attribute2={attribute2} attribute3={attribute3} ...
_key="@attribute2"
/>);
}
llName
Marcel
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.