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)
how to hide a field when user creates new replicant
skbaker
I've got a replicant element that defaults to 6 instances when a DCT is first loaded. The replicant element includes several fields, one of which I want to have hidden on the form. For each of these 6 default instances, I am able to hide the field using FormAPI when the DCT is loaded.
However, if a user creates a new replicant (by clicking the + button), the field is not hidden in the new replicant. I want to hide it, but I'm not sure how. The only FormAPI command I can think of is the onItemChange, but I can't find any examples of how to construct this event handler on a replicant itself (rather than an individual field).
I'd appreciate any examples or advice anyone has. (TS 5.5 on AIX)
Find more posts tagged with
Comments
Migrateduser
Could you not hide the item using the <hidden /> tag like this, if for example you needed EmpID hidden?
<replicant max="10" default="6">
<container name="A" hide-name='t'>
<item name="Name">
<database data-type='VARCHAR(90)' />
<text required="t" size="23" maxlength="23" wrap="virtual" />
</item>
<item name="EmpID">
<label>Employee ID</label>
<hidden />
<database data-type='VARCHAR(90)' />
text required="f" size="23" maxlength="23" wrap="virtual" />
</replicant>
I am also having trouble with a field that sometimes needs to be hidden, and whenever a new replicant is created it contains the field which should be hidden. The only thing I could think of to hide it would be if you had a "total" field which would be a sum of the amount of replicants and attached an OnItemChange to this, so that whenever a new item is added, it runs the "hide item" script you described. Sadly I haven't been able to see if this works yet - sorry!. Hope this is some help...