How to refresh Radio button on multipage jquerymobile - android

Is there any example on refreshing the radio-buttons value, that exist on one page and their value is changed from other page.
I have tried the following but its not working. [ using phonegap+jquerymobile+HTML5 ]
The following is the jquerymobile syntax called by the main page while the radio buttons exist on page2:-
if (result.rows.item(0).pri==0)
{
$('#radio2').prop('checked', true);
}
else {
$('input:radio[id=radio3]').prop('checked', true);
}
$("input[type='radio']").checkboxradio();
$("input[type='radio']").checkboxradio("refresh");
getting the following error on eclipse Android development studio
cannot call refresh before page initialization.
any suggestions??

you may need to regenerate the widgets (the form element) by .triger("create")
Detail please refer Enhancing new markup from http://demos.jquerymobile.com/1.2.0/docs/pages/page-scripting.html

Related

Android flutter's flutter_webview_plugin plugin's webview shows loading indicator and nothing else

I have been building a flutter android app with flutter_webview_plugin. My problem is when I use back button of android phone the web view rather than closing shows the loading indicator and nothing else.
To solve this problem we will have to listen both the webview's onDestroy status and navigator's pop-ability and then we will pop the webview route (screen).
To do this we will just write this code within the build method where the WebviewScaffold is returned.
flutterWebviewPlugin.onDestroy.listen((_){
if(Navigator.canPop(context)){
Navigator.of(context).pop();
}
});
Problem solved :)
note flutterWebviewPlugin is an object of FlutterWebviewPlugin declared out of the build method.

Iconize Xamarin with Fontawesome

I'm new to Xamarin and I'm trying to use the Iconize NuGet package for Xamarin, but I'm not having much luck. At the moment I'm working with a simple Android app. I've installed Iconize per the instructions and, save for an error on the line:
FormsPlugin.Iconize.Droid.IconControls.Init(Resource.Id.toolbar, Resource.Id.tabs);
(the compiler didn't like the Resource.Id.toolbar or Resource.Id.tabs so I removed it) everything compiles and runs. However, when I try to add an IconButton with a Fontawesome image, I get "System.NullReferenceException: Object reference not set to an instance of an object." error that points back to
the line LoadApplication( new App() ); in the MainActivity.cs.
I'm trying to add the IconButton to a grid in code (not XAML) using
grid.Children.Add( new IconButton
{
Image = "fa-info-circle"
}, 3, 2 );
Any ideas on how to make this work? The examples on the Iconize page haven't been very useful and I haven't found any examples on Google.
Okay I finally found something that was useful. I found a clue on this page and some other information on the project issues page on Github.
Ultimately, to get the icon to display I used
grid.Children.Add( new IconButton
{
Text = "fa-info-circle",
}, 3, 2 );
It was the Text property and not the Image property that I should have used.
Hope this helpful to someone else.

Xamarin,Android How to navigate between two axml pages

I have an axml page called Main.axml and a MainActivity.cs file ,i collect values from textbox in axml page and update it in database using web services after updating the database i want to move to a an axml page which just displays the text "Thank you for entering the data".Can anyone please tell how to navigate to another axml page from MainActivity.cs
i tried this in windows mobile app ,but it is not working for Xamarin android :
this.NavigationService.Navigate(new Uri("/Thanks.xaml", UriKind.RelativeOrAbsolute));
Thanks #Artur Shamsutdinov for the link to the article.For anyone who wants to skip reading the article .Please find below the code we have to use in our Activity Page,
var intent = new Intent(this, typeof(ThankyouActivity));
StartActivity(intent);
in ThankYouActivity.cs we can use this code to show the axml page,which will then show thankyou.axml on screen
SetContentView(Resource.Layout.thankyou);
You can also use the following short way:
StartActivity(typeof(ThankyouActivity));
You can use it:
Button thankYou = FindViewById<Button>(Resource.Id.btnThankYou);
thankYou.Click += delegate { StartActivity(typeof(ThankYouActivity)); };

Appcelerator Alloy Android -Cannot add window/tabGroup to another window/tabGroup

I have an app which works in IOS 6. I am trying to get it to work on basically any andriod version.
I have an index controller and view which load fine.
I can load the register page but when I bypass the register page. It works fine in IOS but not Android. I am not using tabgroups just windows.
Any ideas ? NOTE I can't get the full xml tags to load in code view which is why there are no brackets.
I get this error:
new Error("Cannot add window/tabGroup to another window/tabGroup.");
Index Controller
if (!isRegistered) {
var register = Alloy.createController( 'register' );
register.getView().open();
}
else {
var main = Alloy.createController( 'main' );
Alloy.Globals.mainController = main;
}
index view
Alloy
Window id="index"
Require type="view" src="slider" id="slider"
Window
Alloy
main js controller
// code above
$.main.open();
// code below
main view
Alloy
Window id="index"
View id="loadingOverlay" /
View id="main"
ImageView id="background" image="/images/background.jpg"/
Require type="view" src="slider" id="slider" /
/OptionDialog
/View
/Window
/Alloy
Thanks,
the error messag explains it
new Error("Cannot add window/tabGroup to another window/tabGroup.");
hard to tell what is going on here, you might need to add a gist or pastebin, but a window cannot contain another window

localStorage with Jquery Mobile works only 1 time on a new Android system

I am using the localstorage option to set a variable for using it in another page.The platform is Android
Just to simulate the problem, i just created 2 simple JQM pages and set the variable in page 1 and use it in page 2. That works fine for the first time. When i'm going back to page 1 and set a new value for the variable, page 2 tells me that it is the previous value(!). I'm a little bit lost how to use it. Can someone give me a clue how to manage this? The weird thing is that on an old Android version (like 2.3.3) it works fine, but on a new one (like > 4) it fails. I think it has something to do with ready() event?
Page 1 - Main page:
$(document).ready(function () {
$('#Klant_Lijst').delegate('li', 'click', function () { var x = $(this).data('nummer'); localStorage.setItem("Nummer", x);});
});
Page 2 - sub page
$(document).ready(function () {
GetFustInfoKlant(localStorage.getItem('Nummer'));
});
I hope someone can give me an hint in a direction. Thanks!
Please dont use ready() method, use JQM page events like pageshow, pagecreate, pagebeforeshow, etc..

Categories

Resources