Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
setting dcrname use formapi
tsrookie
Gidday all,
In TS 5.5 the following worked to set the dcr name based on the users selection from a drop down.
In 6.1 it no longer works can anyone help.
If I put an alert in it returns dcr name, I suspect the problem is with IWDCRInfo.setDCRName(dcrName);
Thank you
Colin
function init(){
// register some event handlers
IWEventRegistry.addItemHandler( "/menuTitle", "onItemChange", setDCRName );
}
function setDCRName(item){
dcrName = item.getOptions()[item.getValue()].value;
IWDCRInfo.setDCRName(dcrName);
return true;
}
init();
Find more posts tagged with
Comments
tsrookie
My apologies, It does work just not the same way as in TS 5.5
In 5.5 when I select an option from the drop down list you can see the dcr save name change immediatley but in TS 6.1 the save name will change only after the save button is clicked.
Colin
Ottawa_IWOV
Is there anyway to have the name refresh, or have a JavaScript function do it. Really annoying ...
Migrateduser
What do you mean by "name refresh"? What are you looking to do, exactly?
Dave
Current Environment(s):
(1) TS 6.5 on Solaris 9
(2) TS 6.1 SP1 on W2K3
(3) TS 6.1 on W2K
Ottawa_IWOV
When you perform a setDCRname, the name in the DCT still shows Untitled. I would like to have that refreshed
Migrateduser
When are you performing the setDCRname? Because when it's done onSaveValid or even onSave, it does refresh the word "Untitled" with the appropriate value.
Dave
Current Environment(s):
(1) TS 6.5 on Solaris 9
(2) TS 6.1 SP1 on W2K3
(3) TS 6.1 on W2K
Ottawa_IWOV
OK, here is my follow on
I want the user to Save the DCR. SO if the user selects Finish, the form is saved, yada yada yada. However, I want the form to stay open and have a callServer performed.
Do you know the steps for accomplishing this?
Migrateduser
You could have a function associated with onSaveValid (which it sounds like you do) but this returns false from within the function. This should cause the form to stay open, and you can do the callServer before you return false in that function.
Dave
Current Environment(s):
(1) TS 6.5 on Solaris 9
(2) TS 6.1 SP1 on W2K3
(3) TS 6.1 on W2K
Ottawa_IWOV
This is my OnSave function
function validate () {
//Check to see if the DCR has a name
if(IWDCRInfo.getDCRName() == "") {
alert("dcr has not been named yet");
var name = "testDCR";
IWDCRInfo.setDCRName(name);
var params = new Object();
var server = window.location.hostname;
params.filename = "/default/main/FAC/test/WORKAREA/sample/templatedata/fac_e/generic/data/testDCR";
var url = "http://"+server+"/iw-bin/iw_cgi_wrapper.cgi/suggestTerms2.ipl";
IWDatacapture.callServer(url,params,true);
return false;
}
I want to be able to get the SAVED DCR to a callServer to I can parse a textarea and pass it to MetaTagger. However, I think the script doesn't see the file, and cannot parse.
It this something I can accomplish?
Thanks,
Migrateduser
I don't think that it's actually saved until the onSave function returns true, but this is easily verified. If, when you open a new record and run this function, which returns false, does a record exist? My guess would be 'no', so we'd need to come up with something different...
Let's assume the callServer completes successfully. Do you still need the DCR open at that point?
Dave
Current Environment(s):
(1) TS 6.5 on Solaris 9
(2) TS 6.1 SP1 on W2K3
(3) TS 6.1 on W2K
Ottawa_IWOV
Yes I would like to keep the record open.
Originally, I was passing the textarea through a callServer as a parameter, but I was getting incosistent results when this field was really big. So my next options was to have a callServer take care of it by parsing the DCR and getting the value.
BUT, we neec to get it a name, and have the DCR exist (i.e. onSave returns true). I would like to have the DCR remain open, because a new field will be set with the results from the call server (a textarea summary from MetaTagger that the user can manually edit).
Any thoughts on the best way to do this would be great.
Regards,
Migrateduser
Okay, how about you run the function during an onSave event (i.e. train the users to utilize the Save button instead of Finish initially). The DCR is still open after this function (which returns true, by the way) and the callServer is performed. When FINISH is called, you could have a flag somewhere that will cause the callserver to NOT run a 2nd time because it's already run and then the record will close.
Would that serve your purpose?
Current Environment(s):
(1) TS 6.5 on Solaris 9
(2) TS 6.1 SP1 on W2K3
(3) TS 6.1 on W2K
cliffhanger
You could use onClose to make the server call. OnClose handler gets called after onSaveDone, so your DCR will already display the name, meaning it's saved in the repository.
Ottawa_IWOV
So I do the callServer after the return true?
cliffhanger
You need to return true from your onSave/onSaveValid handlers.
But return false from onClose handler, then execute the callServer.
Then when you want to save the DCR and close it, invoke IWDATACAPTURE.Save(). For this save process to continue successfully you need to keep a boolean check
in your .js file that gets set from the callServer()'s callback function. Then you can check that value in your onClose handler to determine whether you want to
return true or false.
-cliff