Search in sources :

Example 1 with InputHtmlSetCheckedStatement

use of com.twinsoft.convertigo.beans.statements.InputHtmlSetCheckedStatement in project convertigo by convertigo.

the class EventStatementGenerator method addInputCheckbox.

public void addInputCheckbox(String selectBy, String selectType, boolean checked) {
    String xpath = getXPath("INPUT", selectBy, selectType);
    AbstractEventStatement stat = new InputHtmlSetCheckedStatement(xpath, checked);
    addStatement(stat);
}
Also used : InputHtmlSetCheckedStatement(com.twinsoft.convertigo.beans.statements.InputHtmlSetCheckedStatement) AbstractEventStatement(com.twinsoft.convertigo.beans.statements.AbstractEventStatement)

Example 2 with InputHtmlSetCheckedStatement

use of com.twinsoft.convertigo.beans.statements.InputHtmlSetCheckedStatement in project convertigo by convertigo.

the class EventStatementGenerator method addInputRadio.

public void addInputRadio(String selectBy, String selectType, int check_index, String[] values) {
    String comment = "";
    for (int i = 0; i < values.length; i++) comment += Integer.toString(i + 1) + " -> '" + values[i] + "'\n";
    String var_name = addVariableFormPrefixe(selectType, Integer.toString(check_index + 1));
    String xpath = null;
    if (elementXpath == null) {
        xpath = (formName == null ? "'" : formName + " + '");
    } else {
        xpath = "'" + elementXpath + "/ancestor::FORM[1]";
    }
    xpath = "'(' + " + xpath + "//INPUT[@" + selectBy + "=\"" + selectType + "\" and @type=\"radio\"])['+" + var_name + "+']'";
    AbstractEventStatement stat = new InputHtmlSetCheckedStatement(xpath, true);
    stat.setComment(comment);
    addStatement(stat);
}
Also used : InputHtmlSetCheckedStatement(com.twinsoft.convertigo.beans.statements.InputHtmlSetCheckedStatement) AbstractEventStatement(com.twinsoft.convertigo.beans.statements.AbstractEventStatement)

Aggregations

AbstractEventStatement (com.twinsoft.convertigo.beans.statements.AbstractEventStatement)2 InputHtmlSetCheckedStatement (com.twinsoft.convertigo.beans.statements.InputHtmlSetCheckedStatement)2