comboBox generates a table instead of span in readmode web

后端 未结 4 565
遇见更好的自我
遇见更好的自我 2020-12-19 10:24

When viewing a Xpage on the web containing a table with a comboBox in a column the html generated by Domino creates a table for the combobox but a span for other components

4条回答
  •  我在风中等你
    2020-12-19 10:46

    This code will fix all comboboxes on the page with dojo, run onClientLoad:

    if("#{javascript:document1.isEditable()}" == "false"){
        // Search for all nested tables with ids
        dojo.query('table td table[id]').forEach(function(node) {
            var value = '';
    
            // Locate the first table cell, which contains the value
            dojo.query('td:first-child', node).forEach(function(innerNode) {
                value = innerNode.innerHTML;
            });
    
            // Replace the table with only the value (or a blank)
            node.outerHTML = value;
        });
    }
    

    Notes:

    • Update the name of the document in line 1 to match the name of the document on your page.
    • This code assumes that your combobox is already nested in a table cell. If that's not the case, you can refine the selector in line 3.
    • If you run into conflicts with this affecting other tables in your page, you may need to refine the selector in line 3.

提交回复
热议问题