Creating a TableView with a component, problem with my lines.

I am trying to create a table in a pane. Each row in the table will have three columns. I found an example of code to create the table, but I'm getting additional lines that I don't want.

I want only lines with 3 columns but I have extra lines, including the content of the last column see image.

Is someone can you please tell me what is wrong with my code?

    private Pane createPane(String category) {

        VerticalFieldManager vfm = new VerticalFieldManager();

        vfm.add(new LabelField("Add Task:", Field.FOCUSABLE | LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH));

        // Initialize the model if it has not yet been loaded
        _tableModel = new SortedTableModel(StringComparator.getInstance(true), 2);

        // Populate the list
        for (int i = 0; i < 3; i++) {

            String col1 = i + " 1";
            String col2 = i + " 5";
            String col3 = i + " 3";

            _tableModel.addRow(new Object[]  {col1, col2, col3});
        }

        // Create and apply style
        RegionStyles style = new RegionStyles(BorderFactory.createSimpleBorder(new XYEdges(1, 1, 1, 1), Border.STYLE_SOLID), null, null,
            null, RegionStyles.ALIGN_LEFT, RegionStyles.ALIGN_TOP);

        // Create the view and controller
        TableView tableView = new TableView(_tableModel);
        TableController tableController = new TableController(_tableModel, tableView);

        // Set the controller focus policy to highlight rows
        tableController.setFocusPolicy(TableController.ROW_FOCUS);

        // Set the behaviour of the controller when a table item is clicked
        tableController.setCommand(new CommandHandler()
        {
            /**
             * @see CommandHandler#execute(ReadOnlyCommandMetadata, Object)
             */
            public void execute(ReadOnlyCommandMetadata metadata, Object context)
            {
                Dialog.alert("Command Executed");
            }

        }, null, null);

        tableView.setController(tableController);

        // Create a DataTemplate that suppresses the third column
        DataTemplate dataTemplate = new DataTemplate(tableView, 1, 3)
        {
            /**
             * @see DataTemplate#getDataFields(int)
             */
            public Field[] getDataFields(int modelRowIndex)
            {
                Object[] data = (Object[]) ((TableModel) getView().getModel()).getRow(modelRowIndex);

                Field[] fields = new Field[3];
                fields[0] = new LabelField(data[0], Field.FOCUSABLE);
                fields[1] = new LabelField(data[1], Field.FOCUSABLE | DrawStyle.HCENTER);
                fields[2] = new LabelField(data[2], Field.FOCUSABLE);

                return fields;
            }
        };

        // Set up regions
        dataTemplate.createRegion(new XYRect(0, 0, 1, 1), style);
        dataTemplate.createRegion(new XYRect(1, 0, 1, 1), style);
        dataTemplate.createRegion(new XYRect(2, 0, 1, 1), style);

        // Specify the size of each column by percentage, and the height of a row
        dataTemplate.setColumnProperties(0, new TemplateColumnProperties(15, TemplateColumnProperties.PERCENTAGE_WIDTH));
        dataTemplate.setColumnProperties(1, new TemplateColumnProperties(15, TemplateColumnProperties.PERCENTAGE_WIDTH));
        dataTemplate.setColumnProperties(2, new TemplateColumnProperties(70, TemplateColumnProperties.PERCENTAGE_WIDTH));
        dataTemplate.setRowProperties(0, new TemplateRowProperties(ROW_HEIGHT));

        // Apply the template to the view
        tableView.setDataTemplate(dataTemplate);
        dataTemplate.useFixedHeight(true);

        vfm.add(tableView);

        // Pane's title
        LabelField iconTextLabelField = new LabelField(category, Field.FOCUSABLE | Field.FIELD_HCENTER);
        return (new Pane(iconTextLabelField, vfm));
    }

Thanks in advance.

 _tableModel = new SortedTableModel(StringComparator.getInstance(true), 2); <-- "2" sorts it by the object at index 2, which is your "col3". The extra rows you see are like headers for the sorting. I think you should use a different Table Model.

        // Populate the list
        for (int i = 0; i < 3; i++) {

            String col1 = i + " 1";
            String col2 = i + " 5";
            String col3 = i + " 3";

            _tableModel.addRow(new Object[]  {col1, col2, col3});
        }

Tags: BlackBerry Developers

