How to update a cell's visibility in a af:table?

The use case is:
A table has 2 columns, 2 rows.
Column 1 is a checkbox.
Column 2 is a choices.
Jdev is 11.1.2.4 & 11.1.1.7
The goal is to update the choices' visibility according to the checkbox selection.
However, when the last line of the JS is executed, choices in both rows are visible (or invisible).
Expected behavior is: only the selected row is updated.
Tried do this at server side but it's not working either.
From IE's debugger, values (like clientId) of all variables are correct as expected.
My code:
  <af:panelStretchLayout id="psl1">
    <f:facet name="bottom">
      <af:resource type="javascript">
      function onSelect(e){
          var checkbox = e.getSource();
          var table = checkbox.getParent();         
          var index = checkbox.getProperty("index");
          var choices = table.findComponent("smc1", index);
          choices.setVisible(checkbox.getValue());         
      </af:resource>
    </f:facet>
    <f:facet name="center">
      <af:table var="row" rowBandingInterval="0" id="t1" value="#{viewScope.bean.rows}" varStatus="vs"
                horizontalGridVisible="false" verticalGridVisible="false">
        <af:column sortable="false" id="c1">
          <af:selectBooleanCheckbox text="" label="" id="sbc1" value="#{row.selected}" clientComponent="true">
            <af:clientAttribute name="index" value="#{vs.index}"/>
            <af:clientListener method="onSelect" type="valueChange"/>
          </af:selectBooleanCheckbox>
        </af:column>
        <af:column sortable="false" id="c2">
          <af:selectManyChoice label="Label 1" id="smc1" clientComponent="true">
          </af:selectManyChoice>
        </af:column>
      </af:table>
    </f:facet>
  </af:panelStretchLayout>

Hi,
Any specific reason why you would want to achieve this using JS? You could very well achieve this by setting autoSubmit to true for the select boolean checkbox and partialTriggers for the select many choice.
Ex :
        <af:column sortable="false" id="c1">
          <af:selectBooleanCheckbox text="" label="" id="sbc1" value="#{row.selected}" autoSubmit="true">
          </af:selectBooleanCheckbox>
        </af:column>
        <af:column sortable="false" id="c2">
          <af:selectManyChoice label="Label 1" id="smc1" partialTriggers="::sbc1" visible="#{row.selected}">
          </af:selectManyChoice>
        </af:column>
-Arun

Similar Messages

  • HT1222 please tellme how to update my cell software send me a tex messege

    please tell me how to up date my software of cell phone
    <Personal Information Edited by Host>

    Which model iPhone?
    What version are you currently running? Settings > General > About > Version.

  • How to update based on condition during insert on child table

    hi all,
    i have three tables, first table enquiry(enqid, item, type) where all enquiries are entered. after that table bom (bomid, item, enqid, rawmatl) and route (bomid, routeid,routename). in this bom & route are Master Detail table, where entries are made on a later period. the requirement is to update 'type' in enquiry table during insert on Route table.
    for 1 row in bom table there will be more than 5 rows in route table. the condition to update type field in enquiry is, scan the first 5 rows of route table during insert and if routename field contains 'JG' the update type with 'J'. if 'JG' is not there scan the same 5 rows for 'ED' and update type with 'E'. if 'ED' is not there scan for 'CN' and update type with 'C' like this 3 more to test and update.
    thanks in adv. am on 8i
    Kris

    yes, trigger or proc. or package
    any idea how to do this...?

  • How to update for single batch id in one a table by using mutiple parametrs

    Hi Everyone,
    I need simple pl/sql logic to update one table using with some parametrs.I need a logic for single batch_id there will be 100 of records are there .how do i update my custom table ? how do i show how many records have been updated for each batch ? how to handle excpetions while updating ?Som body could help me it will be great.
    -- Sample Code
    PROCEDURE UPDATE_table (P_IN_BATCH_ID IN Number,
    P_IN_TRANS_ID IN number,
    P_IN_TRANS_STATUS IN varchar2,
    P_IN_ERROR_MSSG IN varchar2
                                                 ) is
    cursor
    select*from xx_cust_table
    BEGIN
    UPDATE xx_cust_table
    SET TRANSMISSION_ID=P_IN_TRANS_ID
    TRANSMISSION_MSG=P_IN_TRANS_STATUS     
    PROCESSED_FLAG=P_IN_ERROR_MSSG
    where BATCH_ID=P_IN_BATCH_ID
    END UPDATE_table;

    PROCEDURE UPDATE_table (P_IN_BATCH_ID IN Number,
    P_IN_TRANS_ID IN number,
    P_IN_TRANS_STATUS IN varchar2,
    P_IN_ERROR_MSSG IN varchar2
    ) IS
    BEGIN
    UPDATE xx_cust_table
           SET TRANSMISSION_ID=P_IN_TRANS_ID
                  TRANSMISSION_MSG=P_IN_TRANS_STATUS
                   PROCESSED_FLAG=P_IN_ERROR_MSSG
      WHERE BATCH_ID=P_IN_BATCH_ID;
    DBMS_OUTPUT.PUT_LINE(SQL%ROWCOUNT||' rows updated!');
    --EXCEPTION
    --  WHEN DUP_VAL_ON_INDEX THEN
    --    DBMS_OUTPUT.PUT_LINE('Duplicate value');
    --  WHEN OTHERS THEN
    --   <display sqlcode and sqlerrm>
    END UPDATE_table;

  • How to update values for qty n batch in mska table

    Hi experts,
    i would lke to know is it possible that we can update value of availabity of stock which is existing batch wise in MSKA table field 'kalab' (qty) n charg (batch).
    i mean we have devided material per document number into batch a b c.
    suposse
    we have '20015' material
    for doc1 (vbeln) -- A qty 5
    B qty 5
    C qty 0
    for doc2 (vbeln) A qty 2
    C qty 5
    B qty 0
    But after delivery we want to change the distribution of stock material like .
    for doc1 A qty 2
    B qty 3
    C qty 5
    and for doc2 A qty 5
    B qty 2
    C qty 0
    i create one programe and check the availabity in mska table n give input field to reorder the batch n quantity but how should i send these values in mska table so that sap will show the correct availabity of stock batch wise.
    if somebody did it before. through ur input please .
    Thanks.
    Seema

    Hi sutar,
    Seems it is not WD related Question.
    You are updating two tables here, but not updating in Database. check two tables how they are related.
    and mysuggestion is try to update thease two tables by using code in se38. you will get where the problem is.
    Cheers,
    Kris.

  • How to disable selective cells in a column of a table?

    Hi
    I have a Table UI element having 5 columns. 4 of this are non-editable and only one is editable i.e. having input field . The data is picked from the backend. The 5th column also gets default data from the backend, which the user can later on change.
    But there is a condition, that only the input fields from that row onwards should remain enabled whose month field matches the current month. Rest all should become disabled or invisible.
    I worte the code in the wdModifyView() which picks the current date, and then in a loop it checks all the rows for the condition. If it matches the condition, it comes out of the loop, else it sets the enable property of input field to false.
    But when i run this application, all the cells become disabled, not selective cells.
    Is there a way in which I can sort this problem, any API using which i can access each cell by its row number and column number and then disable it.
    If anybody could please help, it is urgent.
    Thanks & regards,
    Anupreet

    Anupreet,
    Create a subnode with cardinality 1..1 and boolean attribute IsEnabled right under your data node. Write a supply function for this subnode, and set boolean attribute value depending on month in parentElement (parameter of supply function). Then bind InputField "enabled" property to this boolean attribute.
    VS

  • How to update (add new data in different tab) existing table from Excel

    i've an existing table, for instance User Profile table, it consists of few tab in the table which contains different data... recently i've added new tab to the existing table and i would like to upload a particular data for this new tab... is there any way to upload (insert new data for the tab on existing data) this particular data into the existing table from Excel file?
    could it be done by using lsmw?
    Edited by: Yeong Kang Liew on Apr 5, 2010 4:35 AM

    Check HELP on MODIFY & UPDATE statements.

  • How to update CheckBox value change in report in DB table

    Hi;
    I have created a tabular form & added a check box in my Select statment...also i created a procedure On Submit to update my table according to the checkbox values..
    My problem is that the update statment is updating the whole records in the form not only the changes which i done
    Any one can give me the key for the update statment?
    Regards;
    Ehammad

    Did any one tried to implement the same example of dkubicek?!! i tried to do the same code but i have problem (f011) should be identified!!!
    does any1 have any idea about kind of this error?
    Regards;

  • How to manipulate jtable cell?

    Hi experts,
    I created a jtable with a BC4J related to the jtable.
    I do not know how to update a cell and how to insert a new row in the jtable.
    Would someone please tell me where I can find the document about manipulating a jtable?

    Have a look at the source code of JUNavigationBar. In that class, look for JUActionBinding(_buttons[BUTTON_FIRST]   , bind, JUActionBinding.ACTION_FIRST, false);As you can see you will need the JUActionBinding class.

  • How to update fields in the target table in correspondance with the source file values

    Environment: win7, SQL server 2008 R2
    Application: Microsoft Management SQL Studio 2008 R2, Business Intelligence 2008 - SSIS
    SSIS competency level: Novice
    Problem: I have been trying to update some of the fields in the destination table,student table, in reference to data set in the staging table and ssn table.  I was able to insert/load new data to the destination using look up transformation
    while the driver is ssn (data mapping) but i couldn't know how to update some of the fields in the student table while keeping the orignal pn_id of both tables(ssn and student tables), because pn_id already exists in the SSN table and student table. There
    are other records also associated with the pn_id so I am not allowed to update the pn_id in the destination tables. For example,
    SSN Table (pn_id,ssn)
    ('000616850',288258466)
    ('002160790',176268917)
    Staging Table (ssn, id, pn_id, name, subject, academic year, comments)
    (288258466, 1001, '770616858',Sally Johnson, English,A, 2005,'great student')
    (176268917, 1002, '192160792',Will Smith, Math,38000,C, 2014,'no comments')
    (444718562, 1003, '260518681',Mike Lira, Math,38000,B, 2013,'no comments')
    Student Table (destination table)(id,pn_id,subject,academic year, grade, comments):
    (1001, '000616850', ' ',' ', ,'')
    (1002, '002160790', ' ',' ', ,'')
    Expected Results:
    My goal is to have student table updated as the following:
    Student Table
    (1001, '000616850', 'English','A' ,2005 ,'great student')
    (1002, '002160790', 'Math ',' C',2014 ,'no comments')
    please advise

    Why can't you use simple UPDATE command in EXECUTE SQL Task as below,
    DROP TABLE SSN
    DROP TABLE STAGING
    DROP TABLE STUDENT
    CREATE TABLE SSN(pn_id VARCHAR(100),ssn BIGINT)
    INSERT INTO SSN VALUES('000616850',288258466)
    INSERT INTO SSN VALUES('002160790',176268917)
    CREATE TABLE Staging (ssn BIGINT, id INT, pn_id BIGINT, name VARCHAR(100), subject VARCHAR(100),grade VARCHAR(10), [academic year] INT, comments VARCHAR(100))
    INSERT INTO Staging VALUES(288258466, 1001, '770616858','Sally Johnson', 'English','A', 2005,'great student')
    INSERT INTO Staging VALUES(176268917, 1002, '192160792','Will Smith', 'Math','C', 2014,'no comments')
    INSERT INTO Staging VALUES(444718562, 1003, '260518681','Mike Lira', 'Math','B', 2013,'no comments')
    CREATE TABLE Student(id INT,pn_id BIGINT,subject VARCHAR(100), [academic year] INT, grade VARCHAR(10), comments VARCHAR(100) )
    INSERT INTO Student VALUES(1001, '000616850', NULL,NULL,NULL ,NULL)
    INSERT INTO Student VALUES(1002, '002160790', NULL,NULL,NULL ,NULL)
    UPDATE Student SET Subject = C.Subject, [academic year]=C.[academic year], grade=C.grade,comments=C.comments
    FROM SSN A INNER JOIN Student B
    ON A.pn_id=B.pn_id INNER JOIN Staging C
    ON A.ssn = C.ssn
    SELECT * FROM Student
    Regards, RSingh

  • How to updated the data into Database table

    Hi Guy's,
    Please help me Using Tabstrip control how to updated the related infotype records into related database table.
    Thanks and Regards,
    Sai.

    Hi Guy's,
    Please help me Using Tabstrip control how to updated the related infotype records into related database table.
    Thanks and Regards,
    Sai.

  • How to update a specific cell value in a CSV file.

    Hi
    I would like to know whether it is possible in openscript to update a cell value of the CSV file.
    For example if the test script requires to update the cell of 6th row and 8th column, then how to achieve through openscript API?
    Please kindly let me know.

    Hi,
    Hope this helps!
    Table table;
    String[] rowvalus;
    int targetRow=5,targetColumn=7;
    * Note: Rows and columns are 0-based index.
    table =utilities.loadCSV("C:\OracleATS\OFT\DataBank\Test.csv");
    rowvalus=table.getRows().get(targetRow).getAll();
    info("Before change :"+rowvalus[targetColumn]);
    rowvalus[targetColumn]="NewValue";
    utilities.saveCSV(table, "C:\OracleATS\OFT\DataBank\Test.csv", true);
    table =utilities.loadCSV("C:\OracleATS\OFT\DataBank\Test.csv");
    rowvalus=table.getRows().get(targetRow).getAll();
    info("After change :"+rowvalus[targetColumn]);
    Note:- Please first take the backup of your CSV file before using this code snippet
    Thanks
    -POPS

  • TableView - How to update a running balance column after any other column in the view is re-sorted

    To keep this simple and to illustrate a problem that I am trying to solve let's say we have
    a domain class that contains an income per day.
    This class has two persistent properties - populated from a database table - date and income.
    And there is one transient property - running balance - that shows the accumulated income
    starting from the first record. This property is not persisted and it is used only to show
    the running/accumulated income in a table view.
    This domain object is shown in a table view with three columns:
         - date
         - income
         - running balance
    The first two columns - date and income - are sortable. When the user clicks on the column
    heading these can will be sorted in ascending or descending order. The running balance
    column needs to reflect this change and be correctly updated.
    So the question is : how would you implement the running balance update after the data in
    the table has been updated by the user?
    Take 1)
    =============
    The obvious approach is to use "setOnSort" method to consume the SortEvent event and re-sort the
    data but the sort-event does not contain any useful information that would tell from which column
    the sort event originated.
    Take 2)
    =============
    Found a possible solution:
         - TableView.getSortOrder() returns a list that defines the order in which TableColumn instances are sorted after the user clicked one or more column headings.
         - TableColumn.getSortType() returns the sort type - ascending/descending.
         - This info can be used in the TableView.setOnSort() event handler to re-sort the data and update the balance at the same time.
    Take 3)
    =============
    When the TableView.setOnSort() event handler is called the data is already sorted therefore the only thing that needs to be done is to update the running balance.

    I  think I understand what you're trying to do. If I've missed it, apologies, but I think this will provide you with something you can work from anyway.
    I would listen to the data instead of watching specifically for sorting. This will be much more robust if you add new functionality later (such as adding and removing rows, editing the data that's there, etc).
    Specifically, for the runningBalance column, create a cellValueFactory that provides a DoubleBinding; this binding should listen for changes to the data and compute the value by running through the table's items up to the point of the item for which it's displaying the value. (Hope you can untangle that sentence.)
    Example. The important part is the cellValueFactory for the cumulativeAmountCol. I guess I should mention that you shouldn't try this exact approach with very large tables as the performance might be pretty bad (computations of the order of n x m on changing data, where n is the number of rows in the table and m is the number of visible rows in the table).
    import java.text.DateFormat;
    import java.text.NumberFormat;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Random;
    import javafx.application.Application;
    import javafx.beans.Observable;
    import javafx.beans.binding.DoubleBinding;
    import javafx.beans.property.DoubleProperty;
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.SimpleDoubleProperty;
    import javafx.beans.property.SimpleObjectProperty;
    import javafx.beans.value.ObservableValue;
    import javafx.collections.FXCollections;
    import javafx.scene.Scene;
    import javafx.scene.control.TableCell;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableColumn.CellDataFeatures;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.layout.BorderPane;
    import javafx.stage.Stage;
    import javafx.util.Callback;
    public class CumulativeTableColumnExample extends Application {
      private final static int NUM_ITEMS = 20 ;
    @Override
      public void start(Stage primaryStage) {
      final TableView<LineItem> table = new TableView<>();
      // using the extractor here makes sure the table item list fires a list changed event if any amounts change
      // this enables the cumulative amount column to keep up to date when the amount in a different row changes.
      table.setItems(FXCollections.observableList(createRandomData(), new Callback<LineItem, Observable[]>() {
          @Override
          public Observable[] call(LineItem item) {
            return new Observable[] {item.amountProperty()};
      final TableColumn<LineItem, Date> dateCol = new TableColumn<>("Date");
      final TableColumn<LineItem, Number> amountCol = new TableColumn<>("Amount");
      final TableColumn<LineItem, Number> cumulativeAmountCol = new TableColumn<>("Cumulative Amount");
      table.getColumns().addAll(Arrays.asList(dateCol, amountCol, cumulativeAmountCol));
      dateCol.setCellValueFactory(new PropertyValueFactory<LineItem, Date>("date"));
        amountCol.setCellValueFactory(new PropertyValueFactory<LineItem, Number>("amount"));
        cumulativeAmountCol.setCellValueFactory(new PropertyValueFactory<LineItem, Number>("amount"));
        cumulativeAmountCol.setSortable(false); // otherwise bad things might happen
      final DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
      dateCol.setCellFactory(new Callback<TableColumn<LineItem, Date>, TableCell<LineItem, Date>>() {
          @Override
          public TableCell<LineItem, Date> call(TableColumn<LineItem, Date> col) {
            return new TableCell<LineItem, Date>() {
              @Override
              public void updateItem(Date date, boolean empty) {
                super.updateItem(date, empty);
                if (empty) {
                  setText(null);
                } else {
                  setText(dateFormat.format(date));
      cumulativeAmountCol.setCellValueFactory(new Callback<CellDataFeatures<LineItem, Number>, ObservableValue<Number>> () {
          @Override
          public ObservableValue<Number> call(CellDataFeatures<LineItem, Number> cellData) {
            final LineItem currentItem = cellData.getValue() ;
            DoubleBinding value = new DoubleBinding() {
                super.bind(table.getItems());
              @Override
              protected double computeValue() {
                double total = 0 ;
                LineItem item = null ;
                for (Iterator<LineItem> iterator = table.getItems().iterator(); iterator.hasNext() && item != currentItem; ) {
                  item = iterator.next() ;
                  total = total + item.getAmount() ;
                return total ;
            return value;
        final NumberFormat currencyFormat = NumberFormat.getCurrencyInstance();
      // generics hell.. can't wait for lambdas...
      final Callback<TableColumn<LineItem, Number>, TableCell<LineItem, Number>> currencyCellFactory = new Callback<TableColumn<LineItem, Number>, TableCell<LineItem, Number>>() {
          @Override
          public TableCell<LineItem, Number> call(TableColumn<LineItem, Number> column) {
            return new TableCell<LineItem, Number>() {
              @Override
              public void updateItem(Number amount, boolean empty) {
                if (empty) {
                  setText(null) ;
                } else {
                  setText(currencyFormat.format(amount));
        amountCol.setCellFactory(currencyCellFactory);
        cumulativeAmountCol.setCellFactory(currencyCellFactory);
        BorderPane root = new BorderPane();
      root.setCenter(table);
      primaryStage.setScene(new Scene(root, 600, 400));
      primaryStage.show();
      public List<LineItem> createRandomData() {
        Random rng = new Random();
        List<LineItem> items = new ArrayList<>();
        for (int i=0; i<NUM_ITEMS; i++) {
          Calendar cal = Calendar.getInstance();
          cal.add(Calendar.DAY_OF_YEAR, rng.nextInt(365)-365);
          double amount = (rng.nextInt(90000)+10000)/100.0 ;
          items.add(new LineItem(cal.getTime(), amount));
        return items ;
      public static void main(String[] args) {
      launch(args);
    public static class LineItem {
        private final ObjectProperty<Date> date ;
        private final DoubleProperty amount ;
        public LineItem(Date date, double amount) {
          this.date = new SimpleObjectProperty<>(this, "date", date);
          this.amount = new SimpleDoubleProperty(this, "amount", amount);
        public final ObjectProperty<Date> dateProperty() {
          return date;
        public final Date getDate() {
          return date.get();
        public final void setDate(Date date) {
          this.date.set(date);
        public final DoubleProperty amountProperty() {
          return amount ;
        public final double getAmount() {
          return amount.get();
        public final void setAmount(double amount) {
          this.amount.set(amount);

  • How to update ADF VO object to refresh the data in ADF Pivot table

    I need to know how to update the View object so that the date in pivot table is refreshed/updated/filtered.
    here are the steps I performed to create ADF pivot table application using VO at design time.
    1) created a collection in a Data Control (ViewObject in an ApplicationModule) that provides the values I wanted to use for row and column labels as well the cell values (Used the SQL query)
    2) Dragged this collection to the page in which wanted to create the pivot table
    3) In the pivot table data binding editor specified the characteristics of the rows (which attribute(s) should be displayed in header), the columns (likewise) and the cells.
    Now, I have a requirement to update/filter the data in pivot table on click of check box and my question is how to I update the View object so that the date in pivot table is refreshed/updated/filtered.
    I have got this solution from one of the contact in which a WHERE clause on an underlying VO is updated based upon input from a Slider control. In essence, the value of the control is sent to a backing bean, and then the backing bean uses this input to call the "filterVO" method on the corresponding AppModule:
    but, I'm getting "operationBinding" object as NULL in following code. Please let me know what's wrong.
    here is the code
    Our slider component will look like
    <af:selectBooleanCheckbox label="Unit" value="#{PivotTableBean.dataValue}"
    autoSubmit="true" />
    The setDataValue() method in the backing bean will get a handle to AM and will execute the "filterVO" method in that, which takes the NumberRange as the input parameter.
    public void setDataValue(boolean value) {
    DataValue = value;
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = (OperationBinding)bindings.getOperationBinding("filterVO");
    Object result = operationBinding.execute();
    The filterVO method in the AMImpl.java will get the true or false and set the where Clause for the VO query to show values.
    public void filterVO(boolean value) {
    if (value != null) {
    ViewObjectImpl ibVO = getVO1();
    ibVO.setWhereClause("PRODUCT_TOTAL_REVENUE(+) where rownum < 10");
    ibVO.executeQuery();
    }

    Did you define a filterVO action in your pagedef.xml file?
    You might want to read on how to access service method from a JSF Web Application in the ADF Developer Guide for 10.1.3 chapter 8.5

  • How to change the cell value in Excel Sheet in WD Java?

    HI,
    I have an application which is used to upload and download excel sheet.I can upload the excel sheet through Upload UI element and also able to download the same file through Download UI.But before download I want to validate the excel sheet.If data is not proper in the excel then I have to put some comment (cell comment).I am able to read each cell value,but not ble to put any comment.Once I pt commen in the cell,the download file should display the commented in the excel sheet.
    Please let me know how to update hte excel sheet.
    Sandip

    hi Sandeep,
    I'm not sure about the HSSF apis, however, i inserted the Cell Comments using jexcel apis. There is a method setComment(java.lang.String s, double width, double height) in class WritableCellFeatures using which you can insert cell comments
    For more details refer [link|http://jexcelapi.sourceforge.net/resources/javadocs/current/docs/jxl/write/WritableCellFeatures.html]
    Abhinav

Maybe you are looking for