//Should be visible on load by default. function typeHandler(typeItem) { var type = typeItem.getOptions()[typeItem.getValue()].value; var parent= IWDatacapture.getItem(typeItem.getName() + "/.."); if(type == "Structured") { setItemStatus(parent.getChildByName("content"),true); setItemStatus(parent.getChildByName("htmlFragment"),false); } else { setItemStatus(parent.getChildByName("content"),false); setItemStatus(parent.getChildByName("htmlFragment"),true); } }
Hi Rajath, Thank you for your response. I will remove the check for "initial". But my problem is the code i have written hides or shows items selectively. The script doesnt fail. That is working fine. I open a new form entry, enter data and save the dcr. When I open the saved dcr, the items which I have hidden starts appearing. I dont understand how is it. Any ideas about this.
Hi Natasha, I get the issue in both the modes. View or edit..The items i have hidden reappear.
Hi Rajat, Thank you for your response. I will remove the check for "initial". But my problem is the code i have written hides or shows items selectively. The script doesnt fail. That is working fine. I open a new form entry, enter data and save the dcr. When I open the saved dcr, the items which I have hidden starts appearing. I dont understand how is it. Any ideas about this.
Hi Sariba,Can u plz tell how are u opening the saved DCR i.e in view mode or edit mode?Thanks,Natasha.
Hi Natasha,I get the issue in both the modes. View or edit..The items i have hidden reappear.
As you said you hide/unhide items based on the selection of radio button, so while opening the form in view/edit mode, you should get those items only which were filled and saved.
FYI, The Javascript will not kick off in View mode. The formAPI only works in the edit mode.So it really shouldn't matter. Only in the edit mode will they appear hidden. In the view mode it will show all the elements of the XML parsed into the FormsPublisher interface.