Hi there,
I've got a dataslot of type list with size 5 and I want to change the 2 entry. Can I use Javascript 'putDataslot' to achieve this or is there another way.
TIA,
John Brink
Hi John,
As per my understanding you want to reduce the list dataslot values from 5 to 2. If you are doing it in pre/post scripts of worksteps then jst.putDataSlot is fine but on form you have to use bean.setPropString().
Besides this you have to do some java coding for this.
Hi,
No, that's not exactly what I want; suppose I've got a DataSlot of type List with the following values ["first element", "second element", "third element", "fouth element", "fifth element"] and now I want at the end of the WS change "second element" into "new second value". The number of elements stays the same and the values of the other elements too. I thought something like putDataslot("mylist[1]", "new second value") but that doesn't work.
Regards,
John
Hi JOhn,
Please try the following code in post script of that workstep -
java.util.ArrayList lst=jst.getDataSlot("Name of dataslot");
for(int i=0;i
{
lst(i)="New value";
}
jst.putDataSlot("Name of dataslot",lst);
Regards,
Ram Sharma
Hi Ram Sharma,
That didn't solve my problem; however Venkat came with the following solution: