I also posted this as a NativeScript issue, but nobody seems to care up there so far.
I hope somebody might have a workaround for this issue.
RadDataForm does not bind properly on iOS when navigating back to the component with the form. After navigating back, you can change values in the form fields, but these values aren't propagated into the source object.
To Reproduce
Open the playground project: Fill a value on "test" and click "Test" to verify. Then click "Next" to navigate away. Then click "back" and try to update the value on "test", the binding is now gone and "Test" (or anything else) won't update the value of the source variable anymore.
Expected behavior
Source variable should be updated after navigating back to the form and changing values.
Sample project
https://play.nativescript.org/?template=play-ng&id=vwLAH9&v=3
Issue Nativescript: https://github.com/NativeScript/nativescript-ui-feedback/issues/1350
I had a peek and looks the the native iOS delegate is set to null when the DataForm is unloaded but it's not being set back on loaded event, that stops event the events on the form after back navigation. A simple workaround is setting the delegate on loaded event.
onDataFormLoaded(event) {
const dataForm = event.object;
if (dataForm._ios && dataForm._nativeDelegate && !dataForm._ios.delegate) {
dataForm._ios.delegate = dataForm._nativeDelegate;
}
}
Updated Playground
Related
I created a MapView and a SearchBar in a .xib file. I loaded the xib file into a ViewController was testing it in the simulator. The MapView works as it should, but the SearchBar doesn't register any input. Whatever key I press on my keyboard, the SearchBar just shows my cursor and the placeholder text. I used the SearchBar in another project to see if it works there and it does. I can type whatever I want to in there.
I don't know why it doesn't work in my loaded .xib file. Doesn't it work in .xib? I also cleaned and rebuild everything and made sure that user interaction is enabled. I enabled it in code and Xcode.
Here are my attributes for the SearchBar from Xcode. I think everything is right but maybe it helps.
Any ideas?? Thanks in advance!
Edit:
I found out that I'm not only unable to make an input, but also can't add (or see) a scope bar to the SearchBar. Again, I could add it in another project but not in this current one. No matter if the scope bar is enabled or disabled, I can't see it when I click on the SearchBar.
It turns out that I had a problem in my SceneDelegate. I still don't understand why and how this error occurred but I somehow missed this in my SceneDelegate:
this.Window = new UIWindow(scene as UIWindowScene);
If you are experiencing the same issue or want to know why, here's another question I've found with the working solution
If I have Navigation made like this:
Home -> Process -> Add a thing -> Success
and from Success Page you can start process again. Let's say you're doing this 20 times and then you're clicking back button. You will be backing through all 20 processes made. starting a new process with clearHistory: true will remove back button from Process page. Is there a clean way to fix this and make Process back button go to Home?
You could use backstackVisible boolean property - documentation example here. When navigation with the property set to false the entry won't become a part of the navigation stack and as a result, the backward navigation will skip this page. API reference here.
Note: This property is currently supported only in NativeScript Core (won't work in Angular based project)
I have a WebView, which gets a HtmlWebViewSource as content:
this.webView.Source = new HtmlWebViewSource
{
Html = "<p>some html string</p><a href='http://www.google.com'>External link</a>",
};
If I navigate away (by clicking on an external link added to the content before) and then call GoBack() I get an empty white screen. It seems that the source is overwritten by clicking on the link.
Because the content I show isn't 100% static, I can't use a local html page as an URL. What should I do? I tried to set the BaseUrl without success. Furthermore, I thought I can use OnAppearing() or the Navigated event, to reload my initial content, but the events are not realiable called as I would expect.
Caveat: I've only tested this with Android (simulator and device).
PS: Other things I encountered:
Loading a page (through clicking on the external link) seems sometimes to work and sometimes not on the simulator (and it takes too much time).
CanGoBack is only true if the page has been fully loaded. Otherwise you get false, despite the content is already shown on the screen (but not fully loaded).
Navigated seems to be called too late (e.g. the page was popped off already).
Checking for CanGoBack in Navigated is not really possible, because of the different async times.
Navigating back seems not to be a good idea at all. Because of the here described issues it is not possible to include a back button, which reliably first navigates back if possible and finally dismisses the page.
WebView doesn't open a PDF file, when linked to
first i use the PAGGING library
https://github.com/uacaps/PageMenu
i found that it's the problem , when i connect any button to show another controller it it navigate me to that controller but the navigation not shown , for example back button
i try many solutions and non of them work for example i try to make the menu manual but the back button show but not work
i create button and connect to this action
self.navigationController?.popViewControllerAnimated(true)
didn't work
You need to have a pushViewController first. Ensure that you are displaying your viewcontrollers through push.
self.navigationController?.pushViewControllerAnimated(true)
You do not need to code anything to display the previous controller when you have push.
In CKEditor, is there an event that can be bound to which fires when the user switches between the WYSIWYG view and the source view?
If not, I need to enable/disable some other controls on the page when the view changes; what's my best strategy?
I'm still unable to find any documentation, but after poking around the internals of a CKEditor instance, I was able to find the event I'm looking for:
instance.on('mode', function() { // Code to execute when the user switches editing modes}
Easy enough. The event fires once when the editor is initialized and again any time the source command is activated (either through instance.execCommand(...) or the user clicking a Source toolbar button).
I have an older version and solved this with
CKEDITOR.instances['terms_and_conditions'].on('mode', function() {
console.log(this.mode); // outputs: source, wysiwyg
});