JavaFX textfield not updating with MYSQL query - mysql

So i'm able to get sql query to run and update the data in my database but i can't get my textfield to update with the calculation. I figured it would be as easy as selecting the new database amount and injecting it into the textfield but i have a feeling i'm failing to do that correctly. I can load the database table in my application and then get the new result but i'd prefer it to automatically show up.
The controller code below
#FXML
private TextField orderBox;
#FXML
private TextField totalBox;
public void calculateOrder(ActionEvent event){
String total = totalBox.getText();
String product = productBox.getText();
String queryUpdate="UPDATE ordertable o JOIN product p ON p.productID = o.productID set o.total = o.amount * p.cost";
String updateBox="SELECT total FROM ordertable WHERE productID = ?";
try{
query=c.prepareStatement(queryUpdate);
update=c.prepareStatement(updateBox);
update.setString(1, total);
query.execute();
update.execute();
//usetString(2, productID);
query.close();
update.close();
rs.close();
Alert confirmation = new Alert(Alert.AlertType.CONFIRMATION, "Calculated");
confirmation.show();
}
catch(SQLException e){
System.out.println(e);
}
The FXML class.
<AnchorPane prefHeight="420.0" prefWidth="627.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.OrderController">
<children>
<AnchorPane layoutX="14.0" layoutY="14.0" prefHeight="331.0" prefWidth="419.0">
<children>
<Label layoutX="164.0" layoutY="38.0" text="Order" />
<Label layoutX="14.0" layoutY="86.0" text="orderID" />
<Label layoutX="13.0" layoutY="128.0" text="productID" />
<Label layoutX="3.0" layoutY="167.0" text="CustomerID" />
<Label layoutX="28.0" layoutY="233.0" text="Date" />
<TextField id="orderIDBox" fx:id="orderBox" layoutX="67.0" layoutY="82.0" prefHeight="25.0" prefWidth="90.0" promptText="Enter OrderID" />
<TextField fx:id="productBox" layoutX="67.0" layoutY="124.0" prefHeight="25.0" prefWidth="90.0" />
<TextField fx:id="customerBox" layoutX="67.0" layoutY="163.0" prefHeight="25.0" prefWidth="90.0" />
<TextField fx:id="dateBox" layoutX="67.0" layoutY="229.0" prefHeight="25.0" prefWidth="90.0" />
<TextField id="totalBox" fx:id="totalBox" layoutX="89.0" layoutY="330.0" prefHeight="25.0" prefWidth="90.0" />
<TableView fx:id="orderUser" layoutX="164.0" layoutY="74.0" onMouseClicked="#showOnClick" prefHeight="248.0" prefWidth="447.0">
<columns>
<TableColumn fx:id="columnOrder" prefWidth="75.0" text="orderID" />
<TableColumn fx:id="columnProduct" prefWidth="75.0" text="productID" />
<TableColumn fx:id="columnCustomer" prefWidth="75.0" text="customerID" />
<TableColumn fx:id="columnDate" prefWidth="75.0" text="Date" />
<TableColumn fx:id="columnAmount" prefWidth="62.0" text="Amount" />
<TableColumn fx:id="columnTotal" prefWidth="75.0" text="total" />
</columns>
</TableView>
<Button id="loadButton" layoutX="518.0" layoutY="43.0" mnemonicParsing="false" onAction="#loadDataFromDatabase" text="Load" />
<Button id="editButton" fx:id="editButton" layoutX="94.0" layoutY="293.0" mnemonicParsing="false" onAction="#updateOrder" text="Edit" />
<Button id="deleteButton" fx:id="deleteButton" layoutX="15.0" layoutY="293.0" mnemonicParsing="false" onAction="#deleteOrder" text="Delete" />
<Button id="calculateButton" fx:id="calculateButton" layoutX="20.0" layoutY="330.0" mnemonicParsing="false" onAction="#calculateOrder" text="Calculate" />
<Label layoutX="19.0" layoutY="200.0" text="Amount" />
<TextField fx:id="amountBox" layoutX="67.0" layoutY="196.0" prefHeight="25.0" prefWidth="90.0" />
</children>
</AnchorPane>
<Button fx:id="addButton" layoutX="220.0" layoutY="363.0" mnemonicParsing="false" onAction="#AddOrder" text="Add" />
</children>
</AnchorPane>

As far as I can see (since I don´t see all the code) You´re just executing the query. You´re not assigning it the result to nothing.
Your update will work fine and your query too, but since you´re not assigning it to nothing you will not see changes.
Try to assign the query result to your textfield (I don´t know which is the textfield since you don´t say which one you want to update, I guess is total.) and then you´ll be able to see the update in your textfield

Related

Migration of jsf 2.0 app to JSF 2.2 and WAS9 Composite Component Not firing event

I have an app that has been running fine until we migrated to WAS9 app server(which uses jsf2.2 by default).
The app has a composite component which contains a primefaces:autosuggest widget. The widget stopped "firing" the itemSelect event. The ajaxListener is never firing.
Everything I see says that it is coded correctly, but nothing.
I have tried adding the "change" event, but that event also never fires.
The only thing I have been able to make work is to make it a regular listener
<cc:attribute name="ajaxLocationListener" method-signature="void listener()"/>
but then I do not have access to the data on the event that I need.
This is the implementation of the composite component:
<com:stopComponent id="Origin"
customerKey="#{templateController.ordrBeanUI.orderHeaderUI.customerUniqueKey}"
stop="#{templateController.ordrBeanUI.orderStopListUI.orderStopList[0]}"
options="#{templateController.custOptionsBean.countryCodesBean}"
mode="#{templateController.ordrBeanUI.orderHeaderUI.shippingMode}"
intlModeFlag="#{templateController.ordrBeanUI.orderHeaderUI.intlModeFlag}"
docType="#{templateController.ordrBeanUI.orderHeaderUI.documentType}"
addressBookAction="#{templateController.addressBookLookUp}"
saveAddressAction="#{templateController.saveAddressBook}"
lookAheadAction="#{templateController.obtainLocationList}"
ajaxListener="#{templateController.handleSelect}"
>
<f:ajax execute="Origin" render="originPanel" onevent="setOrderFieldFlagsAjax"/>
</com:stopComponent>
The actual StopComponent is here:
<html xmlns:x="http://www.w3.org/1999/xhtml"
xmlns:cc="http://xmlns.jcp.org/jsf/composite"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:lf="http://websphere.landstar.com/jsf"
xmlns:com="http://xmlns.jcp.org/jsf/composite/components">
<cc:interface displayName="locationSection">
<cc:attribute name="customerKey" type="java.lang.Integer" />
<cc:attribute name="stop" type="com.landstar.cust.orders.beans.OrderStopUI" required="true" />
<cc:attribute name="options" type="com.landstar.cust.orders.beans.CountryCodesSelectOptionsBean" required="true" />
<cc:attribute name="mode" type="java.lang.String" required="true" />
<cc:attribute name="intlModeFlag" type="java.lang.Boolean" required="true" />
<cc:attribute name="docType" type="java.lang.String" />
<cc:attribute name="addressBookAction" method-signature="void actionListener(javax.faces.event.AjaxBehaviorEvent)" required="true"/>
<cc:attribute name="saveAddressAction" method-signature="void actionListener(javax.faces.event.ActionEvent)" />
<cc:attribute name="lookAheadAction" method-signature="java.util.List obtainAddress(java.lang.String)" />
<cc:attribute name="ajaxListener" method-signature="void actionListener(javax.faces.event.AjaxBehaviorEvent)" />
<cc:clientBehavior name="click" event="action" targets="saveLink" />
<cc:clientBehavior name="itemSelect" event="itemSelect" targets="stopLocationID stopLocationName" />
<cc:clientBehavior name="dateSelect" event="dateSelect" targets="#{cc.clientId}_fromDate #{cc.clientId}_toDate" />
</cc:interface>
<p:autoComplete id="stopLocationName" value="#{cc.attrs.stop.selectedLocationName}" minQueryLength="3"
completeMethod="#{cc.attrs.lookAheadAction}" forceSelection="false"
var="p" itemLabel="#{p.locationText}" itemValue="#{p}" size="32" maxlength="30"
converter="locationConverter">
<f:attribute name="customerKey" value="#{cc.attrs.customerKey}" />
<f:attribute name="searchType" value="locationName" />
<f:attribute name="mode" value="#{cc.attrs.mode}" />
<f:attribute name="geoType" value="#{cc.attrs.stop.stopInternational}" />
<f:attribute name="stopType" value="#{cc.clientId}"/>
<p:ajax event="itemSelect" listener="#{cc.attrs.ajaxLocationListener}" update="stopComponent" oncomplete="setOrderFieldFlagsPrimeFaces(xhr,status,args)" />
</p:autoComplete>
The Backing Bean is here:
#ManagedBean(name="orderController")
#ViewScoped
public class OrderController extends DocumentController implements Serializable {
}
public class DocumentController extends DateTimeConversions implements Serializable {
...
public void handleSelect(SelectEvent event) {
String stopType = event.getComponent().getClientId();
String calledFrom = "lookAhead";
populateLocationFromAddressBook(stopType, calledFrom,
((LocationLookAheadBean) event.getObject()).getLocationAddressUniqueKey());
String stopTypeStr = "";
if (stopType != null && !stopType.trim().equals("")) {
stopTypeStr = stopType.trim().substring(0, stopType.trim().indexOf(":"));
}
RequestContext context = RequestContext.getCurrentInstance();
context.addCallbackParam("location", stopTypeStr);
}
}

HTML template in xml - what kind of architecture is this?

My project has many xml files which are using to build html page & page operations. Here is the sample of grid template.
<Contact singular="Contact" indeal="" nodeal="ContactsPlaybook" tooltip="Document Playbook" library="true" tabHidden="true">
<ListingScreen handle = "PlaybookContacts.ashx" suppressCount="true" showFilters="true">
<IncludeScript src="scripts/jjedsEmaUser.js"/>
<SmartIcon editMode="false" requiredAction="Create" name="new" image="new.png" tooltip="Create" separator="false" href="PlaybookContactDetail.ashx?DealRef=${DealRef}" edit="true" />
<SmartIcon editMode="false" requiredAction="Delete" name="BulkDelete" image="delete.png" tooltip="Delete" separator="true"/>
<SmartIcon editMode="false" requiredAction="Read" actionOn="Contact" name="email" image="mail.png" tooltip="Email Team" href="PlaybookEmailTeam.ashx?DealRef=${DealRef}&Subject=Playbook&Body=${LinkToPage}" edit="true" />
<SmartIcon editMode="false" requiredAction="Read" name="print" image="print.png" tooltip="Print" onclick="javascript:window.print()" />
<!--<SmartIcon editMode="false" requiredAction="Administrate" name="CreateEmaUser" image="add_EMA_user.png" tooltip="Create EMA user" onclick="return emans.jjedsEmaUser.create('${DealRef}', '#ListingForm')" />-->
<Filters>
<Filter label="Functional Team" filter="FunctionalCategoryFilter" field="ContactGroupID" prefix="C" empty="FunctionalCategoryRef_NULL">
<PossibleValues displayProperty="Name" />
</Filter>
<Filter label="Country" filter="CountryFilter" by="name" prefix="AD" field="CountryID" displayProperty="Code" empty="-1">
</Filter>
<Filter label="Business Unit" filter="PickListIntFilter" field="BusinessUnit" prefix="C" empty="-1" onlyifsettingtrue="UseSpecialUserDealAccess">
<PossibleValues category="Deal" subcategory="BusinessUnit" />
</Filter>
</Filters>
<Sorting>
<SortColumn name="FullName" dir="asc"/>
</Sorting>
<Query alias="C" ignoreArchiving="true" ignoreDeal="true">
<Block by="C.ContactGroupID" resolveto="DepartmentName" as="Department" />
<JoinTo table="Address" alias="AD" from="C.AddressID" to="AD.AddressID">
</JoinTo>
<Constraint left="C.IsArchived" int="0" />
</Query>
<Column command="true" title="<input type='checkbox' header='true' onclick='ToggleCheckAll(this);'>" editMode="false" special="IsDelete" macro="Checkbox" onClick="ToggleCheckBox(this);"/>
<Column command="true" requiredAction="Update" title="" field="Blank" dbColumn="C.ContactID" macro="ImageLink" fieldType="Contact" tooltip="Edit" image="edit.png" edit="true" />
<Column title="Full Name" field="FullName" macro="LinkToRef" resolveto="FullContactName" from="C.ContactID" contactAlias="C" linkPage="PlaybookContactDetail.ashx"/>
<Column title="Organization" field="C.Affiliation" macro="Text" />
<Column title="Business Unit" field="C.BusinessUnit" property="BusinessUnit" macro="PickList" category="Deal" subcategory="BusinessUnit" storeInt="true" onlyifsettingtrue="UseSpecialUserDealAccess"/>
<Column title="Role" field="C.Role" macro="Text" />
<Column title="Phone" field="C.Phone" macro="Text" />
<Column title="Email" field="C.Email" macro="MailToRef" />
<DeleteDialog name="ContactDelete" info="If you really want to delete {0} please choose the contact which will be used instead."
title="Confirm delete" type="ContactDeleteDialog" >
</DeleteDialog>
</ListingScreen>
</Contact>
Can anyone tell me what kind of architecture is this and what is the real benefit of using this architecture?
It is used in Single page applications to populate the page using an ajax call from the browser to XML files/JSON files in the server thus avoiding reloading of the entire page.
Look into this example
https://www.w3schools.com/js/tryit.asp?filename=tryjs_ajax_xml2
Here on clicking the button the table gets loaded with the xml data from cd_catalog.xml
https://www.w3schools.com/js/cd_catalog.xml
Its architechture is similar to HTML in the way that both are markup languages.
The data is accessed using the nested structure of the tags.In the cd.catalog example the title column is accessed as catalog->cd->title.

How to update a single row at a time of SQL Server 2008 using ASP.NET?

I have a form in which i have the following fields as shown in image :
Image of the form
Below is the screenshot of database in which I have three inserted 3 different values for 3 different row, but when I updated one of the rows among them, all three rows got updated.
Image of the rows in database
Here is update code I have on SqlDataSource:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ToursandTravelsConnectionString %>"
SelectCommand="SELECT [subcatname], [subcatid], [categoryname] FROM [subcategory]"
UpdateCommand="UPDATE subcategory SET subcatname =#1, categoryname =#2, pic =#3">
<UpdateParameters>
<asp:ControlParameter ControlID="txtsubcategoryname" Name="1"
PropertyName="Text" />
<asp:ControlParameter ControlID="txtcategoryname" Name="2"
PropertyName="Text" />
<asp:ControlParameter ControlID="FileUpload1" Name="3"
PropertyName="FileBytes" />
</UpdateParameters>
</asp:SqlDataSource>
You need a where clause for your update. Something like this:
UpdateCommand="UPDATE subcategory SET subcatname =#1, categoryname =#2, pic =#3 WHERE subcatid = #4">
<UpdateParameters>
<asp:ControlParameter ControlID="txtsubcategoryname" Name="1"
PropertyName="Text" />
<asp:ControlParameter ControlID="txtcategoryname" Name="2"
PropertyName="Text" />
<asp:ControlParameter ControlID="FileUpload1" Name="3"
PropertyName="FileBytes" />
<asp:ControlParameter ControlID="intsubcategoryid" Name="4"
PropertyName="Integer" />
</UpdateParameters>
</asp:SqlDataSource>

Office AddIn button's icon won't show up

Here's extract from the manifest's Host
<ExtensionPoint xsi:type="PrimaryCommandSurface">
<CustomTab id="MyTab">
<Group id="Raporty.GroupPabcd">
<Label resid="Raporty.GroupPabcd.Label" />
<Icon>
<bt:Image resid="Raporty.Icon1_16" size="16" />
<bt:Image resid="Raporty.Icon1_20" size="20" />
<bt:Image resid="Raporty.Icon1_24" size="24" />
<bt:Image resid="Raporty.Icon1_32" size="32" />
<bt:Image resid="Raporty.Icon1_40" size="40" />
<bt:Image resid="Raporty.Icon1_48" size="48" />
<bt:Image resid="Raporty.Icon1_64" size="64" />
<bt:Image resid="Raporty.Icon1_80" size="80" />
</Icon>
<Control xsi:type="Button" id="RaportPabcd.Button">
<Label resid="RaportPabcd.Button.Label" />
<Supertip>
<Title resid="RaportPabcd.Button.Label" />
<Description resid="RaportPabcd.Button.Tooltip" />
</Supertip>
<Icon>
<bt:Image resid="Raporty.Icon1_16" size="16" />
<bt:Image resid="Raporty.Icon1_20" size="20" />
<bt:Image resid="Raporty.Icon1_24" size="24" />
<bt:Image resid="Raporty.Icon1_32" size="32" />
<bt:Image resid="Raporty.Icon1_40" size="40" />
<bt:Image resid="Raporty.Icon1_48" size="48" />
<bt:Image resid="Raporty.Icon1_64" size="64" />
<bt:Image resid="Raporty.Icon1_80" size="80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<TaskpaneId>ButtonId1</TaskpaneId>
<SourceLocation resid="Contoso.Taskpane.Url" />
</Action>
</Control>
</Group>
<Label resid="Raporty.Tab.Label" />
</CustomTab>
</ExtensionPoint>
as well as the resources
<Resources>
<bt:Images>
<bt:Image id="Raporty.Icon1_16" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_16.png" />
<bt:Image id="Raporty.Icon1_20" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_20.png" />
<bt:Image id="Raporty.Icon1_24" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_24.png" />
<bt:Image id="Raporty.Icon1_32" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_32.png" />
<bt:Image id="Raporty.Icon1_40" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_40.png" />
<bt:Image id="Raporty.Icon1_48" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_48.png" />
<bt:Image id="Raporty.Icon1_64" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_64.png" />
<bt:Image id="Raporty.Icon1_80" DefaultValue="~remoteAppUrl/Images/ReportIcons/report_1_80.png" />
</bt:Images>
</Resources>
Problem is that the button shows the default icon
I tried to access the image directly in the browser (i.e. http://localhost/ExcelWebWeb/Images/ReportIcons/report_1_32.png) and it does show up
I have taken a look at the IIS logs to see if the image was even queried by the Excel app, but it wasn't. I can only see access logs from my local browser to the icons while the addin only queries the html/js files (for the TaskPane) without querying for the button's image.
I had the same issue but found a solution. Please add the following to the manifest.xml file:
<Version>1.0.0.0</Version>
<ProviderName>abc</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<!-- The display name of your add-in. Used on the store and various places of
the Office UI such as the add-ins dialog. -->
<DisplayName DefaultValue="abc" />
<IconUrl DefaultValue="~remoteAppUrl/Images/add-in-icon-lo-res.png"/>
<HighResolutionIconUrl DefaultValue="~remoteAppUrl/Images/add-in-icon-hi-res.png"/>
Resolution for the image should be Iconurls 64 x 64 pixels with 8 bit depth in png and for HighResolutionIconUrl 128 x 128 pixels
try replacing '~remoteAppUrl' with localhost:[port number]. When you publish the app, this needs to be changed to the host and port number
<CustomTab id="MyTab">
<Group id="Raporty.MyTab.GroupPabcd">
<Label resid="Raporty.MyTab.GroupPabcd.Label" />
......
<Label resid="Raporty.MyTab.TabLabel" />
That is corect code for manifest.

Error loading fxml javafx8

I am trying to load the following fxml file. I simply get an exception thrown pointing to line 19. I can load this in scenebuilder just fine, via Show preview in window menu item. At first I thought one couldn't have rectangles be children of a stackpane but that is the very example Oracle uses for javadoc and StackPane. Is there a known best practice to debug failures to load and fxml file? It flags the first child under reticlefilter stackpane.
The two children in question are the light blue rectangle with the yellow reticle.
<?xml version="1.0" encoding="UTF-8"?>
<?import org.cornova.javafx.*?>
<?import javafx.scene.shape.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.text.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<VBox fx:id="sliceRealEstate" alignment="TOP_CENTER" onMouseDragged="#onMouseDragged" onMousePressed="#onMousePressed" onScroll="#onScroll" onScrollStarted="#onScrollStarted" pickOnBounds="false" stylesheets="#org/cornova/javafx/xpssdr.css" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.cornova.xpssdr.controllers.SliceController">
<children>
<HBox fx:id="flagPole" pickOnBounds="false">
<children>
<Pane fx:id="flagPane" pickOnBounds="false" stylesheets="#org/cornova/javafx/xpssdr.css">
<children>
<StackPane fx:id="reticleFilter" alignment="BOTTOM_LEFT" pickOnBounds="false">
<children>
***<Rectangle fx:id="filter" fill="#3670ad" height="40.0" opacity="0.38" width="30.0" StackPane.alignment="CENTER" />***
<Rectangle fx:id="reticle" fill="#e8e82f" height="40.0" width="2.0" StackPane.alignment="CENTER" />
</children>
</StackPane>
<HBox fx:id="flag">
<children>
<VBox alignment="TOP_CENTER" spacing="10.0" style="-fx-background-color: black;" HBox.hgrow="NEVER">
<children>
<Button fx:id="close" mnemonicParsing="false" onAction="#close" text="cls">
<font>
<Font size="10.0" />
</font>
</Button>
<Button fx:id="lock" layoutX="10.0" layoutY="10.0" mnemonicParsing="false" onAction="#lock" text="lck">
<font>
<Font size="10.0" />
</font>
</Button>
<Button fx:id="record" layoutX="10.0" layoutY="29.0" mnemonicParsing="false" onAction="#record" text="rec">
<font>
<Font size="10.0" />
</font>
</Button>
<Button fx:id="play" layoutX="10.0" layoutY="48.0" mnemonicParsing="false" onAction="#play" text="play">
<font>
<Font size="10.0" />
</font>
</Button>
</children>
</VBox>
<VBox alignment="CENTER" style="-fx-background-color: black;" HBox.hgrow="NEVER">
<children>
<HBox alignment="CENTER" VBox.vgrow="ALWAYS">
<children>
<VBox alignment="CENTER" HBox.hgrow="NEVER">
<children>
<HBox alignment="CENTER" VBox.vgrow="NEVER">
<children>
<VBox alignment="TOP_CENTER">
<children>
<ComboBox fx:id="rcvsrc" prefWidth="65.0" />
<ComboBox fx:id="txsrc" prefWidth="65.0" />
</children>
</VBox>
<Label fx:id="filterwidth" text="200" HBox.hgrow="NEVER" />
</children>
</HBox>
<HBox alignment="CENTER_LEFT" fillHeight="false" VBox.vgrow="NEVER">
<children>
<Label fx:id="nbon" text="nb" />
<Label fx:id="apfon" text="nr" />
<Label fx:id="nron" text="apf" />
<Label fx:id="qskon" text="qsk" />
</children>
</HBox>
</children>
</VBox>
<HBox HBox.hgrow="ALWAYS">
<children>
<Label fx:id="txindicator" alignment="CENTER" contentDisplay="CENTER" graphicTextGap="0.0" styleClass="largeindicators" text="TX" textAlignment="CENTER" textFill="RED">
<font>
<Font size="28.0" />
</font>
</Label>
<Label fx:id="sliceind" alignment="CENTER" contentDisplay="CENTER" styleClass="largeindicators" text="A" textAlignment="CENTER">
<font>
<Font size="27.0" />
</font>
</Label>
</children>
</HBox>
</children>
</HBox>
<VBox VBox.vgrow="NEVER">
<children>
<HBox alignment="CENTER" VBox.vgrow="NEVER">
<children>
<Label fx:id="signalLevel" alignment="CENTER" styleClass="mediumindicators" text="S9" HBox.hgrow="NEVER">
<opaqueInsets>
<Insets />
</opaqueInsets>
</Label>
<Label fx:id="signalplus" text="+20" />
<TextField fx:id="frequency" maxHeight="-Infinity" maxWidth="161.0" onAction="#onFrequencyChange" onMouseEntered="#scale" prefHeight="40.0" prefWidth="144.0" promptText="144.123456" styleClass="mediumindicators" />
</children>
</HBox>
</children>
</VBox>
<HBox VBox.vgrow="NEVER">
<children>
<ButtonBar buttonMinWidth="30.0" HBox.hgrow="NEVER">
<buttons>
<Button fx:id="spkr" mnemonicParsing="false" onAction="#displaySpkrSubmenu" text="spkr">
<font>
<Font size="10.0" />
</font>
</Button>
<Button fx:id="dsp" mnemonicParsing="false" onAction="#displayDSPSubmenu" text="dsp">
<font>
<Font size="10.0" />
</font>
</Button>
<Button fx:id="mode" layoutX="125.0" layoutY="17.0" mnemonicParsing="false" onAction="#displayModeSubmenu" text="rtty">
<font>
<Font size="10.0" />
</font>
</Button>
<Button layoutX="220.0" layoutY="17.0" mnemonicParsing="false" onAction="#displayXRITSubmenu" text="x/rit" fx:id="xrit">
<font>
<Font size="10.0" />
</font>
</Button>
<Button fx:id="dax" layoutX="315.0" layoutY="17.0" mnemonicParsing="false" onAction="#displayDAXSubmenu" text="dax">
<font>
<Font size="10.0" />
</font>
</Button>
</buttons>
<padding>
<Insets bottom="5.0" right="5.0" top="5.0" />
</padding>
</ButtonBar>
</children>
</HBox>
</children>
</VBox>
</children>
</HBox>
</children>
</Pane>
</children>
</HBox>
</children>
</VBox>
Additional information:
Exact text from exception
11:11:24.191 [nioEventLoopGroup-2-3] DEBUG org.cornova.xpssdr.views.SliceView - javafx.fxml.LoadException:
file:/home/walt/NetBeansProjects/XPSSDR/dist/run293699722/XPSSDR.jar!/SliceFlag.fxml:19
Code that does the load.
public VBox create() throws IOException {
VBox pane = null;
try {
pane = sliceLoader.load();
controller = sliceLoader.getController();
controller.setRadio(radio);
controller.setPan(pan);
controller = sliceLoader.getController();
controller.setPanadapter(pan);
controller.setParent(this);
controller.setSlice(slice);
wire();
Platform.runLater(() -> {
controller.wire();
});
} catch (Exception e) {
if (log.isDebugEnabled()) {
log.debug(e.getLocalizedMessage());
log.debug(e.getMessage());
log.debug(e.toString());
}
}
return pane;
}
The error was actually in the constructor to the controller. Late last night I, in an attempt to get the reticle displayed, when it was a ResizableCanvas I decided to change it to Rectangle such that it would simply take a fill(). As this was an existing app and existing controller that worked, such as it was, I didn't create it from SceneBuilder's View sample controller and had inadvertantly not changed the #FXML in the constructor of the controller. In FXMLLoader.java I was eventually able to trace it to the point it was trying to invoke something, the controller. Oddly though, it was pointing at the wrong controller, which I did verify was correct in the fxml. A puzzlement but not the current one. To you comment James about there is always a stack trace. No, many times there is not. It just strikes me perhaps I am missing some best practice on debugging these (JavaFX fxml loader issues which I've had several of these last couple of days.