Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simply updateing a feature 2

Status
Not open for further replies.

SenadSe

Programmer
Dec 2, 2011
28
BA
On the picture there are these two features which i want to update:
Feature1
Feature2

The method that should update them is the 'Execute' method marked with number 3.

So, they are all in the same object.
And, in the debugger window you see what it should send to the features as well as the code.

Tell me please, what am i doing wrong.

the picture:


 
code looks fine as the .fTest value is being set correctly, can you provide the rest of the code you are using in that script and I'll test it ?

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
from your picture it looks like you are trying to assign a list within a list something like this e.g

tempNodetypeList={0,202,136,141}
.fNodeTypeDy=tempNodetypeList.

what you are trying to assign is
.fNodeTypeDy={tempNodetypeList}

a List within a List....

i think you dodn't need that just define your 2 features to be of type list and do the assignment.Do you really need in code a List within a List?


Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
There is the same situation with the .fTest feature . This picture will explain the situation well:
(before i send you any code)

the explanation:

The code in frame 1 ,sets the .fTest to 7 .
7 is set to test2 which is confirmed in Frame2 .
But, the external feature fTest (frame3) is still 16 ( as we can see inframe4)
 
what happens if you echo that in debugger or when you have actually assigned the value inspect the 'this' object as the GUI on your right is painted and not reflected

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
@appnair For that you are right i dont need a list in a list, it was just a try to do it that way. since the other way it didnt work.

So if i remove the {} it still wont update the external fNodetypeDy.

@all
i hope my secound post will explain what my confusion is.
 
I think you are running into persistence of the List value I am not sure if you have to undefine the list like I have test this script and see if it gets you where you want to be
Code:
/*function Dynamic Execute()
	echo("worked")
	List appu ={1,2,3}
	.fList=appu
	
	scheduler.debugbreak()
	echo("inspect the list")
	List appu1 ={1,2,3,4,5,6,7,8,9,10}
	.fList=appu1
	
	//this will look freaky as subsequent runs will store tjhe list
	//so comment this out and run the second method I have
	
end
*/


function Dynamic Execute()
	echo("worked")
	.fList=undefined
	.fList1=undefined
	List appu ={1,2,3}
	.fList=appu
	
	scheduler.debugbreak()
		echo("inspect the list")
	.fList=undefined
	.fList1=undefined
	
	List appu1 ={1,2,3,4,5,6,7,8,9,10}
	.fList=appu1
	.fList1=appu1
	
	//this will look freaky as subsequent runs will store tjhe list
	
end

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
@appnair
your code works fine, i made a new script with your code and the 2 new features fList and fList1 and they are updated at the same moment the line of code was compiled.

I dont get it, its the same situation but mine is not working. Here is my Execute method maybe you can find something that is wrong:

Code:
/*
* This is the method subclasses implement to provide their functionality.
*
* @param {Dynamic} ctxIn
* @param {Dynamic} ctxOut
* @param {Record} request
*
* @return {Dynamic} Undefined
*/

function Dynamic Execute( 	Dynamic		ctxIn, 	Dynamic		ctxOut, 	Record		r )
	
