This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 236819 (bernard79) - following bug 236817
Summary: following bug 236817
Status: VERIFIED DUPLICATE of bug 236509
Alias: bernard79
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P1 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-07 07:13 UTC by Claude79
Modified: 2013-12-21 07:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Claude79 2013-10-07 07:13:13 UTC
hi 

after noted a problem with javafx, i wrote to them and their answers followed

hi The NetBeans bug ids are:

bug 236509: Scene Builder xmlns:fx versioning not properly recognized in NB Editor
bug 236559: Using Netbeans "Make Controller" duplicates the fx:controller property, and makes the fxml file non-loadable anymore

The Scene Builder issue # is:

issue DTL-5829 : Using NetBeans "Make Controller" makes the fxml file non-loadable anymore

You can vote for the NetBeans issues and watch the Scene Builder issue to keep track of their progress.
Thank you very much for taking the time to bring the issues to our attention and also for your interest in JavaFX and Scene Builder

Best regards,
Cindy Castillo
Technical Writer
Oracle
Comment 1 Svata Dedic 2013-10-07 08:00:28 UTC
It's important to note that both of the referenced defects are already marked as resolved/fixed (so fixes appear in current development builds) AND they are scheduled for inclusion to the nearest patch candidate (see status whiteboard, it lists 74patch1-candidate). 

It's not clear to me whether this defect is a response to closing issue #236817 as incomplete (not enough info); if so, it still lacks the neccessary information requested in the said issue. Assuming it may be a new error condition, I need to decide whether it matches one of the existing/fixed defects or is a new P1 issue requiring immediate attention, or it is a lower-prio defect.

If the original issue #236817 was filled as an attempt to follow the advice by Scene Builder team and this in this report you've tried to explain why #236817 was filed, please write that explicitly so it's obvious that it's not a new defect, but rather an intentionally duplicate report of the referenced (and fixed) issues #236509 etc. 
In that case, please do not fill in such duplicates; it is just waste of your time and dev time to find & mark the issues as duplicate. Instead of it, vote for the existing defect (link 'vote' on issue's page, next to priority field) to increase its visibility and chance to be fixed. Or add a justification comment and/or increase the priority, should you believe it was not assigned appropriately.

Please do not create new issues just to respond/supply additional information for the same issue case. Reopen the issue and write additional info into the comment (and perhaps read bug reporting guidelines, should you plan to report more defects). This helps to keep all the relevant information at a single place.
Comment 2 Claude79 2013-10-07 08:13:25 UTC
Where i explain my bug to javafx team. They said issue is closed for them because they suppose it is an netbeans issue

following all the code showing the bug, i can not do more, sorry

Synchronizing scenebuilder With the Controller Source Code

 I quote yours documentation :

"The NetBeans IDE's Make Controller feature allows you to synchronize the modifications you make in the FXML file that is currently opened in Scene Builder and the controller source code opened in NetBeans IDE. To illustrate this feature, do the following:

    In Scene Builder, drag a Button control from the Library panel to the Control panel.

    In the Code panel, assign a new value for the new button's fx:id field and a new method name for the onAction method.

    Select File in the main menu and then Save.

    In NetBeans IDE 7.3 or later, right click the project node for the FXML file that you just edited and select Edit from the contextual menu.

    From the main menu, select Source and then Make Controller.
    The @FXML private variable and the new onAction method for the button you just added in Scene Builder are created in the controller source file. Use the Make Controller command if you delete an element in the Control panel or update an fx:id value or a method name in Scene Builder."

Below his my experimentationwhere i do not get any good Synchronization od scenebuilder With the Controller Source Code after having followed yours documentation
window 7, javafx scenebuilder 1.1, netbeans 7.4 RC1

New javaFX project with netbeans

file --> open a new Javafx FXML Application --> project name --> finish

*******************************************************************************
then, The FXMLDocument.fxml before any editing look like this:

<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml" fx:controller="javafxapplication16.FXMLDocumentController">
    <children>
        <Button layoutX="126" layoutY="90" text="Click Me!" onAction="#handleButtonAction" fx:id="button" />
        <Label layoutX="126" layoutY="120" minHeight="16" minWidth="69" fx:id="label" />
    </children>
</AnchorPane>

=========

And the FXMLDocument Controller before any editing look like this:

the Button fx:id = "button" is not visible, it should look like this : @FXML private Button button;

package javafxapplication16;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;

/**
 *
 * @author Claude
 */
public class FXMLDocumentController implements Initializable {
   
    @FXML
    private Label label;
   
    @FXML
    private void handleButtonAction(ActionEvent event) {
        System.out.println("You clicked me!");
        label.setText("Hello World!");
    }
   
    @Override
    public void initialize(URL url, ResourceBundle rb) {
        // TODO
    }   
   
********************************************************************************
Editing le project following yours documentation:

from netbeans --> open FXMLDocument.fxml --> adding a button with fx:id="button1" and a method on action = #HandleButton1Action --> save

with netbeans --> edit FXMLDocument.fxml --> source --> Make Controller

Now, The FXMLDocument.fxml look like this:
(the fx:controller appear twice ?)

<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<AnchorPane id="AnchorPane" prefHeight="200.0" prefWidth="320.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2"
            fx:controller="javafxapplication16.FXMLDocumentController"
        fx:controller="javafxapplication16.FXMLDocumentController">
  <children>
    <Button fx:id="button" layoutX="126.0" layoutY="90.0" onAction="#handleButtonAction" text="Click Me!" />
    <Label fx:id="label" layoutX="126.0" layoutY="120.0" minHeight="16.0" minWidth="69.0" />
    <Button fx:id="button1" layoutX="55.0" layoutY="34.0" mnemonicParsing="false" onAction="#handleButton1Action" text="Button" />
  </children>
</AnchorPane>

==========

And The FXMLDocumentController.java (after source --> Make Controller) look like this:

private Label label lost its @FXML
nothing about @FXML private Button button
nothing about @FXML private Button button1

package javafxapplication16;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;

/**
 *
 * @author Claude
 */
public class FXMLDocumentController implements Initializable {
   
        private Label label;
   
    @FXML
    private void handleButtonAction(ActionEvent event) {
        System.out.println("You clicked me!");
        label.setText("Hello World!");
    }
   
    @Override
    public void initialize(URL url, ResourceBundle rb) {
        // TODO
    }   

    @FXML
    private void handleButton1Action(ActionEvent event) {
    }
   
}
Comment 3 Svata Dedic 2013-10-07 08:20:06 UTC
Good, it's then a duplicate of issue #236509, the fx: prefix was not recognized as javafx namespace by editing support.

Marking as duplicate of the already fixed issue to make it more visible among the potential patch contents.

*** This bug has been marked as a duplicate of bug 236509 ***