Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.1
    • Fix Version/s: 1.7.2
    • Component/s: Bridge
    • Labels:
      None
    • Environment:
      ICEfaces

      Description


      Recent work on performance improvements have shown memory consumption with large numbers of similar or identical Strings. In an effort to increase re-use of Strings, some of our JavaScript calls should be examined. For instance:

      <form action="iceSubmit(&#39;j_id56&#39;);"
        - can iceSubmit(this.id) or iceSubmit(form.id) be used?
        - can &#39; be written as '

      <a onclick="document.forms[&#39;iceForm&#39;][&#39;iceForm:_idcl&#39;].value=&#39;iceForm:iceTable:sortByTitle_click&#39;;iceSubmit( document.forms[&#39;iceForm&#39;], this,event); return false;"
        - can we still use iceSubmit(form, this, event) but search for a parent of "this" to find "form"? (Because <a> is not a form control.) iceSubmit could detect that the input control was a commandLink and set the hidden field directly.

      onblur="setFocus(&#39;&#39;);"
        - can this be replaced with "setFocus();"

      iceSubmit(form,this,event);return false;
        - can this be replaced with iceSubmit(form,this,event); or iceSubmitF(form,this,event);

        Issue Links

          Activity

          Hide
          Ted Goddard added a comment -

          Please comment on the opportunities for re-use of JavaScript expressions. If Strings can be re-used, they can be more effectively pooled on the server.

          Show
          Ted Goddard added a comment - Please comment on the opportunities for re-use of JavaScript expressions. If Strings can be re-used, they can be more effectively pooled on the server.
          Hide
          Mircea Toma added a comment -

          I was referring to "iceSubmit could detect that the input control was a commandLink". iceSubmit is already used in few subtle but different ways. Making iceSubmit aware about a specific component would just add another level of complexity to its implementation.
          The commandLink component can be refactored to not use any hidden fields at all. This will also solve some DOM diff problems cause by the hidden fields rendered as direct children of the form.

          Show
          Mircea Toma added a comment - I was referring to "iceSubmit could detect that the input control was a commandLink". iceSubmit is already used in few subtle but different ways. Making iceSubmit aware about a specific component would just add another level of complexity to its implementation. The commandLink component can be refactored to not use any hidden fields at all. This will also solve some DOM diff problems cause by the hidden fields rendered as direct children of the form.
          Hide
          Ted Goddard added a comment -


          It might be interesting to implement the JSF 2.0 commandLink without a hidden field (at the very least, I was thinking that all commandLinks could share a single common field) could you explain the basic idea for the new mechanism? (JSF 2.0 may have a constraint that it should work with JavaScript, but without Ajax – required browser support may extend to browsers without XMLHttpRequest.)

          Show
          Ted Goddard added a comment - It might be interesting to implement the JSF 2.0 commandLink without a hidden field (at the very least, I was thinking that all commandLinks could share a single common field) could you explain the basic idea for the new mechanism? (JSF 2.0 may have a constraint that it should work with JavaScript, but without Ajax – required browser support may extend to browsers without XMLHttpRequest.)
          Hide
          Ted Goddard added a comment -

          Mircea, please comment on the following:

          iceSubmit() return false always.

          iceSubmit(form,this,event) should be iceSubmit(this,event) (obtain form from "this")

          iceSubmit(this,event) detect if "this" is <a> and walk up to obtain the form if this.form is not available

          Show
          Ted Goddard added a comment - Mircea, please comment on the following: iceSubmit() return false always. iceSubmit(form,this,event) should be iceSubmit(this,event) (obtain form from "this") iceSubmit(this,event) detect if "this" is <a> and walk up to obtain the form if this.form is not available
          Hide
          Mircea Toma added a comment -

          " iceSubmit() return false always. "

          That's because the function doesn't return anything. Or maybe it was some historical reason. When I refactored iceSubmit and iceSubmitPartial implementation I kept the behavior intact.

          "iceSubmit(form,this,event) should be iceSubmit(this,event) (obtain form from "this") "

          I agree. But when I did that while refactoring the function there were some components that picked an element outside the form for submission

          "iceSubmit(this,event) detect if "this" is <a> and walk up to obtain the form if this.form is not available "

          There's code in place for doing exactly that. Is just that the components relied on hidden fields every time and anchor <a> was used.

          Show
          Mircea Toma added a comment - " iceSubmit() return false always. " That's because the function doesn't return anything. Or maybe it was some historical reason. When I refactored iceSubmit and iceSubmitPartial implementation I kept the behavior intact. "iceSubmit(form,this,event) should be iceSubmit(this,event) (obtain form from "this") " I agree. But when I did that while refactoring the function there were some components that picked an element outside the form for submission "iceSubmit(this,event) detect if "this" is <a> and walk up to obtain the form if this.form is not available " There's code in place for doing exactly that. Is just that the components relied on hidden fields every time and anchor <a> was used.
          Hide
          Ted Goddard added a comment -

          Could we add the hidden field logic to iceSubmit for commandLink?

          Show
          Ted Goddard added a comment - Could we add the hidden field logic to iceSubmit for commandLink?
          Hide
          Mircea Toma added a comment -

          Remove useless form action pseudo-URL.

          Show
          Mircea Toma added a comment - Remove useless form action pseudo-URL.
          Hide
          Mircea Toma added a comment -

          Reduce amount of Javascript wiring for command links.

          Show
          Mircea Toma added a comment - Reduce amount of Javascript wiring for command links.

            People

            • Assignee:
              Unassigned
              Reporter:
              Ted Goddard
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: