How to validate at least one line selected on the table?

Hello world

I have a requirement here to display a list of customers at a table "select unique" and a button to send the page. When the user clicks this button, I need to validate if there is a selected line in the table. What is the best approach tho do?
I tried to validate it on actionListener in the click of a button, but even if I put adfFaces messages running, it does not appear on the screen and the page is still subject.

Is the BPM 11 g context of the project, so I have to do this validation and 'Cancel' the submit, otherwise the data passes through the flow until the next activity.

Maybe the real question is: how to undo a page submit during an actionListener?

Thank you

Hello

Small correction to Vinod, tableBinidng.getSeelctedRowKeys () always returns non-null (returns empty set when nothing is selected), then use the tableBinidng.getSeelctedRowKeys () .getSize () to check if a line is selected or not (0-nothing selected).

If you do not want to treat the action up to save if an option is selected, why don't you try disable the button until something is selected in the table?

To disable a button when no rows selected, simply add after the disabled property of a button value update it based on the table (add partialTriggers to the table)



Jean Lou

Tags: Java

Similar Questions

  • line selected in the table in jdev11

    I have listener custom selection for table to do things according to the selected line, but when the table has a single row of this line is automatically selected my interlocutor of choice is not triggered, so my question is how to accomplish that, initially, no row is selected in the table?

    Depends on the use case, but you can do this by deleting the attribute selectedRowKeys of the table.

    Pedja

  • How to avoid to display a line blank in the table component

    Hello

    I create button and a table like in a read-only form.

    Whenever I click on Create Insert button, a pop-up window showing were the person enter the corresponding values and clicking on the "submit" button it should show changes in the table and clicking the Cancel button to return to the page.

    But even when I click on cancel there is always an empty line is indicated in the table. Is it possible to avoid it?

    Thanks in advance.

    In this case, you will need to delete the new created line. Link the button Cancel to a bean method of directly to the delete of the VO method, you used to create the line.

    Timo

  • Select at least 1 rank, even if the table is empty

    Hi all

    I've got table t1:
    with t1 as (
    select 1 as column1, 't' as column2 from dual
    )
    select * from t1 
    My need is to select at least 1 rank, even if the table is empty, for example:
    with t1 as (
    select 1 as column1, 't' as column2 from dual
    )
    select * from t1 where rownum = 0
    union all 
    select 0 as column1, '' as column2 from dual
    The problem is that I don't know the amount of columns and its data type. How can I make a dynamic query based on the current structure of table t1?

    Hello

    This looks like a job for an outer join:

    SELECT  t1.*
    FROM            dual
    LEFT OUTER JOIN t1    ON  1 = 1
    ;
    

    Because it is not reference individual columns from t1, you do not need to know what are the columns it, or what their data types.

  • How to validate a list of button selection box record

    Hi, I have a form with a list of selection box required. If the user is not to seek a point of it I get ORA-01400: cannot insert NULL into error, but instead of this error, I have a javascript that could be used to send a message to the user before present, but have no idea where should I call go!

    Thanks for any info.

    -iahmadi

    Hi Iahmadi,
    You don't need to use javascript to do this, in fact, you can use apex integrated inline control validation to validate when no items selected. Try the following-

    For the list of selection in the LOV section, type-1 in the null value.
    Create a validation of levels element in the page that discusses the section. in the posting type select ITEM IN EXPRESSION 1 IS NOT CONTAINED in the EXPRESSION 2.

    It fires when the user click on the button without selecting any item in the drop-down list SAVE.

    Hope this helps,

    Kind regards

    Pascal M

  • Retrieve child line selected a tree table

    Hi all

    I have a tree table which includes two levels and one of the data in the column of the child node has a command link. Clicking on it calls a support bean method that tries to get the line that contains the command link that was clicked. The problem is, trying to get the line clicked (selected), it always returns the row parent of the node. I searched and followed by some examples of code, but it does not work for me.

    For example, if the table tree looks like, where X expands to show the children X 1 and X 2 lines:

    X

    L X 1

    L X 2

    Then clicking on the link to X 1 or X 2 will call code that returns the line for X.

    Here is the code in my grain of support:

       public void viewInspectionRecord(ActionEvent actionEvent) {
    
          RowKeySet rks = treeTable.getSelectedRowKeys(); 
          
          Iterator rksIterator = rks.iterator(); 
          
          if (rksIterator.hasNext()){ 
             List key = (List) rksIterator.next(); 
        
             JUCtrlHierBinding treeTableBinding = (JUCtrlHierBinding) ((CollectionModel) treeTable.getValue()).getWrappedData();     
             JUCtrlHierNodeBinding nodeBinding =  treeTableBinding.findNodeByKeyPath(key);     
             
             Row rowData = nodeBinding.getRow();
            
             if (rowData == null) {
                 FacesMessage facesMessage = new FacesMessage("Please select an Inspection Record record to view details");
                 FacesContext.getCurrentInstance().addMessage(null, facesMessage);
                 
                 return;
             }   
             
             Object irId = rowData.getAttribute("QarsInspectionRecordId");
             
             ...
      }
    

    rowData.getAttribute("QarsInspectionRecordId") eventually throw a NullPointerException because it is an attribute defined with the parent node and any children.

    Any ideas what's happening?

    Thank you

    Bill

    Hello

    see this hope, it will help you to get the line selected on your link, click

    http://oracleadf-Java.blogspot.in/2013/08/tree-table-component-with-declarative.html

    If you use treeTable selection listener then see.

    http://oracleadf-Java.blogspot.in/2012/11/tree-table-component-in-Oracle.html

  • How to validate totall character in a file using the extrnal table

    Hi all

    I have an external as table below

    CREATE TABLE 'WE_INT '. "" XTB_INVADJ_FROM_POS ".

    ("TRANSACTIONDATE" VARCHAR2 (14 BYTE),

    VARCHAR2 (2 BYTE) "LOCATION_TYPE."

    VARCHAR2 (4 BYTE) "LOCATION_VALUE."

    VARCHAR2 (3 BYTE) "ITEM_TYPE."

    VARCHAR2 (13 BYTE) "ITEM_VALUE."

    VARCHAR2 (5 BYTE) "UPC_SUPPLEMENT."

    VARCHAR2 (2 BYTE) "INVENTORY_STATUS."

    VARCHAR2 (2 BYTE) "ADJUSTMENT_REASON."

    VARCHAR2 (1 BYTE) "ADJUSTMENT_SIGN."

    "SET AMOUNT" VARCHAR2 (8 BYTE).

    VARCHAR2 (4 BYTE) "ADJ_QTY_DECIMAL_VALUE".

    )

    EXTERNAL ORGANIZATION

    (TYPE ORACLE_LOADER

    DEFAULT DIRECTORY 'LOC_SOURCE_POS2RMS_INVADJ '.

    ACCESS SETTINGS

    (RECORDS DELIMITED BY NEWLINE

    CHARACTERSET WE8MSWIN1252

    STRING SIZES ARE IN BYTES

    WHEN LOAD)

    ((1:5) = "TDETL")

    )

    BADFILE "XTB_INVADJ_FROM_POS.bad."

    DISCARDFILE 'XTB_INVADJ_FROM_POS.dis '.

    LOGFILE "XTB_INVADJ_FROM_POS.log".

    FIELDS

    LTRIM

    (

    "TRANSACTIONDATE" POSITION (30:43) DATE,

    "LOCATION_TYPE" POSITION (44:45) TANK,

    "LOCATION_VALUE" POSITION (46:49) TANK,

    "ITEM_TYPE" POSITION (50:52) TANK,

    "ITEM_VALUE" POSITION (53:65) TANK,

    "UPC_SUPPLEMENT" POSITION (66:70) TANK,

    "INVENTORY_STATUS" POSITION (71:72) TANK,

    "ADJUSTMENT_REASON" POSITION (73:74) TANK,

    "ADJUSTMENT_SIGN" POSITION (75) TANK,

    "SET AMOUNT" POSITION (76:83) TANK,.

    CHAR POSITION (84:87) "ADJ_QTY_DECIMAL_VALUE".

    )

    )

    LOCATION

    ("inv.txt"

    )

    )

    REJECT LIMIT UNLIMITED;

    If you see my conetent file that it will be as below.

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-000000400000

    I want to validate the chracters total if this line is to have more or less of 87 87 he must raise the error.

    You can use a column in the external table that contains all characters and a view that selects in the outer table, limiting the lines based on the length of the column that contains all characters, such as shown below.  You can create a separate view for those! = 87 if you want a list of releases.

    Scott@orcl12c > c:\my_oracle_files\inv.txt TYPE of HOST

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-00000040086

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-000000400087

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-0000004000088

    Scott@orcl12c > CREATE or REPLACE DIRECTORY LOC_SOURCE_POS2RMS_INVADJ AS 'c:\my_oracle_files '.

    2.

    Created directory.

    Scott@orcl12c > external_table CREATE TABLE

    2 ("TRANSACTIONDATE" VARCHAR2 (14 BYTE),

    VARCHAR2 (2 BYTE) 3 'LOCATION_TYPE. "

    VARCHAR2 (4 BYTE) 4 "LOCATION_VALUE."

    VARCHAR2 (3 BYTE) 5 'ITEM_TYPE. "

    VARCHAR2 (13 BYTE) 6 "ITEM_VALUE."

    VARCHAR2 (5 BYTE) 7 "UPC_SUPPLEMENT."

    VARCHAR2 (2 BYTE) 8 "INVENTORY_STATUS."

    VARCHAR2 (2 BYTE) 9 "ADJUSTMENT_REASON."

    10 'ADJUSTMENT_SIGN' VARCHAR2 (1 BYTE),

    11 "SET AMOUNT" VARCHAR2 (8 BYTE).

    VARCHAR2 (4 BYTE) 12 "ADJ_QTY_DECIMAL_VALUE."

    13 total_characters VARCHAR2 (255)

    14)

    15 EXTERNAL ORGANIZATION

    16 (TYPE ORACLE_LOADER

    17 DEFAULT DIRECTORY 'LOC_SOURCE_POS2RMS_INVADJ '.

    18 ACCESS SETTINGS

    19 (RECORDS DELIMITED BY NEWLINE

    CHARACTERSET 20 WE8MSWIN1252

    21 STRING SIZES ARE IN BYTES

    22 LOAD WHEN)

    23 ((1:5) = "TDETL")

    24)

    25 BADFILE "XTB_INVADJ_FROM_POS.bad."

    26 DISCARDFILE 'XTB_INVADJ_FROM_POS.dis '.

    27 LOGFILE "XTB_INVADJ_FROM_POS.log".

    28 FIELDS

    LTRIM 29

    30        (

    31 "TRANSACTIONDATE" POSITION (30:43) DATE,

    32 'LOCATION_TYPE"POSITION (44:45) TANK,

    33 "LOCATION_VALUE" POSITION (46:49) TANK,

    34 'ITEM_TYPE"POSITION (50:52) TANK,

    35 'ITEM_VALUE' POSITION (53:65) TANK,

    36 "UPC_SUPPLEMENT" POSITION (66:70) TANK,

    37 "INVENTORY_STATUS" POSITION (71:72) TANK,

    38 "ADJUSTMENT_REASON" POSITION (73:74) TANK,

    39 'ADJUSTMENT_SIGN' POSITION (75) TANK,

    40 "SET AMOUNT" POSITION (76:83) TANK,.

    41 'ADJ_QTY_DECIMAL_VALUE' POSITION (84:87) TANK,

    42 total_characters POSITION(1:255) TANK

    43        )

    44                  )

    LOCATION 45

    46 ("inv.txt"

    47         )

    48)

    RELEASE 49 UNLIMITED LIMIT

    50.

    Table created.

    Scott@orcl12c > SELECT * from external_table

    2.

    TRANSACTIONDAT LO LOCA ITE ITEM_VALUE UPC_S IN AD AN ADJ_ ADJUSTME

    -------------- -- ---- --- ------------- ----- -- -- - -------- ----

    TOTAL_CHARACTERS

    --------------------------------------------------------------------------------

    20100127181611 ST 6009 SKU 75001056 00 23 - 00000040 086

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-00000

    040086

    20100127181611 ST 6009 SKU 75001056 00 23 - 00000040 0087

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-00000

    0400087

    20100127181611 ST 6009 SKU 75001056 00 23 - 00000040 0008

    TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-00000

    04000088

    3 selected lines.

    Scott@orcl12c > external_table FROM SELECT LENGTH (total_characters)

    2.

    LENGTH (TOTAL_CHARACTERS)

    ------------------------

    86

    87

    88

    3 selected lines.

    Scott@orcl12c > xtb_invadj_from_pos VIEW to CREATE or REPLACE AS

    2. SELECT "TRANSACTIONDATE"

    3 "LOCATION_TYPE."

    4 'LOCATION_VALUE. "

    5 "ITEM_TYPE."

    6 "ITEM_VALUE."

    7 "UPC_SUPPLEMENT"

    8 "INVENTORY_STATUS"

    9 "ADJUSTMENT_REASON."

    10 "ADJUSTMENT_SIGN."

    11 "QUANTITY ADJUSTMENT."

    12 'ADJ_QTY_DECIMAL_VALUE '.

    13 FROM external_table

    14 WHERE the LENGTH (total_characters) = 87

    15.

    Created view.

    Scott@orcl12c > SELECT * FROM xtb_invadj_from_pos

    2.

    TRANSACTIONDAT LO LOCA ITE ITEM_VALUE UPC_S IN AD AN ADJ_ ADJUSTME

    -------------- -- ---- --- ------------- ----- -- -- - -------- ----

    20100127181611 ST 6009 SKU 75001056 00 23 - 00000040 0087

    1 selected line.

  • How to get the number of the row selected in the table

    Hello

    I did the data binding for the table using an arrayList. On some lines of a column, the button appears. When the button is clicked I want to know which line is clicked on the buttonm and want the index to use in the java file. Please help on how to do it.

    Hello

    On your table, you can have

    varStatus="rowStatus"
    

    and in the button, set the attribute as follows

    
     
       
     
    
    

    In your managed bean, you can access the index of the selected button

    public void myActionListener(ActionEvent e){
     System.out.println("index :" + e.getComponent().getAttributes().get("index"));
    }
    

    I hope this helps...!

  • Problem with headphone selection if the table has only one row

    Hi all

    I have developed a table in which I use selection listener to perform a task when a line is selected.
    It works fine when I have more than 1 row in the table, but when I did that one line in the table, the listener of selection do not call the corresponding method in the bean.
    I understand this selection event is raised only when the line is changed, but in the case of use when only one line is there, what do I do to make the listener of selection work?

    The selection listener I wrote the code to make the line selected as current line and perform the required task.

    Please suggest a way out of this situation.

    Thanks in advance.

    Hello

    try to remove this table attr

    selectedRowKeys="#{bindings.xxx_VO1.collectionModel.selectedRow}"
    
  • How can single checkbox can be selected in the table with Boolean checkboxes?

    I have a table editable ADF where an attribute is a Boolean checkbox... and stores the value with Y or N.

    Is there a way where the single checkbox must be selected at time of posting?

    For example, in the case its a table of responses to a choice unique to an application of Questionnaire, Question by adding new responses to the table..., the user inserts 3 rows (answers)... then the Boolean checkbox for only one of these 3 rows can be verified.

    Thank you
    DJ

    Since you have an attribute that has the "Y" or "n" for each line.
    When the user selects a line, you must deselect the other lines using the value change listener pro-grammatically.
    If the number of rows is large, it could be performance intensive.

    Thank you
    Nini

  • HW 2 get the value to select only one option selected by the user in the bean support

    IAM using the select only one option button that is filled during execution.

    I want to get the value selected by the user of a choice selection in the bean to support for other operations of... .IAM using this method, but I got a null pointer exception.

    Public Sub test (ValueChangeEvent tokenChange)
    {
    Integer tokenIndex = (Integer) tokenChange.getNewValue ();
    DCIteratorBinding tokenListIter is getBindings1 () .findIteratorBinding ("TokenIDVOIterator");. in this line null pointer exception
    Token of the line = tokenListIter.getRowAtRangeIndex (tokenIndex.intValue ());
    currenttoken = (Number) token.getAttribute ("TokenId");
    System.out.println ("token ID selected:" + currenttoken);

    }

    I want to know if there is any method to get the value of the value selected by the user to select a choice...

    pls help? //

    3 words:

    "research on the forum.

    asked and answered countless times.

  • How can I stretch/tilt a rectangular selection in the preview?

    Hi all

    Q: can you the proportions for a rectangular selection of cut-and - paste be unlocked?

    Formerly, in Snow Leopard 10.6.8 cut and paste a rectangular selection of an image in the preview has resulted a selection with eight points of click-and - drag: one at each corner and one on each side.  By clicking and dragging one of these licences stretching/tilt the value selected in any direction.

    Now, in the current version of El Capitan 10.11.3 preview, dragging these points only expands or collapses the selection and the aspect ratio is locked.  I have the impression I'm missing something very basic, but can't find any way to unlock the proportions for the selection in the drop-down menus or toolbars.

    A minor inconvenience, but boring, as the old function provided an extremely useful tool for making models quick and easy collage images that eventually became the graphic designs.

    Many thanks in advance,

    btambaschi

    MacBook Pro, OS X El Capitan (10.11.3)

    Always stretching works for me, the tilt doesn't.

  • How to view a newly created line only in adf table?

    Hi all

    JDEV 12.1.3.0

    When you drag move a VO on a page as a table of adf, it displays all the lines available in the whole of lines. I want to display only the rows that are newly created in the user interface.

    I achieved this goal by creating a transient "RowStatus" attribute, which will be the State of the entity (0-1 new, unmodified, 2 - modified) and I filtered the table using this status of line by double clicking on the VO and specified a filtered attribute and the value. But the performance is very poor, because I think it makes even all records and only newly created filter lines.

    Is there another way optimized to achieve?

    How to achieve this programmatically?

    If I run VO.executeEmptyRowSet () when the page loads, the table is rendered empty at first, but after call CreateInsert operation, all rows are returned with this new line.

    You see the same behavior if you create lines programmatically (with: vo.createRow (); vo.insertRow (row)) instead of CreateInsert?

    If it does not then only "programmatic" option is probably to set where clause 1 = 2

    Dario

  • Get the first line selected on the CommandButton Click

    Hi guys,.
    My version of jdev is 11.1.1.5.0. I have table on my Page of Adf.

    < af:table value = "#{bindings." MyvwVO1.collectionModel}.

    var = "row" rows = "#{bindings." MyvwVO1.rangeSize}.

    emptyText = "#{bindings." MyvwVO1.viewable? "{'No data to display.': 'Access Denied.'}".

    filterModel = "#{bindings." MyvwVO1.queryDescriptor}.

    queryListener = ' #{bindings. " MyvwVO1.processQuery}.

    filterVisible = "true" varStatus = 'vs' rowBandingInterval = '1 '.

    columnSelection = 'single '.

    Summary = "Table of suppliers.

    selectionListener = "#{bindings." MyvwVO1.collectionModel.makeCurrent}.

    rowSelection = "single" id = "t2".

    "partialTriggers =": soc1: ctb2: cb22.

    fetchSize = "#{bindings." MyvwVO1.rangeSize}.

    Binding = "#{MyBN.supplierTableBinding}" >

    < af:column id = "c14" frozen = "true" align = "center" >

    < af:commandButton action = "viewNext" text = "Next view" id = "cb1" >

    < af:setActionListener from = "#{bindings." CurrSupplierSiteId.inputValue}.

    to = "#{bindings." SupplierSiteID.inputValue} "/ >"

    < af:setActionListener from = "#{bindings." CurrSupplierSiteId.inputValue}.

    to = "#{MyBN.supplier_site_id}" / >

    < / af:commandButton >

    < / af:column >


    When I'm clicking viewNext button. When debugging, I get first line provider site Id instead of the current line selected.

    I also removed the selectedRowKeys of af: table. Now his show is not first line select default, but still get the Site Id of first line supplier back Bean.

    {} public void setSupplier_site_id (number supplier_site_id)

    This.supplier_site_id = supplier_site_id;

    }

    public {getSupplier_site_id() number

    Return supplier_site_id;

    }

    No idea what I'm doing wrong.


    Thank you

    Raul

    you pass line value.right... so from value as link will not be work.try send as #{row.abc.value} go on setactionListener and so on. You pass the rank value.

  • How could I NOT have a scene selection on the main Menu of the DVD?

    With the help of PRE 11.  I have a clip only, with no scenes (imported from a VHS).  When I try to make a DVD, it adds a default scene selection in the main menu of the DVD.  Since there is no 'scenes' (at least I think the scenes on a regular DVD), is anyway to remove/delete button on the main menu scene selection?  All the models that I have seen include the scene selection.

    In the same vein, I import a few VHS convert to DVD that will have several 'clips' on each of them.  For example, "Christmas 1988', ' holiday of summer 1989", etc.»  What I want to do with those, it is having the "clips" separated as a choice on the main Menu of the DVD, and have still no scene selection.

    Is this possible?   Also, I bought a Photoshop/Premiere Elements a few years and a couple of versions ago (because the sale price was the same as Photoshop Elements only).  I just watched the first after installation, didn't really use it, but it seemed to me that there are many more styles DVD.   Can I download other models from Adobe, or is that has come on the DVD there are all?  Is there anyway to make my own, because I don't see just a pattern of single color base type, it's too loud for me.

    Thank you

    I still don't know what you're doing. (Are making sure to turn off the option for the program adds automatically the markers of scene?)

    I just tested myself and certainly do not create a menu if you do not have menu scene marks.

    Can you post a screenshot of your timeline so we can have a look? Make sure that you press on the-key first, so that we see the entire timeline.

