How can I get the index of a replicant? Any help?
Where can i read more about lastindexof?
IWEventRegistry.addItemHandler('/IMAGES/IMG_DETAILS/IMG_FILES','onReplicantAdded',setSeqfileNo);function setSeqfileNo(item) { var i=IWDatacapture.getItem("/IMAGES/IMG_DETAILS/IMG_FILES").getChildren().length; var path=item.getName(); var v=i+""; IWDatacapture.getItem(path+"/IMG_SEQ_NO").setValue(v) IWDatacapture.getItem(path+"/IMG_SEQ_NO").setVisible(true); return true; }
function setSeqfileNo(item){var item_i = item.getName();var repCount = item_i.substring(30,item_i.lastIndexOf("]"));alert(repCount);//above line will return the replicant Count for IMG_FILESIWDatacapture.getItem(path+"/IMG_SEQ_NO").setValue(repCount) IWDatacapture.getItem(path+"/IMG_SEQ_NO").setVisible(true);return true;}
No its not working.When I click on "+" to add replicants its not adding any.
IWDatacapture.getItem(item_i+"/IMG_SEQ_NO").setValue(repCount);IWDatacapture.getItem(item_i+"/IMG_SEQ_NO").setVisible(true);
Can you belive it, I blindly copy pasted the code. But still no luck,Replicants are not getting added.
I got it and Thanks so much for your help.That lastindexof() helped me a lot in dealing with my logic.