Hello I am trying to have a hidden text item called sequence number inside a replicant(replicant with min="1").when ever the form is loaded the first repli's sequence number is set to 1 and whenever i add replicant, the sequence number in the second repli is set to 2 so on...The problem is the functionality is working fine, but when i am trying to save this form, its not saving(its like taking for ever). it does not even give me some erro. i dont know the reason.here is the code of my script::::::::function init(){ root=IWDatacapture.getRootItems()[0].getName(); var childnodes= IWDatacapture.getItem(root+"/Specifications").getChildren();IWDatacapture.getItem(root+"/Specifications["+childnodes.length+"]/Sequence_Number").setValue(childnodes.length); IWDatacapture.getItem(root+"/Specifications["+childnodes.length+"]/Sequence_Number").setVisible(false); IWEventRegistry.addItemHandler(root+"/Specifications","OnReplicantAdded",updateSequnce); IWEventRegistry.addItemHandler(root+"/Specifications","OnReplicantDelete",updateSequnce1); IWEventRegistry.addItemHandler(root+"/Specifications","OnReplicantMoved",updateSequnce); }function updateSequnce() { var childnodes= IWDatacapture.getItem(root+"/Specifications").getChildren(); for (var i=1; i<=childnodes.length; i++) { IWDatacapture.getItem(root+"/Specifications["+i+"]/Sequence_Number").setValue(i); IWDatacapture.getItem(root+"/Specifications["+i+"]/Sequence_Number").setVisible(false); }}In the formapi documentation, i have read that setValue() are not applicable for containers or replicant. Is that true, Is this could be the reason why my form is not saving?..........and if so, can anyone tell me some other way to setValue for the it.
even if i add the IWEventRegistry.addFormHandler("onFormInit", init); outside the code, its not working. I even commented the setvisibile part.
Iam attaching my DCT and script file with the name get_sequencenumber.
Do you have basic knowledge about DCT and FormAPI?If not then you should take training or go through the Tutorial.As your attached DCT file is not a valid file. There are lots of issues with DCT.[html]* This is not a valid tag.* Each item tag should have pathid attribute. Like this:IWDatacapture.getItem("/productfamily/global_id_jajp").setValue("2");* There is not any available item with name global_id_jajp[/html]So, I think you should first correct your DCT and check it, if you encounter any problem then post your query.
To be fair - the comments you made depend on whether the person in question is attempting to create an "iwov" or "xml" DCT - however, your point about the file being invalid as it presently exists is true - since they seem to have bits and pieces from both styles / DTDs and thus have produced an illegitimate hybrid.Also - one might suspect that the global_id_jajp element is the result of the inline call - but as we don't have that code, it's not that easy to verify.
you cannot assume what ever you want, and say things what ever you want. I asked you for a help, if you can, it will be great. if im having my dcr-type as xml, do you even think i will be able to see my template without pathid's, it will directly give an error to me(i may not even have forwaded this much).
and coming the global_id_jajp setvalue. iam having an inline callout, to data comp called \Global_Id_jajp.xml .inline command=' "D:\Program Files\Interwoven\TeamSite\iw-perl\bin\iwperl" "D:\Program Files\Interwoven\TeamSite\custom\data_comps.ipl" \templatedata\Components\ts_content\Global_Id_jajp.xml'