Trying to load an FXML file in Eclipse and continue to get exceptions. Here is my main:
package application;
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
static Tracker money = new Tracker(0,0,0);
static Tracker steel = new Tracker(0,0,0);
static Tracker titanium = new Tracker(0,0,0);
static Tracker plant = new Tracker(0,0,0);
static Tracker power = new Tracker(0,0,0);
static Tracker heat = new Tracker(0,0,0);
public static void main(String[] args) {
Application.launch(args);
}
#Override
public void start(Stage primaryStage){
try {
FXMLLoader loader = new FXMLLoader(Main.class.getResource("board.fxml"));
Parent root = (Parent) loader.load();
primaryStage.setScene(new Scene(root));
primaryStage.show();
} catch(NullPointerException e)
{
System.out.print("NullPointerException Caught");
e.printStackTrace();
}catch(IOException e) {
System.out.print("IOException Caught");
e.printStackTrace();
}
}
public static void nextGen() {
money.produce();
steel.produce();
titanium.produce();
plant.produce();
power.produce();
heat.produce();
}
public static void change() {
money.change();
steel.change();
titanium.change();
plant.change();
power.change();
heat.change();
}
}
I did the separate catches to see what is actually happening for Exceptions as I thought it was NullPointer at first (may still be that if a null val into the loader would give that) but the catch is happening with the IOException. I don't really know where to go from here, just would like some guidance.
EDIT
Added e.printStackTrace() per suggestion:
IOException Caughtjavafx.fxml.LoadException:
/C:/Users/pcher/eclipse-workspace/board/bin/application/board.fxml:8
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2707)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:933)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:981)
at javafx.fxml/javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:230)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:755)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2808)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2634)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2516)
at board/application.Main.start(Main.java:27)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassNotFoundException: application.BoardCo
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:931)
... 17 more
Here is the FXML:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<TitledPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" text="Terraforming Mars Tracker" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.BoardCo">
<content>
<GridPane prefHeight="388.0" prefWidth="598.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="154.0" minHeight="154.0" prefHeight="154.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="154.0" minHeight="154.0" prefHeight="154.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="113.0" minHeight="0.0" prefHeight="41.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TitledPane animated="false" text="Money">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutX="-1.0" layoutY="-2.0" prefHeight="130.0" prefWidth="194.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TextField editable="false" text="Production:" GridPane.rowIndex="1" />
<TextField editable="false" text="Change:" GridPane.rowIndex="2" />
<TextField editable="false" text="Total:" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField editable="false" GridPane.columnIndex="1" />
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
<TitledPane animated="false" text="Steel" GridPane.columnIndex="1">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutY="-1.0" prefHeight="130.0" prefWidth="194.0">
<children>
<TextField editable="false" text="Production:" GridPane.rowIndex="1" />
<TextField editable="false" text="Change:" GridPane.rowIndex="2" />
<TextField editable="false" text="Total:" />
<TextField editable="false" GridPane.columnIndex="1" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
<TitledPane animated="false" text="Titanium" GridPane.columnIndex="2">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutY="-1.0" prefHeight="130.0" prefWidth="194.0">
<children>
<TextField editable="false" text="Production:" GridPane.rowIndex="1" />
<TextField editable="false" text="Change:" GridPane.rowIndex="2" />
<TextField editable="false" text="Total:" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField editable="false" GridPane.columnIndex="1" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
<TitledPane animated="false" text="Plant" GridPane.rowIndex="1">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutY="-1.0" prefHeight="130.0" prefWidth="194.0">
<children>
<TextField editable="false" text="Production:" GridPane.rowIndex="1" />
<TextField editable="false" text="Change:" GridPane.rowIndex="2" />
<TextField editable="false" text="Total:" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField editable="false" GridPane.columnIndex="1" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
<TitledPane animated="false" text="Power" GridPane.columnIndex="1" GridPane.rowIndex="1">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutY="-1.0" prefHeight="130.0" prefWidth="194.0">
<children>
<TextField editable="false" text="Production:" GridPane.rowIndex="1" />
<TextField editable="false" text="Change:" GridPane.rowIndex="2" />
<TextField editable="false" text="Total:" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField editable="false" GridPane.columnIndex="1" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
<TitledPane animated="false" text="Heat" GridPane.columnIndex="2" GridPane.rowIndex="1">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutY="-1.0" prefHeight="130.0" prefWidth="194.0">
<children>
<TextField editable="false" text="Production:" GridPane.rowIndex="1" />
<TextField editable="false" text="Change:" GridPane.rowIndex="2" />
<TextField editable="false" text="Total:" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField editable="false" GridPane.columnIndex="1" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
<Button mnemonicParsing="false" onAction="#btnNextGenClicked" text="Next Generation" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<Button mnemonicParsing="false" onAction="#btnChangeClicked" text="Change" GridPane.columnIndex="1" GridPane.rowIndex="2" />
</children>
</GridPane>
</content>
</TitledPane>
And here is my controller (bare bones at the moment):
package application;
import javafx.fxml.FXML;
import javafx.event.ActionEvent;
public class BoardController {
// Event Listener on Button.onAction
#FXML
public void btnNextGenClicked(ActionEvent event) {
Main.nextGen();
}
// Event Listener on Button.onAction
#FXML
public void btnChangeClicked(ActionEvent event) {
Main.change();
}
}
Related
I am trying to run the code of that is taken directly from primefaces website, but i am getting an error of UIInstructions cannot be cast to org.primefaces.model.menu.MenuElement
/This is my AddUser.xhtml code/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
>
<h:head>
<title>Getting User Information</title>
</h:head>
<h:body>
<h:form>
<p:menubar>
<p:submenu label="File" icon="ui-icon-document">
<p:submenu label="New" icon="ui-icon-contact">
<p:menuitem value="Project" url="#" />
<p:menuitem value="Other" url="#" />
</p:submenu>
<p:menuitem value="Open" url="#" />
<p:separator />
<p:menuitem value="Quit" url="#" />
</p:submenu>
<p:submenu label="Edit" icon="ui-icon-pencil">
<p:menuitem value="Undo" url="#" icon="ui-icon-arrowreturnthick-1-w" />
<p:menuitem value="Redo" url="#" icon="ui-icon-arrowreturnthick-1-e" />
</p:submenu>
<p:submenu label="Help" icon="ui-icon-help">
<p:menuitem value="Contents" url="#" />
<p:submenu label="Search" icon="ui-icon-search">
<p:submenu label="Text">
<p:menuitem value="Workspace" url="#" />
</p:submenu>
<p:menuitem value="File" url="#" />
</p:submenu>
</p:submenu>
<p:submenu label="Actions" icon="ui-icon-gear">
<p:submenu label="Ajax" icon="ui-icon-refresh">
<p:menuitem value="Save" actionListener="#{menuView.save}" icon="ui-icon-disk" update="messages"/>
<p:menuitem value="Update" actionListener="#{menuView.update}" icon="ui-icon-arrowrefresh-1-w" update="messages"/>
</p:submenu>
<p:submenu label="Non-Ajax" icon="ui-icon-newwin">
<p:menuitem value="Delete" actionListener="#{menuView.delete}" icon="ui-icon-close" update="messages" ajax="false"/>
</p:submenu>
</p:submenu>
<p:menuitem value="Quit" url="http://www.primefaces.org" icon="ui-icon-close" />
<f:facet name="options">
<p:inputText style="margin-right:10px" placeholder="Search"/>
<p:commandButton type="button" value="Logout" icon="ui-icon-extlink" />
</f:facet>
</p:menubar>
</h:form>
</h:body>
</html>
/This is my web.xml file/
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>UserWebApp</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
<url-pattern>*.xhtml</url-pattern>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>afterdark</param-value>
</context-param>
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/my.taglib.xml</param-value>
</context-param>
</web-app>
/And my jar file is also placed in webInf/lib/
I have tried everything available online but still unable o solve it
Thanks in advance
I figured out the problem. I was copying the MenuBar code directly from primefaces website (https://www.primefaces.org/showcase/ui/menu/menubar.xhtml)
And then i realized that there are invisible characters/stuff present between each line of code. (i figured this out when i copied/paste java class code),
once these invisible stuff id deleted and my code works perfectly.
/Following code is also the primefaces website code but free of invisible characters/
<h:form>
<p:growl id="messages"/>
<p:menubar>
<p:submenu label="File" icon="ui-icon-document">
<p:submenu label="New" icon="ui-icon-contact">
<p:menuitem value="Project" url="#" />
<p:menuitem value="Other" url="#" />
</p:submenu>
<p:menuitem value="Open" url="#" />
<p:separator />
<p:menuitem value="Quit" url="#" />
</p:submenu>
<p:submenu label="Edit" icon="ui-icon-pencil">
<p:menuitem value="Undo" url="#" icon="ui-icon-arrowreturnthick-1-w" />
<p:menuitem value="Redo" url="#" icon="ui-icon-arrowreturnthick-1-e" />
</p:submenu>
<p:submenu label="Help" icon="ui-icon-help">
<p:menuitem value="Contents" url="#" />
<p:submenu label="Search" icon="ui-icon-search">
<p:submenu label="Text">
<p:menuitem value="Workspace" url="#" />
</p:submenu>
<p:menuitem value="File" url="#" />
</p:submenu>
</p:submenu>
<p:submenu label="Actions" icon="ui-icon-gear">
<p:submenu label="Ajax" icon="ui-icon-refresh">
<p:menuitem value="Save" actionListener="#{menuView.save}" icon="ui-icon-disk" update="messages"/>
<p:menuitem value="Update" actionListener="#{menuView.update}" icon="ui-icon-arrowrefresh-1-w" update="messages"/>
</p:submenu>
<p:submenu label="Non-Ajax" icon="ui-icon-newwin">
<p:menuitem value="Delete" actionListener="#{menuView.delete}" icon="ui-icon-close" update="messages" ajax="false"/>
</p:submenu>
</p:submenu>
<p:menuitem value="Quit" url="http://www.primefaces.org" icon="ui-icon-close" />
<f:facet name="options">
<p:inputText style="margin-right:10px" placeholder="Search"/>
<p:commandButton type="button" value="Logout" icon="ui-icon-extlink" />
</f:facet>
</p:menubar>
</h:form>
This error can happen also for using HTML comments inside <p:contextmenu> between <p:menuitem>, which cause the error
UIInstructions cannot be cast to org.primefaces.model.menu.MenuElement
<p:contextmenu ...>
<!-- Menu Item XYZ -->
<p:menuitem ...>
I've read a fair amount on this issue but nothing seems to be working.
So far I have made sure that the StoreGeneratedPattern Identity is on two tables. I checked the model AND store. Both have the property set. However, when I insert into these tables, both ids are '0'.
I hope that someone familiar with these issues can take a look and tell me where I've got it wrong
Thanks
Here is the generated xml (irrelevant tables removed):
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
<!-- EF Runtime content -->
<edmx:Runtime>
<!-- SSDL content -->
<edmx:StorageModels>
<Schema Namespace="rule_testModel.Store" Provider="MySql.Data.MySqlClient" ProviderManifestToken="5.7" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
<Key>
<PropertyRef Name="RateId" />
<PropertyRef Name="RateTypeId" />
<PropertyRef Name="PaymentPlanId" />
<PropertyRef Name="TariffDescriptionId" />
<PropertyRef Name="FeatureId" />
<PropertyRef Name="FuelId" />
<PropertyRef Name="Live" />
</Key>
<Property Name="RateId" Type="uint" Nullable="false" />
<Property Name="Profile" Type="uint" />
<Property Name="REC" Type="varchar" MaxLength="10" />
<Property Name="PlanName" Type="varchar" MaxLength="300" />
<Property Name="RateTypeId" Type="uint" Nullable="false" />
<Property Name="PaymentPlanId" Type="uint" Nullable="false" />
<Property Name="Product" Type="varchar" MaxLength="45" />
<Property Name="ContractDuration" Type="varchar" MaxLength="45" />
<Property Name="TariffDescriptionId" Type="uint" Nullable="false" />
<Property Name="TariffUnrestricted" Type="decimal" Precision="6" Scale="3" />
<Property Name="TariffDay" Type="decimal" Precision="6" Scale="3" />
<Property Name="TariffNight" Type="decimal" Precision="6" Scale="3" />
<Property Name="TariffEveningWeekend" Type="decimal" Precision="6" Scale="3" />
<Property Name="StandingChargePenceDay" Type="decimal" Precision="6" Scale="3" />
<Property Name="StandingChargeGBPQuarter" Type="decimal" Precision="6" Scale="3" />
<Property Name="StandingChargeGBPMonth" Type="decimal" Precision="6" Scale="3" />
<Property Name="StandingChargeGBPYear" Type="decimal" Precision="6" Scale="3" />
<Property Name="CapacityCharge" Type="decimal" Precision="7" Scale="3" />
<Property Name="FeatureId" Type="uint" Nullable="false" />
<Property Name="FromCon" Type="uint" />
<Property Name="ToCon" Type="uint" />
<Property Name="Version" Type="varchar" MaxLength="45" />
<Property Name="PriceType" Type="varchar" MaxLength="45" />
<Property Name="Duration" Type="uint" />
<Property Name="SupplierId" Type="uint" />
<Property Name="FuelId" Type="uint" Nullable="false" />
<Property Name="ProposedStartDate" Type="date" />
<Property Name="SignWindow" Type="uint" />
<Property Name="DateAdded" Type="datetime" Precision="0" StoreGeneratedPattern="Identity" />
<Property Name="Live" Type="uint" Nullable="false" />
<Property Name="MaxRate" Type="decimal" Precision="6" Scale="3" />
<Property Name="MaxSc" Type="decimal" Precision="6" Scale="3" />
<Property Name="UpStep" Type="decimal" Precision="6" Scale="3" />
</EntityType>
<EntityType Name="conditions">
<Key>
<PropertyRef Name="ConditionId" />
</Key>
<Property Name="ConditionId" Type="uint" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="ProductId" Type="uint" Nullable="false" />
<Property Name="Profile" Type="usmallint" />
<Property Name="REC" Type="varchar" MaxLength="10" />
<Property Name="RateTypeId" Type="uint" />
<Property Name="PaymentPlanId" Type="uint" />
<Property Name="FeatureId" Type="uint" />
<Property Name="FromCon" Type="uint" />
<Property Name="ToCon" Type="uint" />
<Property Name="Duration" Type="uint" />
<Property Name="SupplierId" Type="uint" />
<Property Name="FuelId" Type="uint" />
<Property Name="live" Type="bool" />
<Property Name="TempRateId" Type="uint" />
</EntityType>
<EntityType Name="products">
<Key>
<PropertyRef Name="ProductId" />
</Key>
<Property Name="ProductId" Type="uint" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="RateId" Type="uint" />
<Property Name="FromProductId" Type="uint" />
<Property Name="ServiceRef" Type="uint" />
<Property Name="UpCom" Type="decimal" Precision="6" Scale="3" />
<Property Name="UpSC" Type="decimal" Precision="6" Scale="3" />
<Property Name="FixedCom" Type="decimal" Precision="8" Scale="3" />
<Property Name="Live" Type="bool" Nullable="false" />
<Property Name="BrokerId" Type="uint" />
<Property Name="MaxRate" Type="decimal" Precision="6" Scale="3" />
<Property Name="MaxSC" Type="decimal" Precision="6" Scale="3" />
<Property Name="Step" Type="decimal" Precision="6" Scale="3" />
<Property Name="Fits" Type="decimal" Precision="6" Scale="3" />
<Property Name="Disc" Type="decimal" Precision="6" Scale="3" />
<Property Name="UpliftTypeId" Type="uint" Nullable="false" />
<Property Name="SupplierId" Type="uint" Nullable="false" />
<Property Name="FromCon" Type="uint" />
<Property Name="ToCon" Type="uint" />
</EntityType>
<Key>
<PropertyRef Name="word_id" />
</Key>
<Property Name="word_id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="word_context" Type="varchar" MaxLength="45" Nullable="false" />
<Property Name="word_word" Type="varchar" MaxLength="255" Nullable="false" />
</EntityType>
<EntityContainer Name="rule_testModelStoreContainer">
<EntitySet Name="conditions" EntityType="Self.conditions" Schema="rule_test" store:Type="Tables" />
<EntitySet Name="products" EntityType="Self.products" Schema="rule_test" store:Type="Tables" />
</EntityContainer>
</Schema></edmx:StorageModels>
<!-- CSDL content -->
<edmx:ConceptualModels>
<Schema Namespace="rule_testModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
<EntityContainer Name="eBroker2Entities" annotation:LazyLoadingEnabled="true">
<EntitySet Name="products" EntityType="rule_testModel.product" />
<EntitySet Name="conditions" EntityType="rule_testModel.condition" />
</EntityContainer>
<EntityType Name="product">
<Key>
<PropertyRef Name="ProductId" />
</Key>
<Property Name="ProductId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="RateId" Type="Int32" />
<Property Name="FromProductId" Type="Int32" />
<Property Name="ServiceRef" Type="Int32" />
<Property Name="UpCom" Type="Decimal" />
<Property Name="UpSC" Type="Decimal" />
<Property Name="FixedCom" Type="Decimal" />
<Property Name="Live" Type="Boolean" Nullable="false" />
<Property Name="BrokerId" Type="Int32" />
<Property Name="MaxRate" Type="Decimal" />
<Property Name="MaxSC" Type="Decimal" />
<Property Name="Step" Type="Decimal" />
<Property Name="Fits" Type="Decimal" />
<Property Name="Disc" Type="Decimal" />
<Property Name="UpliftTypeId" Type="Int32" Nullable="false" />
<Property Name="SupplierId" Type="Int32" Nullable="false" />
<Property Name="FromCon" Type="Int32" />
<Property Name="ToCon" Type="Int32" />
</EntityType>
<EntityType Name="condition">
<Key>
<PropertyRef Name="ConditionId" />
</Key>
<Property Name="ConditionId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="ProductId" Type="Int32" Nullable="false" />
<Property Name="Profile" Type="Int32" />
<Property Name="REC" Type="String" MaxLength="10" FixedLength="false" Unicode="false" />
<Property Name="RateTypeId" Type="Int32" />
<Property Name="PaymentPlanId" Type="Int32" />
<Property Name="FeatureId" Type="Int32" />
<Property Name="FromCon" Type="Int32" />
<Property Name="ToCon" Type="Int32" />
<Property Name="Duration" Type="Int32" />
<Property Name="SupplierId" Type="Int32" />
<Property Name="FuelId" Type="Int32" />
<Property Name="live" Type="Boolean" />
<Property Name="TempRateId" Type="Int32" />
</EntityType>
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
<edmx:Mappings>
<Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
<EntityContainerMapping StorageEntityContainer="rule_testModelStoreContainer" CdmEntityContainer="eBroker2Entities">
<EntitySetMapping Name="products">
<EntityTypeMapping TypeName="rule_testModel.product">
<MappingFragment StoreEntitySet="products">
<ScalarProperty Name="ToCon" ColumnName="ToCon" />
<ScalarProperty Name="FromCon" ColumnName="FromCon" />
<ScalarProperty Name="SupplierId" ColumnName="SupplierId" />
<ScalarProperty Name="UpliftTypeId" ColumnName="UpliftTypeId" />
<ScalarProperty Name="Disc" ColumnName="Disc" />
<ScalarProperty Name="Fits" ColumnName="Fits" />
<ScalarProperty Name="Step" ColumnName="Step" />
<ScalarProperty Name="MaxSC" ColumnName="MaxSC" />
<ScalarProperty Name="MaxRate" ColumnName="MaxRate" />
<ScalarProperty Name="BrokerId" ColumnName="BrokerId" />
<ScalarProperty Name="Live" ColumnName="Live" />
<ScalarProperty Name="FixedCom" ColumnName="FixedCom" />
<ScalarProperty Name="UpSC" ColumnName="UpSC" />
<ScalarProperty Name="UpCom" ColumnName="UpCom" />
<ScalarProperty Name="ServiceRef" ColumnName="ServiceRef" />
<ScalarProperty Name="FromProductId" ColumnName="FromProductId" />
<ScalarProperty Name="RateId" ColumnName="RateId" />
<ScalarProperty Name="ProductId" ColumnName="ProductId" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="conditions">
<EntityTypeMapping TypeName="rule_testModel.condition">
<MappingFragment StoreEntitySet="conditions">
<ScalarProperty Name="TempRateId" ColumnName="TempRateId" />
<ScalarProperty Name="live" ColumnName="live" />
<ScalarProperty Name="FuelId" ColumnName="FuelId" />
<ScalarProperty Name="SupplierId" ColumnName="SupplierId" />
<ScalarProperty Name="Duration" ColumnName="Duration" />
<ScalarProperty Name="ToCon" ColumnName="ToCon" />
<ScalarProperty Name="FromCon" ColumnName="FromCon" />
<ScalarProperty Name="FeatureId" ColumnName="FeatureId" />
<ScalarProperty Name="PaymentPlanId" ColumnName="PaymentPlanId" />
<ScalarProperty Name="RateTypeId" ColumnName="RateTypeId" />
<ScalarProperty Name="REC" ColumnName="REC" />
<ScalarProperty Name="Profile" ColumnName="Profile" />
<ScalarProperty Name="ProductId" ColumnName="ProductId" />
<ScalarProperty Name="ConditionId" ColumnName="ConditionId" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
</EntityContainerMapping>
</Mapping>
</edmx:Mappings>
</edmx:Runtime>
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
<Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
<Connection>
<DesignerInfoPropertySet>
<DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
</DesignerInfoPropertySet>
</Connection>
<Options>
<DesignerInfoPropertySet>
<DesignerProperty Name="ValidateOnBuild" Value="true" />
<DesignerProperty Name="EnablePluralization" Value="true" />
<DesignerProperty Name="IncludeForeignKeysInModel" Value="true" />
<DesignerProperty Name="UseLegacyProvider" Value="true" />
<DesignerProperty Name="CodeGenerationStrategy" Value="None" />
</DesignerInfoPropertySet>
</Options>
<!-- Diagram content (shape and connector positions) -->
<Diagrams></Diagrams>
</Designer>
</edmx:Edmx></Mapping>
</edmx:Mappings>
</edmx:Runtime>
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
<Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
<Connection>
<DesignerInfoPropertySet>
<DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
</DesignerInfoPropertySet>
</Connection>
<Options>
<DesignerInfoPropertySet>
<DesignerProperty Name="ValidateOnBuild" Value="true" />
<DesignerProperty Name="EnablePluralization" Value="true" />
<DesignerProperty Name="IncludeForeignKeysInModel" Value="true" />
<DesignerProperty Name="UseLegacyProvider" Value="true" />
<DesignerProperty Name="CodeGenerationStrategy" Value="None" />
</DesignerInfoPropertySet>
</Options>
<!-- Diagram content (shape and connector positions) -->
<Diagrams></Diagrams>
</Designer>
</edmx:Edmx>
Doh!
So it turns out it didn't like the db types I was using such as unsigned
I'm able to view the app locally in the browser which I built using phonegap.The same app's zip file I uploaded in adobephonegapbuild and once the built was over I downloaded the apk file to view my app locally in my phone.But I'm unable to do perform operations like login and logout in my app.What shall be done to avoid this?Could someone provide with a solution asap?
here's the config.xml i have been using for this app i'm building:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.Netvarth.YNW1" version="1.0.0" versionCode="1" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://netvarth.com/ns/1.0">
<name>ynw</name>
<description>Appointment managagement app</description>
<author email="support#netvarth.com" href="http://netvarth.com">netvarth Team</author>
<content src="index.html" />
<preference name="permissions" value="none" />
<preference name="orientation" value="default" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="true" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="14" />
<preference name="android-installLocation" value="auto" />
<gap:plugin name="org.apache.cordova.battery-status" />
<gap:plugin name="org.apache.cordova.camera" />
<gap:plugin name="org.apache.cordova.media-capture" />
<gap:plugin name="org.apache.cordova.console" />
<gap:plugin name="org.apache.cordova.contacts" />
<gap:plugin name="org.apache.cordova.device" />
<gap:plugin name="org.apache.cordova.device-motion" />
<gap:plugin name="org.apache.cordova.device-orientation" />
<gap:plugin name="org.apache.cordova.dialogs" />
<gap:plugin name="org.apache.cordova.file" />
<gap:plugin name="org.apache.cordova.file-transfer" />
<gap:plugin name="org.apache.cordova.geolocation" />
<gap:plugin name="org.apache.cordova.globalization" />
<gap:plugin name="org.apache.cordova.inappbrowser" />
<gap:plugin name="org.apache.cordova.media" />
<gap:plugin name="org.apache.cordova.network-information" />
<gap:plugin name="org.apache.cordova.splashscreen" />
<gap:plugin name="org.apache.cordova.vibration" />
<icon src="icon.png" />
<icon gap:platform="android" gap:qualifier="ldpi" src="www/res/icon/android/icon-36-ldpi.png" />
<icon gap:platform="android" gap:qualifier="mdpi" src="www/res/icon/android/icon-48-mdpi.png" />
<icon gap:platform="android" gap:qualifier="hdpi" src="www/res/icon/android/icon-72-hdpi.png" />
<icon gap:platform="android" gap:qualifier="xhdpi" src="www/res/icon/android/icon-96-xhdpi.png" />
<icon gap:platform="blackberry" src="www/res/icon/blackberry/icon-80.png" />
<icon gap:platform="blackberry" gap:state="hover" src="www/res/icon/blackberry/icon-80.png" />
<icon gap:platform="ios" height="57" src="www/res/icon/ios/icon-57.png" width="57" />
<icon gap:platform="ios" height="72" src="www/res/icon/ios/icon-72.png" width="72" />
<icon gap:platform="ios" height="114" src="www/res/icon/ios/icon-57-2x.png" width="114" />
<icon gap:platform="ios" height="144" src="www/res/icon/ios/icon-72-2x.png" width="144" />
<icon gap:platform="webos" src="www/res/icon/webos/icon-64.png" />
<icon gap:platform="winphone" src="www/res/icon/windows-phone/icon-48.png" />
<icon gap:platform="winphone" gap:role="background" src="www/res/icon/windows-phone/icon-173-tile.png" />
<gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="www/res/screen/android/screen-ldpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="www/res/screen/android/screen-mdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="www/res/screen/android/screen-hdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="www/res/screen/android/screen-xhdpi-portrait.png" />
<gap:splash gap:platform="blackberry" src="www/res/screen/blackberry/screen-225.png" />
<gap:splash gap:platform="ios" height="480" src="www/res/screen/ios/screen-iphone-portrait.png" width="320" />
<gap:splash gap:platform="ios" height="960" src="www/res/screen/ios/screen-iphone-portrait-2x.png" width="640" />
<gap:splash gap:platform="ios" height="1136" src="www/res/screen/ios/screen-iphone-portrait-568h-2x.png" width="640" />
<gap:splash gap:platform="ios" height="1024" src="www/res/screen/ios/screen-ipad-portrait.png" width="768" />
<gap:splash gap:platform="ios" height="768" src="www/res/screen/ios/screen-ipad-landscape.png" width="1024" />
<gap:splash gap:platform="winphone" src="www/res/screen/windows-phone/screen-portrait.jpg" />
<access origin="http://54.215.5.201/" />
<plugin name="cordova-plugin-whitelist" version="1" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<engine name="android" spec="~5.1.1" />
</widget>
The solution to your predicament does not lie in the config.xml
During development and testing relative urls definitely work, e.g (./services/login.php), since the files are sitting physically in the same location. But once you package the app these relative links are broken since php doesn't run on the phone, neither is the mysql database exported with the app's HTML5 and php files.
It is important to have the database and files you are calling to be resident on the internet. Then edit the files you will zip and upload to Phonegap Build to make the API calls to http://your-domain.tld/services/login.php
I need to return all XML nodes whose ID attributes match between <Settings></Settings> and <Profile></Profile> and whose <Setting/> node has a Value attribute of true.
An example of my XML structure is found below:
<HBDI>
<Settings>
<Setting ID="PreferenceCode" Visible="true"/>
<Setting ID="SequenceCode" Visible="true"/>
<Setting ID="QuadrantScores" Visible="false"/>
<Setting ID="AdjectivePairs" Visible="false"/>
<Setting ID="ModeScores" Visible="true"/>
<Setting ID="Graph" Visible="true"/>
</Settings>
<Profile>
<PreferenceCode ID="PreferenceCode">3332</PreferenceCode>
<SequenceCode ID="SequenceCode">DCAB</SequenceCode>
<Graph ID="Graph">Graph.jpg</Graph>
<QuadrantScores ID="QuadrantScores">
<QuadrantScore Name="A" Value="3" />
<QuadrantScore Name="B" Value="3" />
<QuadrantScore Name="C" Value="23" />
<QuadrantScore Name="D" Value="46" />
</QuadrantScores>
<AdjectivePairs ID="AdjectivePairs">
<AdjectivePair Name="A" Value="4" />
<AdjectivePair Name="B" Value="7" />
<AdjectivePair Name="C" Value="9" />
<AdjectivePair Name="D" Value="10" />
</AdjectivePairs>
<ModeScores ID="ModeScores">
<ModeScore Name="Lt" Value="34" />
<ModeScore Name="Rt" Value="54" />
<ModeScore Name="Upr" Value="3" />
<ModeScore Name="Lwr" Value="24" />
</ModeScores>
</Profile>
</HBDI>
So what I want to achieve is to retrieve the following xml:
<HBDI>
<PreferenceCode ID="PreferenceCode">3332</PreferenceCode>
<SequenceCode ID="SequenceCode">DCAB</SequenceCode>
<Graph ID="Graph">Graph.jpg</Graph>
<ModeScores ID="ModeScores">
<ModeScore Name="Lt" Value="34" />
<ModeScore Name="Rt" Value="54" />
<ModeScore Name="Upr" Value="3" />
<ModeScore Name="Lwr" Value="24" />
</ModeScores>
</HBDI>
So, in the case of ID="PreferenceCode", it's corresponding Visible attribute in <Settings/> is true, thus it needs to be returned. I must admit that I have no idea on how to do the match-up between the IDs. Any help please?
When you are dealing with XML, use XQuery:
DECLARE #MyXML xml = '
<HBDI>
<Settings>
<Setting ID="PreferenceCode" Visible="true"/>
<Setting ID="SequenceCode" Visible="true"/>
<Setting ID="QuadrantScores" Visible="false"/>
<Setting ID="AdjectivePairs" Visible="false"/>
<Setting ID="ModeScores" Visible="true"/>
<Setting ID="Graph" Visible="true"/>
</Settings>
<Profile>
<PreferenceCode ID="PreferenceCode">3332</PreferenceCode>
<SequenceCode ID="SequenceCode">DCAB</SequenceCode>
<Graph ID="Graph">Graph.jpg</Graph>
<QuadrantScores ID="QuadrantScores">
<QuadrantScore Name="A" Value="3" />
<QuadrantScore Name="B" Value="3" />
<QuadrantScore Name="C" Value="23" />
<QuadrantScore Name="D" Value="46" />
</QuadrantScores>
<AdjectivePairs ID="AdjectivePairs">
<AdjectivePair Name="A" Value="4" />
<AdjectivePair Name="B" Value="7" />
<AdjectivePair Name="C" Value="9" />
<AdjectivePair Name="D" Value="10" />
</AdjectivePairs>
<ModeScores ID="ModeScores">
<ModeScore Name="Lt" Value="34" />
<ModeScore Name="Rt" Value="54" />
<ModeScore Name="Upr" Value="3" />
<ModeScore Name="Lwr" Value="24" />
</ModeScores>
</Profile>
</HBDI>'
SELECT #MyXML.query('
<HDBI> {
let $settings := /HBDI/Settings
for $element in /HBDI/Profile/*
where $settings/Setting[#ID = local-name($element) and #Visible = "true"]
return $element
} </HDBI>
')
The XQuery loops through each child node of the <Profile> tag and check if it's set to #Visible = "true" in the <Settings> node. local-name() gives the name of the current node.
I got a question:
I got a TabPane, designed in a FXML file now i want to change the name of the selected Tab,when a 'check' button is clicked.
public void onAddDateRequest(){
try {
//datePane wird in den FXML Loader geladen
FXMLLoader loader = new FXMLLoader(getClass().getResource("/homenizer/view/datePane.fxml"));
Parent content = (Parent)loader.load();
Tab tab = new Tab("Neuer Termin");
tab.setContent(content); //Dem neuen Tab wird das Layout der FXXML Datei aus Content zugewiesen
tabPane.getTabs().add(tab);
} catch (IOException ex) {
Logger.getLogger(HomenizerController.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void onCheckRequest(){
Date date = new Date();
tabPane.getSelectionModel().getSelectedItem().setText("A");
}
The 'onAddDateRequest' method is called,when u click the button to add a new tab.
Here the FXML file:
<TabPane fx:id="tabPane">
<Tab text="Willkommen" closable="true" >
<VBox>
<TitledPane text="Allgemeines" expanded="true">
<GridPane>
<Label text="Benutzername:" GridPane.columnIndex="0" GridPane.rowIndex="0" />
<Label fx:id="username" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<Label text="Termine gesamt:" GridPane.columnIndex="0" GridPane.rowIndex="1" />
<Label fx:id="dates" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="Aufgaben gesamt:" GridPane.columnIndex="0" GridPane.rowIndex="2" />
<Label fx:id="toDos" GridPane.columnIndex="1" GridPane.rowIndex="2" />
</GridPane>
</TitledPane>
<TitledPane text="Aktuell" expanded="true" >
<ScrollPane>
<GridPane>
<Label text="Aktuelle Termine:" GridPane.columnIndex="0" GridPane.rowIndex="0" />
<Label fx:id="actualDates" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<Label text="Aktuelle Aufgaben:" GridPane.columnIndex="0" GridPane.rowIndex="1" />
<Label fx:id="actualToDos" GridPane.columnIndex="1" GridPane.rowIndex="1" />
</GridPane>
</ScrollPane>
</TitledPane>
</VBox>
</Tab>
</TabPane>
And here the Layout for a new Tab, also coded in a FXML file
<ScrollPane fx:id="scrollPane" minHeight="350.0" xmlns:fx="http://javafx.com/fxml" fx:controller="homenizer.controller.HomenizerController">
<VBox>
<TitledPane text="Termin" expanded="true">
<GridPane fx:id="datePane" alignment="TOP_LEFT" hgap="10" vgap="10" prefWidth="900" >
<Label text="Termin Beschreibung" GridPane.columnIndex="0" GridPane.rowIndex="1" />
<TextField fx:id="dateInformation" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="Datum" GridPane.columnIndex="0" GridPane.rowIndex="2" />
<TextField fx:id="dateOfDate" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="Termin beginn" GridPane.columnIndex="0" GridPane.rowIndex="3" />
<TextField fx:id="dateTimeBegin" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label text="Termin ende" GridPane.columnIndex="2" GridPane.rowIndex="3" />
<TextField fx:id="dateTimeEnd" GridPane.columnIndex="3" GridPane.rowIndex="3" />
<Label text="Priorität" GridPane.columnIndex="0" GridPane.rowIndex="4" />
<fx:define>
<ToggleGroup fx:id="priorityGroup" />
</fx:define>
<RadioButton text="Hoch" GridPane.columnIndex="1" GridPane.rowIndex="4" toggleGroup="$priorityGroup" />
<RadioButton text="Normal" GridPane.columnIndex="1" GridPane.rowIndex="5" toggleGroup="$priorityGroup"/>
<RadioButton text="Niedrig" GridPane.columnIndex="1" GridPane.rowIndex="6" toggleGroup="$priorityGroup"/>
</GridPane>
</TitledPane>
<TitledPane text="Person/Unternehmen" ellipsisString="Persson / Unternehmen" expanded="false" >
<GridPane fx:id="personCompanyPane" hgap="10" vgap="10">
<Label text="Name" GridPane.columnIndex="0" GridPane.rowIndex="0" />
<TextField fx:id="name" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<Label text="Vorname" GridPane.columnIndex="0" GridPane.rowIndex="1" />
<TextField fx:id="firstname" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="Ort" GridPane.columnIndex="0" GridPane.rowIndex="2" />
<TextField fx:id="city" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="PLZ" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<TextField fx:id="place" maxWidth="60" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Label text="Strasse" GridPane.columnIndex="0" GridPane.rowIndex="3" />
<TextField fx:id="street" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label text="Hausnr." GridPane.columnIndex="2" GridPane.rowIndex="3" />
<TextField fx:id="houseNr" maxWidth="35" GridPane.columnIndex="3" GridPane.rowIndex="3" />
<Label text="Unternehmen" GridPane.columnIndex="0" GridPane.rowIndex="4" />
<TextField fx:id="company" GridPane.columnIndex="1" GridPane.rowIndex="4" />
</GridPane>
</TitledPane>
<TitledPane text="Notiz" expanded="false" >
<GridPane>
<Label text="Notiz" GridPane.columnIndex="0" GridPane.rowIndex="0" />
<TextArea GridPane.columnIndex="0" GridPane.rowIndex="1" prefWidth="900" />
</GridPane>
</TitledPane>
<HBox>
<Button fx:id="check" text="bestätigen"
onAction="#onCheckRequest"/>
<Button fx:id="cancel" text="abbrechen" />
</HBox>
</VBox>
I hope this is enough of the code for analyse the problem :)
This is my Code, everytime I get a NullPointerException, but I don't know why. The TabPane is not empty, so I don't know why I get this Exception. This is my error code:
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1456)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:28)
at javafx.event.Event.fireEvent(Event.java:171)
at javafx.scene.Node.fireEvent(Node.java:6867)
at javafx.scene.control.Button.fire(Button.java:179)
at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:193)
at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:336)
at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:329)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:64)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
at javafx.event.Event.fireEvent(Event.java:171)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3369)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3209)
at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3164)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1582)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2267)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:250)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:173)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:292)
at com.sun.glass.ui.View.handleMouseEvent(View.java:530)
at com.sun.glass.ui.View.notifyMouse(View.java:924)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279)
at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1453)
... 64 more
Caused by: java.lang.NullPointerException
at homenizer.controller.HomenizerController.onCheckRequest(HomenizerController.java:105)
... 74 more
Thanks for every help, I don't know if you need more of my code, but I'm sure that their is no error inj the rest of my code.
So I found my error :) I set the controller for my FXML in my controllercode and not in the FXML file itself and now it works