I'm trying to develop an application and am stuck at this specific part. I was previously taking a different approach through a web form displayed in UIWebView, but was having issues getting it to open how I wanted. I changed the UI and would now like to take this approach:
Background
User needs to be able to get directions to a specific shop location. The UI contains an instance of UIText Field and a round rect button. The User should be able to click the button and the default Maps application will pop up for the user.
How I imagine this being coded:
1) User enters address in textField
- textField stores address as variable (%var%)
2) User presses Go button
- Button adds variable (%var%) from textField to URL string (see below)
- Button submits full URL to be opened in Safari
3) Safari opens request in Maps application
Image Example of UI: http://i55.tinypic.com/vnjc41.jpg
http://maps.google.com/?saddr=%var%&daddr=123+Road+St%2C+Town%2C+CA+90210&hl=en
Found a better way to do this using a button to open the maps application:
-(IBAction)hbgdirButton:(id)sender{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://maps.google.com/maps?q=Harrisburg+PA&hl=en"]];
}
Related
I have a modal window that shows a panel which contains a form that has some textfields and a submit button
on submit an insert into the database occurs and then I have some ajax behaviour that i want to activate on the modal windows containing page on click of the button.
So flow is at present:
click link
modal window appears
user fills out form
user submits form
form data persisted to db
modal window closes
I need it to do this in addition:
activate some ajax behaviour on the page that contains the panel
any help on how best to do this in the wicket way is appreciated.
I resolved this by passing an instance of the page containing the panel to the panel (i.e. - in the constructor), then calling a method on the page from the panel to perform the Ajax update.
I would be interested to see what others have done or to hear if there are issues with the approach I have taken.
Set up a WindowClose callback.
In the WicketStuff project called ModelX (Disclaimer: I'm the developer of that) I have created an IWindowClosedListener interface which has a method:
void windowClosed(Panel panel, AjaxRequestTarget target)
So then any Page or Panel that can open a modal that needs to do something when that modal is closed simply implements that interface and its windowClosed method gets called at the right time.
I built a google gui web app that has basically two gui screens. The first gui screen has some text entry fields and when the user clicks 'submit' it should pull up the second gui screen displaying some results.
my second gui starts off the same as the first:
function displayForm2(hwEntered){
var app = UiApp.createApplication().setHeight('800').setWidth('600');;
var panel = app.createVerticalPanel();
...code and stuff...
app.add(panel);
return app;
}
How do I make it work as a web app?
You should build your 2 GUI in the same Ui instance but on 2 separate panels inside a single vertical panel. Then you just have to setVisible(true) one panel while you setVisible(false) the other one... you can do that either with client handler or server handler, a matter of choice but the client handler is faster and simpler if the button doesn't have other function.
The 'parent panel' (vertical or horizontal) will ensure that each panel will show up at the same place in your display.
You should easily find some explicit examples on this forum
I am developing an IOS application with phonegap and need to set local notification for it
Once user click on "view" button need to transfer the apps control to user specified page other than "index.html"
Since PhoneGap doesn't include currently this functionality, I'll assume your are using the LocalNotification plugin from Greg Allen & Drew Dahlman.
If you notice when you make the call to register the notification: plugins.localNotification.add() there are 2 parameters: "background" and "foreground" that contain javascript code to run when the app gets notified (in your case because it was in the background and you hit the "View" button).
Now, instead of using "app.background()" as in the example, you could pass there a Javascript code that navigates to the page you want to (or place your code in the background() function of the "app" object by editing the plugin file init.js.
For this to work make sure you have the implementation of the method didReceiveLocalNotification that comes with the plugin in the their modified AppDelegate.m class.
I am trying to open a control panel in FANCYBOX.
I have a form in my page which its action and field names are same as another website and once user submit it they will redirect to their control panel in that website in a new window.
What I want is to open it in fancybox. I do not want to user leave my page, I just want them to access to that panel inside my website.
And also I want to all links of the opened frame target be _parent. I mean if they go to different parts of their panel it shows in the same fancybox not open a new window.
You might wanna look at iframe i.e. Add class='iframe' to a link check it on this page.
i am creating a small document based application. In that i need to start with a login page i.e., when the application launches, the login page should appear first(which should not be document based). When i am running the application right now, myDocument.xib is loaded. Is there any way by which i can load the login window first instead of the myDocument.xib? I tried to change the MyDocument.xib to make it the login page.But then i get "Untitled" at the very first login page.. i am quite stuck at this point..pls help..i am relatively new to cocoa!
Make a new class, add an instance of it to MainMenu.xib, connect the Application object’s delegate outlet to your instance, then implement the applicationShouldOpenUntitledFile: method. Return NO from that method and your application will only open an untitled document when the user specifically asks for it.
As for the login window, just add a new window to MainMenu.xib and set it to be visible on launch. Place whatever logic you need for that window in your app delegate.