//	Object		prgCtx	= .PrgSession()
	
	List tempNodetypeList = .fNodetypeList

	
	
	Boolean ShowEnterprise111
	Boolean ShowPersonal111
	Boolean ShowFolder111
        Boolean ShowProject111
  	Boolean ShowCompoundDocument111

        .fTest = 16
	

	RecArray Items
	
	String postop="init"
	
	if IsFeature( r, 'postop' )
		postop=r.postop
	end	

	if postop=="init"
		
		if 141 in tempNodetypeList
		ShowEnterprise111 = true
		end
		
		If 142 in tempNodetypeList
		ShowPersonal111 = true
		end
		
		If 0 in tempNodetypeList
		ShowFolder111 = true
		end
		
		If 202 in tempNodetypeList
		ShowProject111 = true
		end
		
		If 136 in tempNodetypeList
		ShowCompoundDocument111 = true
		end
		
	end


	if postop=="save"
		
		tempNodetypeList ={}
			
		if IsFeature(r,'ShowEnterpriseAAA')
		tempNodetypeList = List.setAdd(tempNodetypeList , 141 )
		end 
		
		if IsFeature(r,'ShowFolderAAA')
		tempNodetypeList = List.setAdd(tempNodetypeList , 0 )
		end 
		
		
		if IsFeature(r,"ShowProjectAAA")
		tempNodetypeList = List.setAdd(tempNodetypeList , 202 )
		end 
		
	
		if IsFeature(r,"ShowCompoundDocumentAAA")
		tempNodetypeList = List.setAdd(tempNodetypeList , 136 )
		end 
		
		if IsFeature(r,"ShowPersonalAAA")
		tempNodetypeList = List.setAdd(tempNodetypeList , 142 )
		end 
		
		.fTest = 7
		
		dynamic test2 = .fTest
		
		.fNodetypeList = tempNodetypeList 
	//	.fNodetypeListDy = {tempNodetypeList}
	

	end
	
	
	.fData = Assoc.CreateAssoc()
	.fData.ShowEnterpriseAAA=ShowEnterprise111
	.fData.ShowPersonalAAA=ShowPersonal111
	.fData.ShowFolderAAA=ShowFolder111
   	.fData.ShowProjectAAA=ShowProject111
  	.fData.ShowCompoundDocumentAAA=ShowCompoundDocument111
        .fData.Items=Items


	//return items
//return undefined
end
 
Perhaps let's take a step back and try to understand this as I am not really understanding in what context this is being said.
1)are we trying to prove that a List which is alraedy assigned cannot be re-assigned?
2)are we trying to prove OT code or the debugger is wrong?


scenario 1-A weblingo file which is the output of the RH is being shown to the user.In that case you will have to have some mechanism so that you should nullify or undefined or pre-defined varaiables of the object.
Scenario2-the user made a selection and submitted to your RH at this point you want to trap the selections they made,so you would nullify the things and then start building your new lists.Is that correct.At that point your features would be overwritten by the new values and based on your execute code.Correct?
again subsequent request same procedure.
Since you are running this on builder you only have one THREAD that is why you probably(wrongly) think these values are persistent.Once you move your code into livelink services then each thread will start up and you have no way of guaranteeing persistence.You can use a cookie or write to a cache if you need persistence.Individual threads won't share memory You can even use the querystring varaiables or fields that are hidden in your html form to get post variables

I wish I could show you a simple weblingo and its execute that I have done so that the same execute method can be used time and again...

mybe Greg will get it I am not really understanding the problem that is being presented to me




Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Ok it works now. i have to write it as global variables:
Code:
$CustfolderAdvanced.AdvancedInfoConfig.fNodetypeList=undefined
		$CustfolderAdvanced.AdvancedInfoConfig.fNodetypeList = tempNodetypeList 
		$CustfolderAdvanced.AdvancedInfoConfig.fNodetypeListDy=undefined
		$CustfolderAdvanced.AdvancedInfoConfig.fNodetypeListDy = tempNodetypeList

So to make it clear i have a question:
If i make an object globbally available, then u have to refer to the objects features as global features even if they are in the same object where i am refering from?

It seems thet this was the rule here.
Anyway thx for helping, and i guess this topic is closed.
 
@appnair
Scenario2 is correct, i check some chechkboxes in the weblingo, and based on that , i make a List (everytime i hit the 'Save Changes' buttno) (this is the case when postop == save)

Anyway i solved it, thk you guys for takeing the time, i was stuck on this for few days now i guess i had to discuss it with someone to come to the conclusion.

And now, stars for everyone :D

 
OK I ran your code first in builder hardcoding my feature
fNodeTypeList to {0,142} and then I got out put for fData
I traced line by line when your code reaches
fTest it remained 0 is the right side of the painted debugger but when I inspect this.fdata I see 16.It did not enter the 'save condition so it shsould remain 16.I let it run thru and it
I then cleared the hardcode in my feature and put that in code
then when the line executed I clicked on the right side of the builder gui that said fnodetypelist={}.I then invoked the 'this' object in my debugger and "INSPECTED" that it has {0.142}
Is that what you are experincing if so it is a IDE refresh problem.



Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
It was not the refresh thing, ( i see what you mean). It didnt update at all the features. (ok , yes it did in the 'this' object but not in the exernal feature).

Now it worsk, when i write it as globals as in the post above: It updates the .fNodetypeList as soon as it compiles the corresponding line of code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top