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 Make other items visible in an or container
gupta
Hi!
The or container displays only one of the items contained within it, and by
default it displays the first one.
How do i display the other item which is also available in the container using form API.
Below is the block of code i have written to create an or container.
<container name="Link" combination="or">
<label>Link</label>
<item name="URL">
<text size="20" required="t" maxlength="1024"/>
</item>
<item name="Node">
<text size="20" required="t" maxlength="1024"/>
</item>
</container>
When the DCT loads, it displays the "URL" Item in the "Link" container . I want to change this display to "Node" item at run time.
Can anybody help me?
Find more posts tagged with
Comments
Migrateduser
Hi,
plz attach your code to address the issue.
Thanks
RG
Johnny
Why don't you just swap the order?
John Cuiuli
gupta
Can swapping be done using formAPI ? if yes cud u please explain me how
Migrateduser
Hi.
Try the following, its working @ my end.
<?xml version="1.0" encoding = "UTF-8"?>
<!DOCTYPE datacapture SYSTEM "datacapture5.0.dtd">
<data-capture-requirements type="content" name="LogGen">
<ruleset name="LogGen">
<container name="Link" combination="or">
<label>Link</label>
<item name="Node">
<text size="20" required="t" maxlength="1024"/>
</item>
<item name="URL">
<text size="20" required="t" maxlength="1024"/>
</item>
</container>
</ruleset>
</data-capture-requirements>
Let me know if any issues.
Thanks
RG
gupta
Find the code attached.
RG, can this change of order be done dynamically...i mean using form api at runtime after the DCT is loaded.
thanx for ur effort.
Migrateduser
Hi Gupta
if you want to swap the items dynamically, the you need to write the Form API function like
function init(){
IWEventRegistry.addItemHandler("swap items","onItemChange",handler);
}
Its not tested but the function shd be similar, i mean this shd be the logic. Let me know if you stuck in writing the logic / function.
Thanks
RG
gupta
Hi!! RG,
The problem i am facing is how do i swap the items. I have implemented the event handler, and am stuck at
what should be the actual code to swap the two elements so that the other one is visible.
Johnny
Sorry I meant in the DCT. Does it need to be dynamic?.. You could swap the items in the DCT and not need any FormAPI.
John Cuiuli
gupta
John,
It is a possible solution but it does not meet the requirement. The decision as to which item must be
displayed is done after the DCT is loaded.
Migrateduser
how to swap without form api and shd be dynamically?
Thanks
RG