JavaFX 2.2 WebView - javafx-2

I am using Javafx and FXML . I have created my form . in one of my pages I have a Tree in the left pane (Split Pane) , and the right pain is a Webview inside the right Anchor pane.
when I select a node on the tree (treeItem) the webview will change accordingly to the respective site that was selected in the tree view.
This works (like a charm)when I run it as an application.
HOWEVER , when viewing this in the browser (i.e. chrome , firefox and safari(mac)) i dont see the web view , it stays blank. i.e. the UI will load and the tree will be there , but the right jand pain never shows the embedded views.
When I run as a webstart I see the right views. The web pages that are embedded into the web views have a login, when i try login the web page flicker , like ther refresh and the login form is blanked, I have to enter the credential again.
not sure what is wrong or how to debug the browser / webstart side.

when viewing this in the browser (i.e. chrome , firefox and safari(mac)) i dont see the web view , it stays blank. i.e. the UI will load and the tree will be there , but the right jand pain never shows the embedded views.
If you not done so already, you will need to sign your application to allow it to run outside of the browser embedded Java application sandbox so that the webview's network layer has permission to access the external locations.
Also monitor the webview loadworker's exception property to see if an exception or FAILED state was encountered:
Worker worker = webview.getEngine().getLoadWorker();
worker.stateProperty().addListener(new ChangeListener<Worker.State>() {
#Override public void changed(ObservableValue<? extends Worker.State> observableValue, Worker.State oldState, Worker.State newState) {
System.out.println("Browser state change: " + newState);
}
});
worker.exceptionProperty().addListener(new ChangeListener<Throwable>() {
#Override public void changed(ObservableValue<? extends Throwable> observableValue, Throwable oldThrowable, Throwable newThrowable) {
System.out.println("Browser encountered a load exception: " + newThrowable);
}
});
not sure what is wrong or how to debug the browser / webstart side.
There is an excellent Oracle article on debugging steps for webstart / browser embedded applications. The article provides numerous pointers such as how to set debug and trace levels, etc.

Related

how to integrate vserv ads sdk to windows phone 8 application

I have developed a windows phone 8 application. Now I want to display vserv ads to my application.
I have added the sdk to my application and also applied code to show ads:
public MainPage()
{
InitializeComponent();
VservAdControl VMB = VservAdControl.Instance;
VMB.DisplayAd(zoneID, LayoutRoot);
VMB.VservAdClosed += new EventHandler(VACCallback_OnVservAdClosing);
VMB.VservAdNoFill += new EventHandler(VACCallback_OnVservAdNoFill);
}
void VACCallback_OnVservAdClosing(object sender, EventArgs e)
{
MessageBox.Show("Ad close by user.");
}
void VACCallback_OnVservAdNoFill(object sender, EventArgs e)
{
if (adGrid != null)
adGrid.Visibility = Visibility.Collapsed;
}
But after closing the ad the application page goes blank, all content, application bar automatically goes blank. After using back arrow that quits my application, i try to relaunch my application but application stuck at the splash screen on the emulator.
Wrap ad control inside a grid. Ad control could have manipulated the grid
I encountered the same issue and they have updated their SDK several times. If you provide the stacktrace they will provide you a fix.
Apart from what you have seen, there are other issues with the SDK. I integrated it few weeks back. So issues could have been resolved after that.
Memory leak. Click the ad or navigate back and forth - you will see the memory ever growing. This is because of events not being detached (withing SDK). I was consistently able to see my app crash in 512 MB emulator when banner ad is loaded (after 4 - 5 times). They could have used weak listeners. You might need to tweak a lot to overcome this issue (In multi page app)
RequestAdCallback throws null pointer exception sometimes crashing
the app. When people use app, they will navigate fast - forcing the
webbrowser to unload. All callbacks should be null pointer exception
free. Make sure that you handle unhandled exception globally otherwise app will not pass certification
It reads WMAppManifest.xml as text not as XML. So I had App element commented in first line before the actual one. It picked title from commented XML element
Application bar is manipulated in many events in the SDK. So you have to make sure that app bar is built dynamically. Test all navigation paths.
SDK assumes user will click the left arrow button which fires ad closing event. Try pressing phone back button instead. The app bar still disappears
SDK documentation requests app to demand ID_CAP_REMOVABLE_STORAGE capability. I don't see a reason to request this capability but I didn't add this
I have emailed them all these details. May be their latest SDK could have resolved these issues. But please do thorough testing after integration.
Add a function to load applicationbar using code
private void BuildLocalizedApplicationBar()
{
// Set the page's ApplicationBar to a new instance of ApplicationBar.
ApplicationBar = new ApplicationBar();
ApplicationBar.Mode = ApplicationBarMode.Default;
ApplicationBar.Opacity = 1.0;
ApplicationBar.IsVisible = true;
ApplicationBar.IsMenuEnabled = false;
// Create a new button and set the text value to the localized string from AppResources.
ApplicationBarIconButton button1 = new ApplicationBarIconButton();
button1.IconUri = new Uri("/Images/sms.png", UriKind.Relative);
button1.Text = "sms";
ApplicationBar.Buttons.Add(button1);
}
and then in VACCallback_OnVservAdClosing event handler call the function
BuildLocalizedApplicationBar()
Please check the following link,
where to add application id and adUnitiD while integrating vserv ads sdk to windows phone 8 application, which is related to your question.