Maybe you are looking for

  • Contacts disappeared

    I just went to my Contacts and they were all gone. I have Time Machine backups. What file I'm looking for and where can I find? OS10.9.5, 3.2 GHz Quad-Core Intel Xeon MacPro

  • When I opened a new tab navigation bar is not selected. How can I fix?

    I looked at other issues, but I couldn't find a solution for this. When I opened a new tab, the navigation/URL bar is not selected, and I can't just type to search or enter a URL. I have to move my mouse and select it. This is quite annoying because

  • Thrust of the overall production volume on a MBP?

    is there a way to increase the overall volume of output on a MBP without falling $ 20 on an application? I just need a simple way to get about 50% more in my helmet. I have no eq or other effects.This is for listening to itunes or other multimedia ap

  • Qosmio G30-204 starts with BSOD

    Hello I have a toshiba Qosmio G30-204. It crashed last Friday night, I tried everything since then, including the system recovery disk, nothing seems too much work between the blue screen and a matrix effect in the back round (broken lines going down

  • Defects of driver Deskjet 4580

    I've been a happy owner/user of a computer HP Compaq dx2400 has recently been upgraded to the Windows 7 Basic... Before that, I was using a printer all-in-one Deskjet 4580 (on Windows XP SP3) without problem... However, much to my dismay, I have cont