Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
182 views
in Technique[技术] by (71.8m points)

java - How do I make this call between the radio and the text for Docusign

In the code below, I have a RadioGroup, named "Pessoa Politicamente Exposta - Cadastro".

When the person clicks on the radio button with the answer "yes", a text field must appear. I'm trying to use the attributes of RadioGroup conditionalParentLabel and conditionalParentValue, but it does not work.

How do I make this call between the radio and the text?

private List<RadioGroup> getRadioGroups(String numProposta, String seq_envelope) throws Exception {

        List<RadioGroup> radios = new java.util.LinkedList<RadioGroup>();

        String RADIO_GROUPS =
                "SELECT DISTINCT ear.cd_radio, er.ds_radio " +
                        " FROM envelope_assinatura_radio ear " +
                        " left JOIN envelope_radio er on ear.cd_radio = er.cd_radio " +
                        "WHERE ear.cd_envelope = ? " +
                        "  AND ear.seq_envelope = ? ";

        PreparedStatement ps = connection.getConnection().prepareStatement(RADIO_GROUPS);
        ps.setString(1, numProposta);
        ps.setString(2, seq_envelope);

        ResultSet rs = ps.executeQuery();

        String RADIO_GROUP_ITEM =
                "SELECT tag, ds_valor " +
                        "  FROM envelope_assinatura_radio " +
                        " WHERE cd_envelope = ? " +
                        "   AND seq_envelope = ? " +
                        "   AND cd_radio = ? ";

        PreparedStatement psItem = connection.getConnection().prepareStatement(RADIO_GROUP_ITEM);

        while (rs.next()) {

            String cd_radio = rs.getString("cd_radio");
            String ds_radio = rs.getString("ds_radio");

            psItem.setString(1, numProposta);
            psItem.setString(2, seq_envelope);
            psItem.setString(3, cd_radio);

            ResultSet rsItem = psItem.executeQuery();

            RadioGroup group = new RadioGroup();
            group.setRecipientId(seq_envelope);
            group.setGroupName(ds_radio);

            Tabs signerTabs = new Tabs();

            while (rsItem.next()) {
                Radio r = new Radio();
                r.setAnchorString(rsItem.getString("tag"));
                r.setValue(rsItem.getString("ds_valor"));
                //group.conditionalParentLabel("Pessoa Politicamente Exposta - Cadastro");
                //group.conditionalParentValue("Sim_1");

                group.addRadiosItem(r);

            }

            if (group.getRadios().size() > 0) {
                radios.add(group);
            }
        }
        return radios;
    }

private List<Text> getAssinaturaText(String numProposta, String seq_envelope) throws SQLException {
        List<Text> docs = new java.util.LinkedList<Text>();
        String GET_ASSTINATURA_TEXT =

                " SELECT eac.ds_tag " +
                        " FROM envelope_assinatura_text eac" +
                        " WHERE  eac.cd_envelope = ?  " +
                        " AND eac.seq_envelope = ? ";

        PreparedStatement ps = connection.getConnection().prepareStatement(GET_ASSTINATURA_TEXT);
        ps.setString(1, numProposta);
        ps.setString(2, seq_envelope);
        ResultSet op = ps.executeQuery();

            if (op.next()) {
                Text text = new Text();
                text.anchorString(op.getString("ds_tag"));
                docs.add(text);

            }
        return docs;
        }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

My name is Gloriana and I am part of DocuSign's Developer Support team.

In order for this to work correctly, the properties of conditionalParentLabel and conditionalParentValue of the text tab are the ones that have to be populated with the label of the radio button and the value of the radio button that will be in charge of the conditional logic, the radio button itself does not have to have these fields populated. Below is an example on how these should be defined for envelope creation to achieve this behaviour:

"textTabs": [
    {
        "tabLabel": "Text",
        "conditionalParentLabel": "Radio Group1",
        "conditionalParentValue": "Yes",
        "isPrefilledTab": false,
        "fontSize": "size9",
        "underline": false,
        "italic": false,
        "fontColor": "black",
        "bold": false,
        "font": "lucidaconsole",
        "required": true,
        "locked": false,
        "concealValueOnDocument": false,
        "name": "",
        "shared": false,
        "requireAll": false,
        "requireInitialOnSharedChange": false,
        "value": "",
        "validationPattern": "",
        "validationMessage": "",
        "disableAutoSize": false,
        "maxLength": 4000,
        "width": 84,
        "height": 22,
        "mergeFieldXml": "",
        "recipientId": "64895961",
        "pageNumber": 1,
        "documentId": "1",
        "xPosition": 426,
        "yPosition": 116,
        "trackingId": "c275",
        "trackingid": "c275"
    }
],
"radioGroupTabs": [
    {
        "tabLabel": "Radio Group2",
        "conditionalParentLabel": null,
        "conditionalParentValue": null,
        "isPrefilledTab": false,
        "fontSize": "size9",
        "underline": false,
        "italic": false,
        "fontColor": "black",
        "bold": false,
        "font": "lucidaconsole",
        "shared": false,
        "name": "",
        "tooltip": null,
        "recipientId": "1",
        "documentId": "1",
        "groupName": "Radio Group1",
        "width": 0,
        "height": 0,
        "radios": [
            {
                "tabLabel": "Radio Group2",
                "conditionalParentLabel": null,
                "conditionalParentValue": null,
                "isPrefilledTab": false,
                "fontSize": "size9",
                "underline": false,
                "italic": false,
                "fontColor": "black",
                "bold": false,
                "font": "lucidaconsole",
                "shared": false,
                "required": true,
                "locked": false,
                "name": "",
                "selected": false,
                "value": "Yes",
                "tooltip": null,
                "recipientId": "1",
                "pageNumber": 1,
                "documentId": "1",
                "groupName": "Radio Group1",
                "xPosition": 342,
                "yPosition": 103,
                "width": 0,
                "height": 0,
                "trackingId": "c291",
                "trackingid": "c291"
            },
            {
                "tabLabel": "Radio Group2",
                "conditionalParentLabel": null,
                "conditionalParentValue": null,
                "isPrefilledTab": false,
                "fontSize": "size9",
                "underline": false,
                "italic": false,
                "fontColor": "black",
                "bold": false,
                "font": "lucidaconsole",
                "shared": false,
                "required": true,
                "locked": false,
                "name": "",
                "selected": false,
                "value": "No",
                "tooltip": null,
                "recipientId": "1",
                "pageNumber": 1,
                "documentId": "1",
                "groupName": "Radio Group1",
                "xPosition": 342,
                "yPosition": 123,
                "width": 0,
                "height": 0,
                "trackingId": "c292",
                "trackingid": "c292"
            }
        ]

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...