Home
TeamSite
TeamSite, LiveSite and OpenDeploy
readonly oddity
Andy Knipp
So I have a replicant of items, in each set some will be readonly and changed within formapi.
I have 2 issues. First, (should be an easy one), when I open an existing DCR, how do I know how
many times to set RO ? Where can I get the # of replicants on open ?
Second issue is strange.
During the open, I set the exiting fields to readonly. Works great. They are RO and grey,
making it obvious they are not writable. I also have a onaddreplicant event to make any new ones
added RO as well. They are readonly, however, they are not grey, but white.
Here is the code:
function init() {
IWEventRegistry.addItemHandler('/Catalog','OnReplicantAdded',newdata);
setreadonly();
}
function newdata(newitem){
var item=newitem.getName();
IWDatacapture.getItem(item+'/AccyCat').setReadOnly(true);
IWDatacapture.getItem(item+'/AccyTitleNomen').setReadOnly(true);
IWDatacapture.getItem(item+'/MotProdLine').setReadOnly(true);
IWDatacapture.getItem(item+'/PDSTitle').setReadOnly(true);
IWDatacapture.getItem(item+'/PDSImageSet').setReadOnly(true);
IWDatacapture.getItem(item+'/PDSImage').setReadOnly(true);
IWDatacapture.getItem(item+'/PDSContentDesc').setReadOnly(true);
IWDatacapture.redraw();
}
function setreadonly(){
IWDatacapture.getItem('/Catalog[1]/AccyCat').setReadOnly(true);
IWDatacapture.getItem('/Catalog[2]/AccyCat').setReadOnly(true);
IWDatacapture.getItem('/Catalog[1]/AccyTitleNomen').setReadOnly(true);
IWDatacapture.getItem('/Catalog[2]/AccyTitleNomen').setReadOnly(true);
IWDatacapture.getItem('/Catalog[1]/MotProdLine').setReadOnly(true);
IWDatacapture.getItem('/Catalog[2]/MotProdLine').setReadOnly(true);
IWDatacapture.getItem('/Catalog[1]/PDSTitle').setReadOnly(true);
IWDatacapture.getItem('/Catalog[2]/PDSTitle').setReadOnly(true);
IWDatacapture.getItem('/Catalog[1]/PDSImageSet').setReadOnly(true);
IWDatacapture.getItem('/Catalog[2]/PDSImageSet').setReadOnly(true);
IWDatacapture.getItem('/Catalog[1]/PDSImage').setReadOnly(true);
IWDatacapture.getItem('/Catalog[2]/PDSImage').setReadOnly(true);
IWDatacapture.getItem('/Catalog[1]/PDSContentDesc').setReadOnly(true);
IWDatacapture.getItem('/Catalog[2]/PDSContentDesc').setReadOnly(true);
IWDatacapture.redraw();
}
Find more posts tagged with
Comments
There are no comments yet