Similar Questions

  • How to create a table with no lines to the left or to the right?

    If I create a table with say 5 columns and 15 lines, how not to do a vertical line (border) to the left and to the right of the table while keeping the boundary up and down? Is that possible or I just put a white box on the left and the right?

    IDCS3

    There are a few methods that work. Here is one.

    (1) select your table cells

    (2) open the race Panel

    3) click the blue lines of the proxy image in the Panel of stoke to deselect the lines inside and high and low lines

    (4) 0 the value of the weight of the race (or change the color of the None swatch)

    Oh and for the love of your fellow designers or the person that allows you to edit your work in the future... do NOT use a white box to hide the traits of lines and columns in the table.

    HTH

    -mt

  • Tips for creating the responses with different line heights

    Some of my answers have 1 line, some have 2, some even 3 lines. Any recommendations on configuring my Quiz slide so that the boxes to resize automatically?

    Currently, I have two problems:

    (1) I need layout manually each slide where one or more of the answers takes more than 1 line. It takes some time.

    (2) I can't use "shuffle answers", because the response of the 3 line is sometimes it's original space, and sometimes it's a line a line of response high.

    Any advice?

    I try to avoid long sentences in MCQ, but if it is necessary to have several lines (you can also reduce the size of the police) and I want to shuffle is my workflow:

    • Select the legend of response with the greatest height
    • Jointly select the other legends of the response, and then in the context menu, choose Aligh, resize at same height
    • increase the height of the surrounding area (surrounds all the legends of the response, it is also possible in the Quiz slides model, too bad, there are no placeholders for the legends of the individual response it)
    • move the legend of substantive response as needed (always use shortcuts like DOWN SHIFT and CTRL-DOWN, DOWN not to disturb the alignment)
    • to reselect all the legends of the answer, right click menu, Align, distribute vertically (or use the icons in the toolbar alignment of course)

    It is a pity that you cannot apply these lifestyle changes to all MCQ don't slide, apply no button accordion format, without memory default style in the upper part of the legend of the response properties panel. This means that the process must be done manually, but at least you can mix.

    Lilybiri

  • How to create Table View with even a column name but another Table?

    Hi all

    I have the problem to create a tableview with the same column name, but in the other table.

    Table I: -.

    Table - PAC051MPROFORMA

    Column - MNR, visitid

    Table - PAC051TPROFORMA
    Column - MNR, visitid

    Table - PAC052MTRANSBILL
    Column - MNR, visitid

    Then, I want to create a table for this table. It comes to my SQL

    Pacviewproforma CREATE VIEW (MNR, visitid, MNR, visitid, MNR, visitid)

    Like some PAC051MPROFORMA.mrn, PAC051MPROFORMA.visitid, PAC051TPROFORMA.mrn, PAC051TPROFORMA.visitid, PAC052MTRANSBILL.mrn, PAC052MTRANSBILL.visitid

    where

    * (a.PAC051MPROFORMA.mrn = PAC051TPROFORMA.mrn) *.
    and
    * (a.PAC051TPROFORMA.mrn = PAC052TRANSBILL.mrn) *.

    SQL return this error ORA-00957 =: duplicate column name

    Can I change this SQL for

    Pacviewproforma CREATE VIEW (MNR, visitid)

    Like some PAC051MPROFORMA.mrn, PAC051MPROFORMA.visitid, PAC051TPROFORMA.mrn, PAC051TPROFORMA.visitid, PAC052MTRANSBILL.mrn, PAC052MTRANSBILL.visitid

    where

    * (a.PAC051MPROFORMA.mrn = PAC051TPROFORMA.mrn) *.
    and
    * (a.PAC051TPROFORMA.mrn = PAC052TRANSBILL.mrn) *.
    This time this error return = ORA-01730: number of column names specified invalid

    What should I do?

    Thank you...

    Hello

    SQL> CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
      2  As Select
      3  PAC051MPROFORMA.mrn,
      4  PAC051MPROFORMA.visitid,
      5  PAC051TPROFORMA.mrn,
      6  PAC051TPROFORMA.visitid,
      7  PAC052MTRANSBILL.mrn,
      8  PAC052MTRANSBILL.visitid
      9  from PAC051MPROFORMA,PAC051TPROFORMA,PAC052MTRANSBILL
     10  where
     11  (PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)
     12  and
     13  (PAC051TPROFORMA.mrn=PAC052MTRANSBILL.mrn);
    CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
                                             *
    ERROR at line 1:
    ORA-00957: duplicate column name
    

    Please give different names to each column.

    Something like that...

    SQL> CREATE OR REPLACE VIEW pacviewproforma (MPROFORMA_mrn,MPROFORMA_visitid,TPROFORMA_mrn,TPROFORMA
    _visitid,MTRANSBILL_mrn,MTRANSBILL_visitid)
      2  As Select
      3  PAC051MPROFORMA.mrn,
      4  PAC051MPROFORMA.visitid,
      5  PAC051TPROFORMA.mrn,
      6  PAC051TPROFORMA.visitid,
      7  PAC052MTRANSBILL.mrn,
      8  PAC052MTRANSBILL.visitid
      9  from PAC051MPROFORMA,PAC051TPROFORMA,PAC052MTRANSBILL
     10  where
     11  (PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)
     12  and
     13  (PAC051TPROFORMA.mrn=PAC052MTRANSBILL.mrn);
    
    View created.
    
    SQL> DESC  pacviewproforma;
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     MPROFORMA_MRN                                      NUMBER
     MPROFORMA_VISITID                                  NUMBER
     TPROFORMA_MRN                                      NUMBER
     TPROFORMA_VISITID                                  NUMBER
     MTRANSBILL_MRN                                     NUMBER
     MTRANSBILL_VISITID                                 NUMBER
    

    ORA-01730: number of column names specified invalid

    The list of the nmae column you specified for the CREATE VIEW must correspond with the list of SELECTION in the view.

    Twinkle

  • Create an instance of the component with CLSID {0002DF01-0000-0000-C000-000000000046} COM IClassFactory failed due to the following error: 80004005.

    I have IE 9 installed on my machine. When I try to create objects of IE using SHDocVw. Its version is 6.1.7601.17514. When I run my windows service it runs fine but when I create an installer and then run, it displays the error message: creating an instance of the component with CLSID {0002DF01-0000-0000-C000-000000000046} COM IClassFactory failed due to the following error: 80004005.

    IE = new SHDocVw.InternetExplorer ();
    IE = new SHDocVw.InternetExplorer (true);

    I tried the two lines.

    Please give me a solution.

    Hi Patrick,

    The problem you are having is more complex than what is generally answered in the Microsoft Answers forums. It is better suited to the MSDN forums.

    Please post your question in the MSDN Forums.

    You can follow this link to ask your question:

    http://msdn.Microsoft.com/en-us/library/aa752084%28V=vs.85%29.aspx

    I hope this helps. If you have problems of Windows in the future, let us know and we would be happy to help you.

  • Problem when creating a report with a date of schduled

    When I tried to create a report with a schedule (any option except now) I get the error 'Date of the first report occur must be after or equal to the current date", unless I have use a date of 01-10-2012 or later in the first report occurs on the field.  Current date is 2012-08-23.

    Let me know if you can recreate it and if or when there is a fix.

    Hi Tim,.

    We have fixed the problem now. Could you please check that you are able to schedule a report now with start date of today?

    Thank you

    The OnPlus team

  • create a form with Adobe Acrobat Standard XI: problem - interactive objects

    try to create a form with Adobe Acrobat Standard XI: problem - interactive objects-> activate: hide the form text field-> work-> first it s didn t hide but if you continue to fulfill other things it shows the field hide; What wrong? answer also in German as possible Thx Sascha

    In the boxes use the "Mouse Up" with the action "run a JavaScript.

    Example for the "Ergebnisvergleich", you can use JavaScript the suite:

    field var = this.getField ("Verdeckung Ergebnisvergleich");

    If (event.target.isBoxChecked (0)) {}

    Field.Display = display.hidden;

    } else {}

    Field.Display = display.visible;

    }

  • I have problems with the form widget. When I created my forms, I need to leave out the line, one email because my client does not want the message line and two because those who have tried to fill the online form cannot submit because that box "email".

    I have problems with the form widget. When I created my forms, I need to leave out the line, one email because my client does not want the message line and two because those who have tried to fill the online form cannot submit because the 'email' box keep rejecting their email address valid. And I just tried to remove the line in my form and it does not allow me to delete or to mark it as not necessary either.

    Currently, there is no way around the field email forms of the Muse. Another option is to have a look at Jotforms or another third-party provider of shape that Muse has widgets for.

  • Problem with creating a container with the single line of text

    Hi ~
    I'm overwhelmed with a following problem.
    Problem: I need to create a container with a single line of text. As I learn from the TLF API, there is no way to do that so he left only in a way that looks like this:

    Assuming that textFlow object is to create
    var container: Sprite = new Sprite();
    var width: Number = 500; It has specified the value
    var height: Number = 300; just estimate is sufficient for a normal line height
    var controller: DisplayObjectContainerController = new DisplayObjectContainerController (container, width, height);
    controller.verticalScrollPolicy = ScrollPolicy.OFF;

    textFlow.flowComposer.addController (controller); textFlow.flowComposer.composeContainer (textFlow.flowComposer.getControllerIndex (controlled r));

    find the first line of the top in the created container
    var textFlowLine:TextFlowLine = textFlow.flowComposer.findLineAtPosition (controller.absoluteStart, false);
    var calLineHeight:Number = textFlowLine.textHeight + 8; 8 this is just a test value
    controller.setCompositionSize (width, calLineHeight);
    textFlow.flowComposer.updateContainer (_textFlow.flowComposer.getControllerIndex (Controller));


    In this way, she first calculate first line height giving enough space for the controller
    and cope, after that there adjust the height of the container again and then updates.
    It's so fresh generals I guess

    If anyone has more simple or just how?

    In regards to a single line. I think you can set the lineBreak on the TextFlow to "explicit". In this case lines only break to return to the line and the point ends.

    If you want to be changed, take a look at the TextLineFactory APIs. NaN set in the width/height of the limit and it gets filled. It is a more lightweight way to create TextLines.

    Take a look at the properties DisplayObjectContainerControllers compositionWidth and compositionHeight full TextFlows as in your code using. You still want to use explicit line breaks.

    Hope that helps!
    Richard

  • TableView with FocusChangeListener question field

    I created a TableView and adds items.  On one point, I use a FocusChangeListener to get the read line for action.

    It works for OS 7, especially because the simulator (9900) has a touch screen.  However, in an OS 6 non touch screen simulator (9650), the FocusChangeListener is not currently enabled.  Any item is moved to the update, it only selects the first.

    I don't know if there is a place more to put the FocusChange.  I need to know which item is currently focused on, to the next screen or to place an order on this point.  I also wonder if the pill buttons are causing a problem with the TableView.

    Here is a screenshot.

    Here is the part that creates the TableView

    // Create Table items
                    soTableModel = new TableModel();
                    soTableView = new TableView(soTableModel);
                    soTableController = new TableController(soTableModel, soTableView, TableController.ROW_FOCUS);
                    soTableView.setDataTemplateFocus(BackgroundFactory.createSolidTransparentBackground(Color.BLUE, 105));
                    soTableView.setController(soTableController);
                    // Create temporary Date holder and Formatter
                    Date tmpDate;
                    SimpleDateFormat shortFormat = new SimpleDateFormat(SimpleDateFormat.DATE_DEFAULT);
                    shortFormat.applyPattern("MMM-dd H:mm a");
    
                    // Add Tables items
                    soCursor = ServiceOrderHeader.getServiceOrders(ServiceOrderType, ServiceOrderSortBy);
                    while(soCursor.next())
                    {
                        Row tmpRow = soCursor.getRow();
                        // Get Date and Format it
                        tmpDate = new Date(tmpRow.getLong(ServiceOrderHeader.REQ_START_DATETIME));
                        // Get Service Order ID
                        String tmpServiceOrderID = tmpRow.getString(ServiceOrderHeader.SERVICEORDERID);
                        if(soCursor.getPosition() == 0){
                            SelectedServiceOrder = tmpServiceOrderID;
                        }
    
                        // Get Site Name and check to see if it is longer than 30 characters, if so, truncate it
                        String finalSiteName = tmpRow.getString(ServiceOrderHeader.SITE_NAME);
                        if(finalSiteName.length() > 30){
                            finalSiteName = finalSiteName.substring(0, 27) + "...";
                        }
    
                        String tmpProduct = CodeSet.getValueByListKey("Service Order Product", "Service Order Product Restrict", tmpRow.getString(ServiceOrderHeader.SERVICE_PRODUCT), CodeSet.orderByKey);
                        if(tmpProduct.indexOf("Preventive") > 0) {
                            tmpProduct = "PM";
                        }
    
                        //Add the Strings to the table.
                        soTableModel.addRow(new Object[]
                               { ServiceOrderHeader.newStatus(tmpRow.getString(ServiceOrderHeader.SERVICEORDERID)),
                                ServiceOrderHeader.dirtyStatus(tmpRow.getString(ServiceOrderHeader.SERVICEORDERID)),
                                ErrorLog.hasError(tmpServiceOrderID),
                                tmpServiceOrderID,
                                tmpProduct,
                                tmpRow.getString(ServiceOrderHeader.SO_STATUS),
                                shortFormat.format(tmpDate).toString(),
                                Integer.toString(tmpRow.getInteger(ServiceOrderHeader.IBASE)),
                                Integer.toString(tmpRow.getInteger(ServiceOrderHeader.SITE_BP_NR)),
                                finalSiteName
                                }, false);
                    }
    
                    // Set the Table Style
                    setStyle(soTableView, 3, 4);
    
                    // add table to content display
                    soContent.add(soTableView);
    

    I put the FocusChangeListener on article 3, which is the field ID so.

      public static void setStyle(DataView tableView, int rows, int columns)
        {
            DataTemplate soDataTemplate = new DataTemplate(tableView, rows, columns)
            {
                /**
                 * @see DataTemplate#getDataFields(int)
                 */
                public Field[] getDataFields(int modelRowIndex)
                {
                    TableModel theModel = (TableModel) getView().getModel();
                    Object[] data = (Object[]) theModel.getRow(modelRowIndex);
                    Field[] fields = new Field[data.length];
                    for(int i = 0; i < data.length; i++)
                    {
                        if(data[i] instanceof Bitmap)
                        {
                            fields[i] = new BitmapField((Bitmap) data[i]);
                        }
                        else if(data[i] instanceof String)
                        {
                            switch(i){
                                case 3:
                                    fields[i] = new bhHeaderField(String.valueOf(data[i]), Field.FOCUSABLE, Color.BLACK, Color.WHITE);
                                    fields[i].setFocusListener(serviceOrderFocusListener);
                                    break;
                                case 5:
                                    fields[i] = new bhHeaderField(String.valueOf(data[i]), Field.NON_FOCUSABLE, Color.WHITE, Color.RED);
                                    break;
                                case 6:
                                    fields[i] = new bhHeaderField(String.valueOf(data[i]), Field.NON_FOCUSABLE, Color.WHITE, CustomUi.bhColor);
                                    break;
                                default:
                                    fields[i] = new LabelField(data[i], LabelField.NON_FOCUSABLE);
                                    break;
                            }
                        }
                        else
                        {
                            fields[i] = (Field) data[i];
                        }
                    }
    
                    return fields;
                }
            };
            // Create Image Width and Height, since image is a square
            int imgWidthHeight = appAttributes.IMAGE_WIDTH
                + (CustomUi.cellStyle.getBorder() == null ? 0 : CustomUi.cellStyle.getBorder().getTop()
                + CustomUi.cellStyle.getBorder().getBottom()) + (CustomUi.cellStyle.getMargin() == null ? 0 : CustomUi.cellStyle.getMargin().top
                + CustomUi.cellStyle.getMargin().bottom);
            // Create Row settings
            // First Row
            soDataTemplate.setRowProperties(0, new TemplateRowProperties(Font.getDefault().getHeight() +
                    (CustomUi.cellStyle.getBorder() == null ? 0 : CustomUi.cellStyle.getBorder().getTop() + CustomUi.cellStyle.getBorder().getBottom()) +
                    (CustomUi.cellStyle.getMargin() == null ? 0 : CustomUi.cellStyle.getMargin().top + CustomUi.cellStyle.getMargin().bottom)));
            // Second Row
            soDataTemplate.setRowProperties(1, new TemplateRowProperties(Font.getDefault().getHeight() +
                    (CustomUi.cellStyle.getBorder() == null ? 0 : CustomUi.cellStyle.getBorder().getTop() + CustomUi.cellStyle.getBorder().getBottom()) +
                    (CustomUi.cellStyle.getMargin() == null ? 0 : CustomUi.cellStyle.getMargin().top + CustomUi.cellStyle.getMargin().bottom)));
            // Third Row
            soDataTemplate.setRowProperties(2, new TemplateRowProperties(Font.getDefault().getHeight() +
                    (CustomUi.cellStyle.getBorder() == null ? 0 : CustomUi.cellStyle.getBorder().getTop() + CustomUi.cellStyle.getBorder().getBottom()) +
                    (CustomUi.cellStyle.getMargin() == null ? 0 : CustomUi.cellStyle.getMargin().top + CustomUi.cellStyle.getMargin().bottom)));
            // Create Column Settings
            // First Column
            soDataTemplate.setColumnProperties(0, new TemplateColumnProperties((int) Math.floor(imgWidthHeight)));
            // Second Column
            soDataTemplate.setColumnProperties(1, new TemplateColumnProperties((int) Math.floor((Display.getWidth() - imgWidthHeight) * .25)));
            // Third Column
            soDataTemplate.setColumnProperties(2, new TemplateColumnProperties((int) Math.floor((Display.getWidth() - imgWidthHeight) * .45)));
            // Fourth Column
            soDataTemplate.setColumnProperties(3, new TemplateColumnProperties((int) Math.floor((Display.getWidth() - imgWidthHeight) * .30)));
    
            // Add Region (cell) properties
            // First Image Cell, expands columns 1 and row 1
            soDataTemplate.createRegion(new XYRect(0, 0, 1, 1), CustomUi.cellStyle);
            // Second Image Cell, expands columns 1 and row 2
            soDataTemplate.createRegion(new XYRect(0, 1, 1, 1), CustomUi.cellStyle);
            // Third Image Cell, expands columns 1 and row 3
            soDataTemplate.createRegion(new XYRect(0, 2, 1, 1), CustomUi.cellStyle);
    
            // First Data Cell, expands columns 2,3,4 and row 1
            soDataTemplate.createRegion(new XYRect(1, 0, 3, 1), CustomUi.cellStyle);
            // Second Data Cell, expands column 4 and row 1
            soDataTemplate.createRegion(new XYRect(3, 0, 1, 1), CustomUi.cellStyle);
            // Third Data Cell, expands column 1 and row 2
            soDataTemplate.createRegion(new XYRect(1, 1, 1, 1), CustomUi.cellStyle);
            // Fourth Data Cell, expands column 2 and row 2
            soDataTemplate.createRegion(new XYRect(2, 1, 1, 1), CustomUi.cellStyle);
            // Fifth Data Cell, expands column 3 and row 2
            soDataTemplate.createRegion(new XYRect(3, 1, 1, 1), CustomUi.cellStyle);
            // Sixth Data Cell, expands column 1 and row 3
            soDataTemplate.createRegion(new XYRect(1, 2, 1, 1), CustomUi.cellStyle);
            // Seventh Data Cell, expands column 2,3 and row 3
            soDataTemplate.createRegion(new XYRect(2, 2, 2, 1), CustomUi.cellStyle);
    
            //Apply the template to the view
            soDataTemplate.useFixedHeight(true);
            soTableView.setDataTemplate(soDataTemplate);
        }
    

    And here's the FocusChangeListener

       private static class ServiceOrderFocusListener implements FocusChangeListener
        {
            public void focusChanged(Field field, int eventType) {
                if(eventType == FOCUS_GAINED){
                    if(field.isFocusable()) {
                        SelectedServiceOrder = field.toString();
                        appAttributes.isEditableSO = ServiceOrderHeader.isEditable(SelectedServiceOrder);
                        Dialog.inform("Selected Service Order : " + SelectedServiceOrder);
                        System.out.println("Selected Service Order : " + SelectedServiceOrder);
                    }
                }
            }
        }
        static ServiceOrderFocusListener serviceOrderFocusListener = new ServiceOrderFocusListener();
    

    I found TableView.getRowNumberWithFocus ();

    So, instead of putting a FocusChangeListener on this point, I just get the current line being focused on the table.  The, I call the data slider and set the position; Cursor.position (CurrentRow);  to get the straight line of the cursor in order to obtain the appropriate data.

    Here is an example that is called when the button to find the information of the inventory for the part.  I get the current line, get the same data as that used to fill in the data.  Place the cursor to the selected position and retrieve columns that I have to go down on my request.

    int currentRow = resultsTableView.getRowNumberWithFocus();
                     try {
                         Cursor partResults = PartSearch.getPartSearch(CurrentOrderBy, CurrentRowLimit, CurrentRowOffset);
                         partResults.position(currentRow);
                         Row thisRow = partResults.getRow();
                         CurrentSAPNumber = thisRow.getString(PartSearch.SAP_PART_NUMBER);
                         CurrentPartName = thisRow.getString(PartSearch.PART_NAME);
    
                     } catch (DatabaseException dbe) {
                         SDApp.handleException(dbe, "Search Inventory Command(dbe)");
                     } catch (DataTypeException dte) {
                         SDApp.handleException(dte, "Search Inventory Command(dbe)");
                    }
    
  • Select the checkbox in the column header everything inside TableView with CheckBoxTableCell

    Hello

    I have a TableView with a column filed with the box and a listener "changed" in the template class 'Code '. I also have a 'Select all' check box in the header of this column that call the method "handleSelectAllCheckbox()". But him 'select all' does not work!

    I'm really grateful for the help.

    Here is my code:

    Concerning

    import java.net.URL;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.ResourceBundle;
    import javafx.beans.property.SimpleBooleanProperty;
    import javafx.beans.property.SimpleStringProperty;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.fxml.FXML;
    import javafx.fxml.Initializable;
    import javafx.scene.control.CheckBox;
    import javafx.scene.control.TableCell;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.control.TitledPane;
    
    
    
    
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.util.Callback;
    
    
    
    
    public class FXMLController implements Initializable {
    
    
        private CodeService codeService = new CodeServiceImpl();
        @FXML
        private TableView<Code> codeTableView;
        @FXML
        private TableColumn codeNomCol;
        @FXML
        private TableColumn codeAbregeCol;
        @FXML
        private TableColumn codeSelectCol;
        // The table's data
        private ObservableList<Code> dataCode;
    
    
        // ---------- ---------- ---------- ---------- ----------
        @Override
        public void initialize(URL url, ResourceBundle rb) {
            this.initCodeTableView();
            this.initColumnsSize();
        }
    
    
        /**
         *
         */
        private void initCodeTableView() {
            
            this.codeNomCol.setCellValueFactory(new PropertyValueFactory<Code, String>("nom"));
            this.codeAbregeCol.setCellValueFactory(new PropertyValueFactory<Code, String>("abrege"));
            //this.codeSelectCol.setCellValueFactory(new PropertyValueFactory<Code, String>("selected"));
    
    
            this.codeSelectCol.setCellValueFactory(new PropertyValueFactory("selected"));
            this.codeSelectCol.setCellFactory(new Callback<TableColumn<Code, Boolean>, TableCell<Code, Boolean>>() {
                @Override
                public TableCell<Code, Boolean> call(TableColumn<Code, Boolean> arg0) {
                    return new CheckBoxTableCell<Code, Boolean>();
                }
            });
            
            // Header CheckBox
            CheckBox cb = new CheckBox();
            cb.setUserData(this.codeSelectCol);
            cb.setOnAction(handleSelectAllCheckbox());
            this.codeSelectCol.setGraphic(cb);       
    
    
            this.codeTableView.getItems().clear();
            this.dataCode = FXCollections.observableArrayList((List<Code>) this.codeService.listCodes());
            this.codeTableView.setItems(this.dataCode);
        }
    
    
        /**
         * 
         * @return 
         */
        private EventHandler<ActionEvent> handleSelectAllCheckbox() {
    
    
            return new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent event) {
                    CheckBox cb = (CheckBox) event.getSource();
                    TableColumn column = (TableColumn) cb.getUserData();
                    if (cb.isSelected()) {
                        for (Code c : dataCode) {
                            System.out.println("Nom: " + c.getNom() + " Selected: " + c.getSelected());
                            c.setSelected(new SimpleBooleanProperty(Boolean.TRUE));
                        }
                     } else {
                        for (Code c : dataCode) {
                            System.out.println("Nom: " + c.getNom() + " Selected: " + c.getSelected());                        
                            c.setSelected(new SimpleBooleanProperty(Boolean.FALSE));
                        }
                    }
    
    
                }
            };
        }
    
    
        /**
         *
         */
        private void initColumnsSize() {
            this.codeNomCol.setMinWidth(300);
            this.codeAbregeCol.setMinWidth(200);
            this.codeSelectCol.setMinWidth(50);
        }
    
    
    
    
    
    
    }
    

    The line

    c.setSelected(new SimpleBooleanProperty(Boolean.TRUE));
    

    bad air.

    It should be

    c.setSelected(true);
    

    This suggests that your class model Code is wrong: it should be built according to the model of properties JavaFX (see tutorial):

    public class Code {
         private final BooleanProperty selected ;
         public Code(boolean selected) {
              this.selected = new SimpleBooleanProperty(this, "selected", selected);
         }
         public final boolean getSelected() {
              return this.selected.get();
         }
         public final void setSelected(boolean selected) {
              this.selected.set(selected);
         }
         public final BooleanProperty selectedProperty() {
              return selected ;
         }
    }
    

    (And similarly for the other properties).

    The problem is that when you change the selected property, the individual check boxes in the column of the table are respecting the old instances of BooleanProperty changes, not the new instance you just created.

  • Need to create a textinput with effects

    I need to create a textinput with effects - it should show a blue icon in front of it when the icon is focused and blue icon should fade later. I'm sure I need to use the skin but the problem is that I have only two States with textinput control and do not know how I would use those to ensure handling mouse hover effect. At the moment I'm not able to create a custom component bacuae I need to change all the code anywhere where there is textinput control.

    Thanks in advance.

    Rachel

    You can find this useful blog: http://flexponential.com/2010/01/24/custom-focusskin-for-spark-components-in-flex-4/

  • 5.1.7 server on El Capitan: create a user with a personalized folder location

    I've recently upgraded to El Capitan on my server once an apple advisor told me that 5.1.7 server had a bunch of bug fixes for Open Directory(which I plan on using down the road). Given that the Working Group Manager is not compatible with 10.11...

    Is there a way to create a user with a personalized folder location? When I create a user on the server, I can choose to create a home folder, with or without limitation in the disc or make the service of the user only. My problem is that I have no way (that I know) in the window of creating user to change the location of this folder.

    I tried to create a model of a user with a basic 'tailor-made' folder location (Volume/promised Pegasus/Home 2016 / etc...) but when I create the user, the home folder is not in the specified path.

    The "work around" I found for this batch of user is to create in the default location then move them on my raid Promise Pegasus, change the path to the advanced option to the each user and reassign the appropriate permissions.

    It is not so much a problem if I would deal with users 10. But I have to manage/create about 130-150 users every 5-6 months.

    I guess that there is an easier way to create a user with a custom home folder location. It would make sense that apple removes the Workgroup Manager and does not replace its characteristics.

    Best case scenario is that I do evil and do not hesitate to let me know if this is the case!

    Thank you

    Francis

    I may be wrong, but it seems that Workgroup Manager version 10.8 works under El Capitan: I can certainly start the application and query users / groups that are there.  I guess maybe it's on the machine as a rest to be updated periodically since days Lion... but it also shows that if you can find a copy, you may be able to run on your machine.

    HTH

  • How to create a DVD with DVD Studio Pro and an external DVD burner?

    Hello

    I am trying to create a DVD with DVD Studio Pro. My internal DVD drive no longer works. I have an external DVD burner - slim portable DVD writer. I create the project into DVD Studio Pro, and when in the program, it works fine when I "stimulate". Well, I can't burn it.  When I look for the external DVD writer in my finder, it is not and I don't know how or where to select the option so it is programmed to burn the external DVD writer. Any advice? Thank you have a great week.

    I found a thread that has addressed this issue, but does not help me to solve my problem. Meg the dog was told this to her in question written by Scott Stark. I tried his solution of generation and format, but after pressing the burn a window appears saying "insert disc please insert acceptable DVD recordable media."  I tried to use another blank DVD, it did not help. I use Word for Word, I heard that those who are the best blank DVDs, you can buy. Thanks again for your time!

  • How to create Hlp files with labwindows 9.0

    Hello

    I used to create the dll with Labwindows 8.5 and use them with TestStand... The advantage is that with the help file, I can add information to the Fp file and loading the DLL with TestStand, the "?" button to open the help file...

    But the problem is that I can't find help with Labwindows 9.0 generation...

    Does anyone know how to create file hlp with Labwindows 9.0?

    The procedure with Labwindows 8.5 has been:

    Modification of the PS file, then generate the Option-> windows help

    Thank you very much

    Ronan

Maybe you are looking for