Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 luke_brady
		
			luke_brady
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hello all,
I've been messing around with enigma.js and wanted to try changing the title of a simple table.
I got the ID of the table and made sure not to set the boolean in ApplyPatches to true, meaning that the change should persist because it's not a soft patch. When looking at the properties of the table, I can see that the title I've chosen is there and I expected the title to also be visible when going into the app.
Am I missing something or does anyone know the reason why the title that I've passed with ApplyPatches and is now the title, according the engine, is not being shown? The path I used was "/title", which as far as I'm aware is the title that appears at the top of the visualisation when the hide title setting is not turned on.
Thanks for taking the time to read if you did and appreciate all replies!
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I use a session object as a working object and then copy it's properties to my target object (obj). Like this:
var sessionObject = await app.CreateGenericSessionObjectAsync(await obj.GetPropertiesAsync()); 
await sessionObject.ApplyPatchesAsync(patches);
var sessProps = await sessionObject.GetPropertiesAsync();
sessProps.Info.Id = "";
await obj.SetPropertiesAsync(sessProps);
await app.DestroyGenericSessionObjectAsync(sessionObject.Id);
await app.SaveObjectsAsync();
Yes, it is reflected immediately across all sessions.
-Rob
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I've run into that issue as well. My workaround is that after ApplyPatches(), I GetProperties followed by SetProperties.
Not sure why this is necessary, but that's what I do.
-Rob
 
					
				
		
 Øystein_Kolsrud
		
			Øystein_Kolsrud
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If you set the Boolean to "true", then that implies you are doing a soft patch which should not be persisted. So try setting it to "false" instead.
https://qlik.dev/apis/json-rpc/qix/genericobject/#applypatches
 luke_brady
		
			luke_brady
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
the boolean is already empty, which defaults to "false", so it's not a soft patch. Soft patches are also not shown in getProperties(), only in getLayout().
 
					
				
		
 Øystein_Kolsrud
		
			Øystein_Kolsrud
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Ah, sorry... I missed the negation in your sentence there...
 luke_brady
		
			luke_brady
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I think I'll give it a try too.
What parameters are you passing with SetProperties()? 
Does this then change the title in real time that you can see it immediately in the app, in your experience?
Thanks!
 gfuellerer
		
			gfuellerer
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		In my experience, "ApplyPatches" sometimes works immediately and sometimes it takes some time. If you duplicate the app, the duplicate usually reflects the desired changes. Seems like there is some "server side" caching of the app. It does not seem to be caused by client browser caching, because switching to incognito mode so far has never solved the issue for me.
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I use a session object as a working object and then copy it's properties to my target object (obj). Like this:
var sessionObject = await app.CreateGenericSessionObjectAsync(await obj.GetPropertiesAsync()); 
await sessionObject.ApplyPatchesAsync(patches);
var sessProps = await sessionObject.GetPropertiesAsync();
sessProps.Info.Id = "";
await obj.SetPropertiesAsync(sessProps);
await app.DestroyGenericSessionObjectAsync(sessionObject.Id);
await app.SaveObjectsAsync();
Yes, it is reflected immediately across all sessions.
-Rob
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		The issue may be that ApplyPatches() doesn't trigger the object change notification as SetProperties does.
-Rob
