Use getElementById in catalog client script

hichamlasfar
Kilo Contributor

Hello,

I want to retreive the widget data (which is an HTML table in my case) on a client catalog script to store a dynamic table data into a producer result, nearly the same problem was discussed in this post: Widget and Record Producer .

In order to do that, I want to use: document.getElementById("tableId"); in a catalog client script and do other javascript process, the problem is that I think it's not possible to manipulate the DOM in catalog client script (I'm in Helsinki). is there any solution to this problem (use the DOM or other alternative) in the post shown below they are speaking about: $scope.page.field.value = VALUE but I don't how can I use it?

Thanks in advance

8 REPLIES 8

I didn't find a solution to this problem (I think that we can't do it in Helsinki), but in response to your problem, you can use: g_form.getUniqueValue() to retrieve the sys_id


No Hicham,It didn't worked for me



Thanks


Saranya


xiaix
Tera Guru

Yes, same here.   I've created a Catalog Item for the new Service Portal and attached an SP Widget Macro:



find_real_file.png



The widget simply looks like this:



find_real_file.png



I then attached a Catalog Client Script to the Catalog Item:



find_real_file.png



Well, when that Catalog Client Script triggers, I get this in my console log:



find_real_file.png



So... this tells me that Catalog Client Scripts on the Service Portal don't have access to the DOM.



Okay, so I thought adding this System Property would work:


find_real_file.png



as told here: Re: Fuji client scripts: document object is null



Nope, didn't work!   How very frustrating.



Anyone have a solution ??


ursraghu
Kilo Contributor

Hi david,

 

I am also facing same frustration now. Anyone have solution? or may i know, how you resolved it?

 

Regards,

RG.