Windows phone app link

So - I want to make a windows phone app that links to my webpage when I open it - how do i do that? I have the SDK, and tried with the browser, but I can't seem to find anyway to set a homepage?
You could use the WebBrowser control, placing it on an otherwise empty page. This may allow you to fine tune the experience if wish.
But what would be even easier is to just use the WebBrowserTask. This would launch you right back out of your app and into OS's true browser experience. In the App.xaml.cs file, just add the following code:
private void PhoneApplicationService_Launching(object sender, LaunchingEventArgs e)
{
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.Uri = new Uri("http://my.superawesomewebsite.com", UriKind.Absolute);
webBrowserTask.Show();
}
You app will immediately launch the browser an you don't have to do anything else.

how to Zoom In/Out using Robotium?

i try to open web browser apk, open one web page.
is it possible to ZOOM IN/OUT of this web page using robotium ?
and i try to open one docx file using open Office apk automation using robotium.
is it possible to ZOOM IN/OUT for this document page using robotium ?
Any one have solution then please help me.
As far i know there is no functionality like that in Robotium.
For a web page you can use the zoomIn() method of a webview that you have gotten a reference to using any number of the ways you can with robotium.
To be able to use this method you will have to cast the view you got from robotium to a WebView and to perform the zoom you will have to run on the uithread. The code would look something like:
final WebView webView = (WebView) Solo.getView(R.id.web_views_id);
instrumentation.runOnMainSync(new Runnable() {
#Override
public void run() {
webView.zoomIn()
}
});

How to open webview in Blackberry?

