click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Schellink (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CLK-735) TabbedForm does not work with JavaScript validation
Date Wed, 22 Dec 2010 12:47:01 GMT

    [ https://issues.apache.org/jira/browse/CLK-735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974174#action_12974174
] 

Bob Schellink commented on CLK-735:
-----------------------------------

Nice patches Tomasz, very nice. I'll start integrating them soon. The #macro is a good idea
to cleanup some of the repetitive markup in TabbedForm.htm.

Couple of nights ago I worked on a JS version for finding the parent sheet. I'll paste it
below for reference. Looking at your patch we could change it slightly to use the following
function to lookup the tab instead of passing the field names array:

  onShowTab(Click.getTabSheetNumber(' + fieldId + '))

Click.getTabSheetNumber=function(id) {
    var node=document.getElementById(id);
    if(!node) return 1;
    var parent = node.parentNode;
    while(parent && !Click.isTabSheet(parent)) {
        parent = parent.parentNode;
    }
    if (parent) return parent.getAttribute("id").substr(10);
    return 1;
}

Click.isTabSheet=function(node) {
    if(!node) return false;
    var id=node.getAttribute('id');
    if(id){
        if(id.indexOf('tab-sheet-')>=0) return true;
    }
    return false;
}

Anyway, something to ponder a bit.

Kind regards

Bob

> TabbedForm does not work with JavaScript validation
> ---------------------------------------------------
>
>                 Key: CLK-735
>                 URL: https://issues.apache.org/jira/browse/CLK-735
>             Project: Click
>          Issue Type: Bug
>          Components: extras
>    Affects Versions: 2.3.0-M1
>            Reporter: Bob Schellink
>            Priority: Minor
>             Fix For: 2.3.0-RC1
>
>         Attachments: control_js.patch, tabbed-form-demo_htm.patch, TabbedForm_htm.patch,
TabbedForm_java.patch, TabbedFormDemo_java.patch
>
>
> Reported by Tomasz Bandura on the mailing list:
> http://click.markmail.org/thread/5gimf2vn2y5yozzy
> The TabbedForm.htm should check if $form.isJavaScriptValidation is on and render the
html markup:
> <tr style="display:none" id="$form.getId()-errorsTr">
>   <td width='100%' align="$form.getErrorsAlign()">
>     <div class="errors" id="$form.getId()-errorsDiv"></div>
>   </td>
> </tr>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message