setTitle extjs 5.1 removed - extjs5

I have a problem in new extjs 5.0 - 5.1 with panel set Title.
Now when I use panel's setTitle fucntion I get error "Cannot read property 'titlechange' of undefined"
In doc setTitle function was removed. How can I change title now?

You can try this:
panel.down('title').setBind({text:'newTitle'})

Even if setTitle is not in documentation is seems to work for me (example: http://jsfiddle.net/Lqqc5oww/1/). I've found out lately that there is more lacks in documentation. As an alternative you ma try panel.down('title').setText('...') (example: http://jsfiddle.net/Lqqc5oww/2/)

Related

What should be done to get around or resolve the PrimeFaces exception requiring the definition of a lazy attribute or one that doesn't result in null?

I am in the progress of upgrading a legacy application from PrimeFaces 6.2 to 11.0.0 (which is the newest available with maven - https://mvnrepository.com/artifact/org.primefaces/primefaces). I have had to make a number of changes, including adding Object as the parameter for RowEditEvent and TreeNode objects (which are now generic) and changing instantiations of DefaultStreamedContent to use .builder(). Now, I am facing the following error whenever I try to run the application and navigate to certain pages:
"javax.faces.FacesException: Unable to automatically determine the lazy attribute. Either define the lazy attribute on the component or make sure the value attribute doesn't resolve to null."
It looks like an exception is being thrown rather than a warning as is noted in the conversation here: https://github.com/primefaces/primefaces/issues/8436. It also looks like it was fixed, but for version 12 (which is not on the maven central repository).
I am wondering what my options are, or what could be done about this. Should I go back to an older version?
As a workaround you could create an application factory which sets the lazy attribute to false.
See: https://primefaces.github.io/primefaces/11_0_0/#/core/globalattributes
Is it a lazy DataTable which uses LazyDataModel? If yes, just set lazy=true, otherwhise set lazy=false

Why the HTMLDialogElement in Angular doesn't have showModal() method?

When I am writing this, the MDN shows that HTMLDialogElement is supported in all browser except Internet Explorer.
But weirdly enough, while using it, there is a warning which says it's not supported in most of the browsers and marks it depreceted. That was not the problem, until I found that calling showModal() is giving me error:
Property 'showModal' does not exist on type HTMLDialogElement
Am I missing something?
Here is my code:
let elem: HTMLDialogElement = document.getElementById("dlg") as HTMLDialogElement;
elem.showModal(); // this line gives error
According to the type definitions (lib.dom.d.ts) for HTMLDialogElement there is no method showModal(). You could cast elem to any to make the TypeScript Transpiler accept it:
(elem as any).showModal()
However, you should not use deprecated APIs. If you are using Material with Angular you could use the MatDialog service instead.
HTMLDialogElement.showModal is available as of TypeScript 4.8.3.
Run npm install --save-dev typescript#4.8.3.

Upgraded to angular 9.1 - error is Property 'supportsDOMEvents'

Here is the issue
error TS2416: Property 'supportsDOMEvents' in type 'ɵangular_packages_platform_browser_p
latform_browser_o' is not assignable to the same property in base type 'ɵDomAdapter'.
As #DrTeeth already mentioned, it's hard to help w/o any further infos.
But I've had a similar problem and want to share what had helped for me: This was a simple inconsistency of my dependencies. I', using a 3rd party Angular Component Library which was incompatible with the newer (Ivy-enabled) version, after I updated Angular itself. For me, the error message had some details about the package in question and after updating it, too, everything worked fine.

Blazor WebAssembly JsonException: A possible object cycle was detected which is not supported

I get this error because I have circular references defined in my object model. My question is, is there any way to resolve this using one of the following two options?
Using Newtonsoft.Json and options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
Using System.Text.Json and options.JsonSerializerOptions.ReferenceHandler = System.Text.Json.Serialization.ReferenceHandler.Preserve;
I'm not seeing a way to switch to Newtonsoft.Json in a Blazor WebAssembly application and I tried implementing option 2 in the ConfigureServices function of Startup.cs in my Server project but I still kept getting the error.
I'm just trying to find a solution that doesn't require me redefining my object model. The JsonIgnore attribute does not appear to be an option either because I assume, and it appears, that then any fields I define it on do not exist in the Json on the client which breaks my application.
Update: I found this site which looks to me like discusses exactly what I'm referring to here and how to implement the solution but I have not got it to work yet. If anyone is successfully using Blazor WebAssembly with circular references in your object model please let me know what you're doing.
https://github.com/dotnet/aspnetcore/issues/28286
Thank you for pointing out this error in Blazor. I found the answer in the issue you mentioned (this comment). You need to change json options also on the Client side. This works for me:
On server
services.AddControllersWithViews().AddJsonOptions(options =>
{
options.JsonSerializerOptions.ReferenceHandler = System.Text.Json.Serialization.ReferenceHandler.Preserve;
options.JsonSerializerOptions.PropertyNamingPolicy = null;
});
On client
var response = await Http.GetFromJsonAsync<T>("{Address}", new JsonSerializerOptions
{
ReferenceHandler = System.Text.Json.Serialization.ReferenceHandler.Preserve,
PropertyNamingPolicy = null
});
To the two options you mentioned there is a third option available if you use .NET 6 or above.
Using System.Text.Json and options.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles;
Beware that ignoring cycles have issues on its own (such as data corruption) but if you were depending on it when you were using Newtonsoft.Json then you will be fine as it is basically the same behavior.
If you prefer to go with ReferenceHandler.Preserve, please share more info on what error you are getting and I can try to help you out.
One way to go about this is specify how much depth an object is allowed to have. Please see the documentation here regarding how to do this with System.Text.Json. I think this may help.

WriteMessageText() - example code compile error - error CS0103: The name 'Window' does not exist in the current context

I'm trying to create an application using the NFC (proximity) API on Windows Phone 8. When I copy the example code from the documentation, I get the following compile error...
error CS0103: The name 'Window' does not exist in the current context ...
This error is all over the internet and the common solution seems to be that it only works for native (or C++) code. However the documentation says that it works for managed or native code. How do I get the examples to work in my managed code?
In order to gain access to the active Windows.UI.Core.CoreDispatcher object, you simply need to request Windows.UI.Core.CoreWindow.GetForCurrentThread().Dispatcher.
ORIGINAL EXAMPLE CODE
// Write a message to MessageBlock on the UI thread.
private Windows.UI.Core.CoreDispatcher messageDispatcher =
Window.Current.CoreWindow.Dispatcher;
CORRECTED CODE
// Write a message to MessageBlock on the UI thread.
private Windows.UI.Core.CoreDispatcher dispatcher =
Windows.UI.Core.CoreWindow.GetForCurrentThread().Dispatcher;
The one small change makes all the examples work! Enjoy.