How to open link in webview in Blackberry like iPhone and Android ?
Which should not be open in Browser ,it should be opening in Webview through application .
The Blackberry equivalent of a WebView is a BrowserField. Example code from this page:
import net.rim.device.api.browser.field2.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;
public class BrowserFieldDemo extends UiApplication
{
public static void main(String[] args)
{
BrowserFieldDemo app = new BrowserFieldDemo();
app.enterEventDispatcher();
}
public BrowserFieldDemo()
{
pushScreen(new BrowserFieldDemoScreen());
}
}
class BrowserFieldDemoScreen extends MainScreen
{
public BrowserFieldDemoScreen()
{
BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();
myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_POINTER);
BrowserField browserField = new BrowserField(myBrowserFieldConfig);
add(browserField);
browserField.requestContent("http://www.blackberry.com");
}
}
Options Icon -> Host Routing Tables -> Register Now
If the above instructions failed, try stepping through these instructions one by one
* Try getting your service books retransmitted.
a. Login to your BlackBerry Web Client (BWC/BIS) site.
b. Click "Profiles" (At the top of your BWC webpage via your PC)
c. Click "Send Internet Browser Service Book"
* Try rebooting your BlackBerry by removing and reinserting battery.
* Make sure you are running BlackBerryOS 4.0 by checking:
Check Options -> About
If you are not running at least Version 4.0, you need to download and install BlackBerryOS 4.0 then repeating all the above instructions again.
* If that does not work, and you are on a BlackBerry Enterprise Server (BES), try re-activating your BlackBerry on BES. This may be as simple as connecting your BlackBerry to your PC and synchronizing your BlackBerry while Outlook is in ONLINE mode.
I think that you are looking for the BrowserField UI component.

SharePoint QuickLaunch and TopNavigationBar dissapearing

I am completely puzzled with this:
I have a custom SharePoint site with QuickLaunch on the left and Top Navigation Bar (which are of course visible by default).
This custom site has several sub-sites, which all inherit navigation from the root site.
Everything works fine, but after application pool recycle both menus on the left and on top are disappearing when I enter any of the sites for the first time! After simple refresh everything is back to normal, all menus are visible.
After recreating the site and subsites they behave the same: on first visit - menus are not visible, after refresh they are visible and they stay visible until I make an application pool recycle.
Sometimes only one menu (top bar or quick launch) disappears and the second one is normally visible, and I also think I encountered a situation when it disappeared during normal using of the site, not after the recycle.
There is nothing in the EventLog. There is a trace in the ULS log, though. When quick launch or top bar disappears only one new line (yes, only this one, no stack trace or any further information) is added:
02/05/2010 10:24:19.18 w3wp.exe (0x171C) 0x17BC Windows SharePoint Services General 8kh7 High Cannot complete this action. Try again.
Well, indeed it says that something is wrong that is causing the menu to disappear. Can anyone help me how to diagnose this or maybe knows why these menus are disappearing?
Gylo do you have the Publishing feature enabled on those sites? This is a known situation when restoring saved site templates with publishing enabled (using a small hack) where the Top Navigation won't appear for the first time.
What version are you running? (Site Actions => Site Definitions shows it)
It may be that you messed with Navigation in site definition and removed Navigation Node with Id of 1002. This node is responsible for storing web Top Navigation, and even if your web uses shared navigation, you'll get disappearing navigation under some circumstances.
Check if your-web.Navigation.TopNavigationBar is null. If it is, that is not very simple to restore node #1002. Below is a patch I've written to fix this issue on production environment. Test it first!
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPSite site = properties.Feature.Parent as SPSite;
using (SPWeb web = site.OpenWeb("/information"))
{
if (web.Navigation.TopNavigationBar == null)
{
List<SPContentDatabase> contentdatabases = new List<SPContentDatabase>();
SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPNavigationNode node = new SPNavigationNode("", web.ServerRelativeUrl, false);
web.AllowUnsafeUpdates = true;
try
{
SPNavigationNodeCollection navigationNodes = null;
navigationNodes = web.Navigation.GlobalNodes;
navigationNodes.AddAsFirst(node);
}
finally
{
web.AllowUnsafeUpdates = false;
}
SPContentDatabase database = site.ContentDatabase;
using (SqlConnection con = new SqlConnection(database.DatabaseConnectionString))
{
con.Open();
using (SqlCommand command = con.CreateCommand())
{
command.CommandText = string.Format(#"UPDATE NavNodes
SET Url='', Eid={0}, ElementType=1, DocId=NULL
WHERE Eid={1}
and WebId='{2}'
and SiteId='{3}'",
1002,
node.Id,
web.ID.ToString(),
site.ID.ToString()
);
command.ExecuteNonQuery();
}
}
});
}
}
}

Resources