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)
hide only few items of the replicant
herald10
Hi,
I have a replicant item that has a text field and an image field. I would like to hide the image field for few of the replicant instances. Any idea as to how it can be implemented?
Thanks a lot
-H
Find more posts tagged with
Comments
Adam Stoller
What do you mean by "a few of the replicants"?
Based on what logic are you determining whether or not to hide/show this field?
Also - what version of TS are you using?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
EmailConfigScreens.zip
herald10
I am using Teamsite 5.5.2 on solaris. I would like to hide Image item for all the replicants except the first and the last.
Ex.
Replicant Item
1. Text - show
Image - show
2. Text - show
Image - hide
3. Text - show
Image - hide
.....................
n. Text - show
Image - show
Hope that gives a better picture of what I am looking for.
Thanks a lot
-H
jbonifaci
Well, you might be able to do something quirky with formapi to get it to work, but I would first question why you are doing this. What is the significance to the first and last replicant? Will there always be at least 2 replicants? Is one the header and one the footer of a section? Why not create a separate items for the image/text of your header (or whatever you what you want your first replicant to be), followed by a replicant of text fields, followed by another set of items for the image/text fields of your footer (or whatever you what you want your last replicant to be)? This would seem like a much cleaner solution for what you want.
One quirky thing you would need to deal with if you can get your solution working with formapi is if a user selected an image for the last replicant, but then added a replicant below it. Or if the user selected an image for the first replicant, but then moved the 2nd replicant to the first spot.
One other solution might be to use an or replicant with your 2 items being a text only container and a text with image container. This would of course require the user to select the appropriate replicant, but another option to explore.
I would go with my first suggestion though.
Adam Stoller
Well, it can probably be done - but it would probably be a lot easier in 6.5 where support for replicants has been added to the FormAPI arsenal.
My guess is your FormAPI code would have to fire off for each and every event associated with the changing of the replicant and then determine how many instances there were and if the current instance was the first or last instance, otherwise hide the element.
You do know that 5.5.2 is being end-of-lifed at the end of June 2005 - right? Only a few months away -- if you can hold off trying to implement this until you can work on 6.5 (or higher?) you'll probably be much happier. To give you an idea of what exists starting in 6.5 - event triggers for:
- onReplicantAdded
- onReplicantBeforeAdd
- onReplicantBeforeMove
- onReplicantDelete (*)
- onReplicantMoved
(* should have been named onReplicantBeforeDelete according to what's documented - they seem to be missing onReplicantDeleted - at least from the documentation I've seen)
But think about how much easier the above events would make it for you to write code to determine whether or not you wanted to hide/expose a field...
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
saumil
Hi,
Following code will allow you to capture the event on Replicant item added.
parent.IWDCEventRegistry.addListener('onItemAdded',handleItemAdded);
But it's kind of hack, so most probably not going to applicable on 6.x version.
Saumil
BTWholesale | CMS