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)
setReadOnly
Freedom
Does anyone have used:
IWItem.setReadOnly with recursive option? What I have here is a replicant container which contains two items, I want to set the second item in the container to readonly in default.
Any ideas?
Thanks
Find more posts tagged with
Comments
Michael
If it is always going to be readonly then you could simply define it using a readonly item in your DCT.
Michael
If you want it to be readonly by default and then dynamically made writeable then you will need to use formAPI.
I don't know of any 'recursive' option for setReadOnly- is this in the doco or did you just imagine it?
You can do this yourself in your init code - get the children, iterate through them, set stuff read only, Bob's your uncle.
In addition because it is a replicant you will need to handle the event when a new replicant item is created and make the new instance of the field readonly -- I hope you are on 6.5 as then formAPI supports this officially now.
Hope this helps.
Cheers
Michael
Freedom
That's exactly what I am trying to do. It's easy to make the default item in the replicant container be readonly by default. What when you add a replicant, how can you make the item to be readonly?
BTW, I am on 6.5. There is a 'recursive' option for setReadOnly. P. 50 in tst.6.5.0.formapi
Thanks a lot!
Freedom
I used "OnReplicantAdded" event handler to handle the new items. I can access those items, but the one I tried to set to readonly does not seem to be set.
Am I using the right event handler?
Thanks
Michael
Apologies - yes you are right there is a new option in 6.5 setReadOnly for recursive -- isn't that handy! Not in this case though...
btw it is always a good idea to include your environment details (version, platform, service packs etc) when you ask a question.
Cheers
Michael
Michael
Yes indeed that sounds like the correct event to be handling. As long as you have addressed everything correctly it should work fine.
Do you know if the event is getting triggered - using an alert in your handler is an easy way?
Perhaps if you post your code we can all have a little look?
Cheers
Michael
Freedom
I've got everything working.
Thanks for all your help!.
rodigz
can i see sample code?