Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Setting form element properties
Antharix
Hello,
I am facing the following problem ,while setting a form element's (drop down) visibility property.
I have a replicant , which includes a text box and a drop down element. I test the content of the text box with that of the drop down element's data. It the data matched i.e. if the data in the text box exists in the drop down element's data , then I am trying to set the drop down element to be visible and its selected index to the matching data element (in the combo). and hide the text box.
The problem is, though the data matches and the elements property set as desired , the drop down element in the dcr is not visible (the text box element is hidden as desired). I need the drop down element to be visible.
This functionality is being acheived using the formAPI script and in the init() function.
Kindly advice
Thanks in advance.
Find more posts tagged with
Comments
Adam Stoller
It might help if you include the TS version information (including SP/patch level), platform information, and the DCT and FormAPI code for us to look at and see if we can figure out what's happening.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Antharix
Hi ,
I am working on TS 552 on solaris.
This is the DCT items definition:
<item name="BINNumbers" >
<label>BIN Numbers</label>
<replicant required="t" min="1" max="200">
<item name="AssociateBIN">
<label>Select BIN</label>
<description>Please Associate Existing BIN to this Card</description>
<select required="f">
<inline command="get_list_for_combo.ipl"/>
</select>
</item>
<item name="BINNumber" visible="false">
<label>BIN Number</label>
<description>Please Enter BIN Number</description>
<text required="f" maxlength="8" size="25" validation-regex="^[0-9]+$"/>
</item>
</replicant>
</item>
this is the formAPI script:
var associatedbin = IWDatacapture.getItem("/BINNumbers"+"["+ i +"]"+"/AssociateBIN");
var associatedbinopt =associatedbin.getOptions();
var binnoval = binno.getValue();
if(binnoval)
{
var itemcount=0;
for (var op =1; op <associatedbinopt.length; op++)
{
if(binnoval == associatedbinopt[op].value)
{
associatedbin.setVisible(true);
associatedbin.setValue(op);
binno.setVisible(false);
binid.setVisible(false);
bintype.setValue(0);
IWDatacapture.redraw();
}
The above script is executed in the init() function.
Some functionality description:
I create a dcr with data entered into the "BINNumber" element. save and submit. This data is stored into the "x" data source.
The data in the "AssociateBIN" is fetched from "x" data source.
On opening the saved/submitted dcr, the value previously entered is available in the "AssociateBIN" and therefore I intend to Hide the "BINNumber" element and display ""AssociateBIN" element . I am trying to acheive this thru the above funtion during the init() process.
Please advice solution.
thanks
Adam Stoller
This is just a thought, based on some other posts I've read recently - specifically
this one
which contains the following:
If you have a call like:init();try replacing it with:IWEventRegistry.addFormHandler("onFormInit", init);
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Antharix
Thanks for all the help. I found solution by inserting a "break;" after setting combo.setVislble(true);
Thanks Again.
Ananda