Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
how to refer replicant element in IW 6.5
motlnt
Hi All,
I have following code which works in 552 but not in 6.5
This is what I am trying to do.
I have replicants defined in my DCT.
My code gets the replicant field name as,
"CONTENT_BUCKET/0/ID_DYN_CONTENT_READONLY"
when I try to get to this field in DCR in javascript as,
var theIdField = eval(iwFormName + ".elements['" + idFieldName + "']");
it throws me a javascript value as "undefined"
any sugetions?
thx in advance,
my env:
win2003 ent edition
IW6.5
JM
Find more posts tagged with
Comments
Migrateduser
It might help to post your entire DCT, but at first glance, it looks as though you have too many quotes around idFieldName. Try taking away the single quotes and see if you still see that error. That's my first thought on this.
Other than attaching (please don't simply paste) your DCT, what are you trying to do with this field? Your statement SHOULD work with the eval but it might be an unnecessary step.
Dave
Current Environments:
(1) TS 6.5 on W2K3 (x2 - diff. imp.)
(3) Vignette V7 Portal on Solaris 9
jbonifaci
Use the following regex on the field name before referencing it in your javascript:
s|/(\d+)/|'['.eval($1+1).']/'|eg
Hope this helps. Let me know if you have any questions.
~Jeff
motlnt
find here attached the function from my JS file....
any comments?
Tx,
JM
motlnt
hi..
where do i put this regex?
JM
Migrateduser
I'm also interested in seeing the DCT, but there's a whole lot of problems with your code. First of all, how are you calling handleSingleSelect? Also, where are you setting the variables that are all caps? It seems like you're pulling them out of thin air. Yes, Javascript will complain about that. Why all of the eval statements anyway? They seem superfluous and it's difficult for me to understand what you're trying to do in this routine.
Current Environments:
(1) TS 6.5 on W2K3 (x2 - diff. imp.)
(3) Vignette V7 Portal on Solaris 9
jbonifaci
You would apply the regex to the field name in your cgi that is outputing the field name to the javascript.
~Jeff
jbonifaci
Dave,
I agree with you, there is are a lot of strange things going on in that javascript.
Motint, I would consider rewriting this callout to use formapi for interfacing with the DCT.
~Jeff
motlnt
guys...here is the partial DCT code...
this DCT calls an IPL and which inturn calls the JS file and the particular function....
JM
motlnt
one more..
the IPL is called from the DCT in new popup so i need my JS function to write the value selected frm the popup to the parent window field..
also this code is taken frm the 552,so i havent chaged it yet to incorporate formapi.....
JM
jbonifaci
Well, technically it should have been using formapi in 5.5.2 as well. But, that aside, the change I recommended would be done within the perl script that is retrieving the post data from the DCT.
I still would recommend using formapi though, as it makes the code much simpler and easier to maintain. If it is a cgi-callout, you can reference an item like this:
opener.parent.getScriptFrame().IWDatacapture.getItem()
If it is a callServer, you can reference an item like this:
parent.getScriptFrame().IWDatacapture.getItem()
You should be able to figure the rest out based on these examples.
~Jeff
Migrateduser
motInt, I'm not going to say "RTFM" because I think that's kinda mean. I think you're on the right track but you have some serious scoping and syntax issues with your code. If I were able to spend the time, I'd start from the beginning and rewrite your code, starting from the logical begin.
So, first I'd keep the callout but remove any Javascript. Then, I'd put back the JS but keep it very bare. Then, iteratively, add back the code you have now, using lots of "alerts" and correcting errors along the way. I'm sure it's been frustrating trying to debug this stuff but I think if you approach it as recreating your code, you might find the problem(s) quickly.
Dave
Current Environments:
(1) TS 6.5 on W2K3 (x2 - diff. imp.)
(3) Vignette V7 Portal on Solaris 9
motlnt
thx for your comments...
sure will try to re-code it...
JM