Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Accessing a Perl File from datacapture.cfg file
System
Hi there,
I have a select box item in my datacapture.cfg file which calls an inline command and populates a single value which is selected by default. At this case I can see and save the values. it is reflected in the DCR xml. But when I make this item as hidden the value is not set in the DCR. and hence I am not getting that value in the DCR xml.
Is there any way to make this working.
Regards
Dhanush
Find more posts tagged with
Comments
jbonifaci
You should be able to specify a default value for a hidden field. Please post your DCT and someone should be able to point you in the right direction.
~Jeff
Migrateduser
Hi,
This is the part of DCT that is used for calling the perl file.
<item name="ITEM_CODE_TYPE">
<hidden/>
<label/>
<select required="f" multiple="f" size="1">
<inline command="/appl/iwov/iw-home/custom/swot/swotcommon_inline_wrapper.ipl textbox_populator.ipl 0 0 SELECT prod_iden_type_id FROM PROD_IDEN_TYPE WHERE dscr LIKE 'USOC' AND first_effect_dt <= SYSDATE AND (SYSDATE <=last_effect_dt OR last_effect_dt IS NULL) AND enabled = 'Y'"/>
</select>
</item>
The perl file will substitute the value <option value='7' label='7' selected='t'/> after getting the value 7 from the DB - executing above query.
The perl file is running successfully and printing the option tag
Thanks
Dhanush
jbonifaci
If you have multiple item types in your item definition, the templating engine will take the first item type that is applicable to the user. In this case, it is hidden. So your select is completely ignored. If you want a default value for your hidden, you must use the <default> tag:
<hidden>
<default>MyDefaultValue</default>
</hidden>
If you want the value of this to come from your inline, you'll need to return the xml for both the hidden and select from your inline. If your field is always going to be hidden, just remove the select and have your inline return the hidden default value.
~Jeff
Migrateduser
Hi,
I tried putting in this bit
<item name="ITEM_CODE_TYPE">
<hidden>
<default> My Default Value</default>
</hidden>
</item>
But even this "My Default Value " didnt appear in the DCR XML when I saved the DCT. I am using Teamsite 6.1
Thanks
Dhanush
iw_bubbles
If you are returning just the one value, why are you using a select box? Can you not acheive the same result with a text field?
Migrateduser
It is not abt select box or text box - the thing is whenever I introduce a hidden - it doesnt work
Adam Stoller
If you want a default value for a hidden field - it's usually better to make the field a non-hiddent text field with a default value in the DCT and then use FormAPI to hide the field on form initialization (there are several cases of DCT directives that are better dealt with via FormAPI than being hard-coded in the DCT; this is one of them)
...
<item name="ITEM_CODE_TYPE">
<text>
<default>My Default Value</default>
</text>
</item>
...
<script language="javascript">
function init(){
IWDatacapture.getItem('/ITEM_CODE_TYPE').setVisible(false);
}
IWEventRegistry.addFormHandler("OnFormInit", init);
</script>
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
firstpageonly.rptdesign