• 1 reply
  • Latest Post - ‏2013-01-03T15:22:42Z by Michael_P
9029 Posts

Pinned topic Retrieving data from checked values in View and Form

‏2012-12-14T14:48:06Z |

I have a View and Form builder which displays data retrieved from a database. I have used DCM and then DCF to add checkboxes.
Now, I'm trying to retrieve the selected or the checked rows from the page. How do I do that? How do I show those particular rows in a new page?

Also, is there a way I can retrieve values from the selected rows and insert them in database?
Updated on 2013-01-03T15:22:42Z at 2013-01-03T15:22:42Z by Michael_P
  • Michael_P
    17 Posts

    Re: Retrieving data from checked values in View and Form

    Here is some rough code to get the values in a LJO:

    // ixmlListVariable will be in this format: MyConsumerGetListOperationResults
    // selectedInput is the name of your checkbox field

    IXml row = webAppAccess.getVariables().getXml(ixmlListVariable);
    if (row == null) {
    return null;
    row = row.findElement("RowSet/Row");

    int i = 1;
    while ( row != null ) {
    String selectedField = webAppAccess.getRequestInputs().getInputValue(selectedInput + "_" + i);

    // check if the checkbox was checked
    if ( selectedField != null && selectedField.equalsIgnoreCase("true") ) {
    String valuefromRow = row.getText(inputName);
    // Do something with the selected row values
    row = row.getNextSiblingElement();