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)
Which is the best option?
kkumar
A dct have a container which has max attribute value 500.
It has two items
1)Heading => Text
2)Description => TextArea
Now using formAPI I have to validate that in every container "Heading" value should be unique.
Using onSave I am able to show the alert box to tell the duplicate values.
But my TL says that do it using onFocus (which I am not able to find in Interwoven formAPI pdf)
Another option is onReplicantAdded ( But that is not useful when last container has duplicate value).
Please suggest which event is the best and fast to check the duplicate "Heading" in different-2 container.
Please note that in a DCR there can be 500 container.
Find more posts tagged with
Comments
nipper
Not onFocus but onItemChange will be a good trigger. That is fired as soon as focus is pulled from an item (and it was changed)
You can iterate through the Headings or you can set up a hash with the text being the key and set the value to 1 when it is added & build the hash onFormInit
Now, to use the hash perfectly you will need to handle when the item is deleted or changed (which may be difficult but can be done with a second array/hash). If that becomes too hard, you can iterate through the 500 items each time.
kkumar
Thanks for reply Nipper.
I will try with onItemChange.
But do we have something like onFocus_ _ _ (event)?
nipper
There is a JS call called onFocus (jquery as well). Maybe he meant that. But onItemChange should be better.
kkumar
Again thanks a lot for your prompt reply Nipper.