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)
Can a replicant have an ItemHandler
Identifier
I am using TS6.1, and have a few fields in a container which is a replicant. Of these fields, I would like to hide 2 of them. I am able to do it successfully for the first time with the following code, but anytime I add a replicant by clicking on the '+', I would like to hide them as well. Is there a handler to catch an addition of replicant? (I want the code in "if then else" to be executed each time a replicant is added).
Thanks,
Identifier
function init()
{
IWEventRegistry.addItemHandler("/ItemMaster/Item_Master_MLS/language", "onCallout", setOptionValues);
IWEventRegistry.addItemHandler("/ItemMaster/Item_Master_Administrative/reference_name", "onItemChange", onReferenceName);
IWEventRegistry.addItemHandler("/ItemMaster/Item_Master_MLS[0]", "onItemChange", addReplicant);
loadFromDb();
// Only admin and master roles need to set the sequence name field
var shortDescFile;
var longDescFile;
if (iwrole == 'admin' || iwrole == 'master')
{
IWDatacapture.getItem("/ItemMaster/Item_Master_Administrative/item_id").setReadOnly(false);
IWDatacapture.getItem("/ItemMaster/db_lang_id").setVisible(true);
i = 1;
while ( shortDescFile = IWDatacapture.getItem("/ItemMaster/Item_Master_MLS[" + i + "]/short_description_file") )
{
shortDescFile.setVisible(true);
longDescFile = IWDatacapture.getItem("/ItemMaster/Item_Master_MLS[" + i + "]/long_description_file");
longDescFile.setVisible(true);
i++;
}
}
else
{
IWDatacapture.getItem("/ItemMaster/Item_Master_Administrative/item_id").setReadOnly(true);
IWDatacapture.getItem("/ItemMaster/db_lang_id").setVisible(false);
i = 1;
while ( shortDescFile = IWDatacapture.getItem("/ItemMaster/Item_Master_MLS[" + i + "]/short_description_file") )
{
shortDescFile.setVisible(false);
longDescFile = IWDatacapture.getItem("/ItemMaster/Item_Master_MLS[" + i + "]/long_description_file");
longDescFile.setVisible(false);
i++;
}
}
IWEventRegistry.addFormHandler("onSaveValid", checkAppID);
}
Find more posts tagged with
Comments
Dwayne
I don't know of any supported way of doing this. It a feature that's been requested for FormAPI for a while.
However, from my cursory look at your code, it could be that you could accomplish what you need without FormAPI. Take a look at the <allowed> attribute of the datacapture DTD. You can define fields to be hidden to authors and editors, but some other control (text, radio, whatever is appropriate) for masters and admins.
FormAPI is a powerful tool, but sometimes other options work just as well, or even better.
--
Current project: TS 5.5.2/6.1 W2K
smenon
We are looking at providing replicant handing functionality in FormAPI as part of the TeamSite 6.5 release.
thanks
--Sunil Menon
Product Manager
Interwoven, Inc.
Dwayne
Thanks.
I
thought
I had heard that it was comnig up, but I didn't have any specifics (or hard facts, for that matter) so I didn't want to say anythign.
--
Current project: TS 5.5.2/6.1 W2K
Identifier
Thanks Dwayne,
That helps me. Although I would ideally have liked to hide the fields instead of showing them and not give write access, it should do fine for right now.
Identifier.
Dwayne
You can till hide them. It sounds like you're planning on using <readonly> for users who can't edit. But you can also accomplish it by using <hidden>.
--
Current project: TS 5.5.2/6.1 W2K