• Getting column values from a JDBC Query View

    By Cameron Donnelly 1 decade ago

    Hi,

     

    I have set up a connection to a SQL Server database, and have built a ViewPanel that queries the database to display the data.  Now what I'd like to do is, when a column is clicked, return the values to another window.  Just having problems picking up the the column values.  Have tried

     

    var name='#{javascript:rowData.getColumnValue("PROJECT_NAME")}';

     

    where rowData is the variable for the viewPanel and PROJECT_NAME is the name of the column.  Am getting an error on this line

     

    Error while executing JavaScript action expression
    Script interpreter error, line=1, col=9: Unknown member 'getColumnValue' in Java class 'com.ibm.xsp.extlib.jdbc.model.JdbcDataBlockAccessor'

     

    What's the correct way to get the value?

     

    Thanks for any help

    • Have you tried @JdbcDbColumn() function?

      By Paul Hannan 1 decade ago
      • Using @JDBCColumn

        By Cameron Donnelly 1 decade ago

        Hi Paul,

         

        Thanks for the suggestion, but I think I'd be faced with the same problem - using a column value to use as a key in the @JDBCColumn command to return the value I want.

         

        Regards,

         

        Cameron

        • Got it

          By Cameron Donnelly 1 decade ago

          It's the view variable name plus the column name... eg row.PROJECT_CODE