Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      javascript

      Description

      Reference:

      Patrick Wilson wrote:
      Ya I was able to get around that by doing the following:

      if(i > 10)

      or

      if(disabled && rendered)

      but that is not very readable.

      usually you can just wrap script in a CDATA block and the parser should ignore it but for some reason I have been unable to make that work properly. For example:

      <script><![CDATA[
      ...
      script goes here
      ...
      ]]>
      </script>

      but the icefaces parser blows up with some parsing exception and the page will result in a 503. I think that ultimately we need to make the parser respect a CDATA section and that should be fine (I don't think script outside of a CDATA section is valid XHTML anyway.

      Patrick

      Adnan Durrani wrote:
      > Another thing worth mentioning is that currently you can not put "<" or "&" in our JSP. If you put any of the above character in the JSP the parser will complain about it. Which mean developer can't even use such basic expression in the script node:
      > - if(i < 10)
      >
      > - if(disabled && rendered)
      >
      >
      > Adnan
      >
      > Patrick Wilson wrote:
      >> I agree with Ted,
      >>
      >> It took many long hours of frustration to get anything non trivial to work properly. the scoping differences of the eval function between browsers was a major source of headache. I found this resource very useful: http://piecesofrakesh.blogspot.com/2008/10/understanding-eval-scope-spoiler-its.html.
      >>
      >> I am not sure what a good API for this would look like but it would be nice if our bridge could eaither standardize the scope of javascript to run globally (as would be the case if a script tag was executed by the browser in a standard document) or at least offer the developer some way to register a variable in a global registry and return a handle:
      >>
      >> var handle = Ice.createGlobal("handle");
      >>
      >> thoughts?
      >>
      >> Patrick
      >>
      >> ps: I am not the best javascript developer in the world so go easy on me ;-) .
      >>
      >>
      >> Ted Goddard wrote:
      >>>
      >>> We should definitely take this under consideration for new component
      >>> ideas (first compare with what can be done with the standard JSF 2.0 tags).
      >>>
      >>> (For instance, the developer should be isolated from the tricks that
      >>> Adnan mentioned.)
      >>>
      >>> Ted.
      >>>
      >>> On 6-Jul-09, at 2:49 PM, Product Support wrote:
      >>>
      >>>> Hey guys,
      >>>>
      >>>> From what I understand, the customer is looking for a javascript onLoad type mechanism that will be called on render of this facelet composition component and would like the javascript included within the xhtml file. Has anyone ever tried this in the past? Any suggestions? Here is his original email:
      >>>>
      >>>> Is there a possibility to add a JavaScriptContext tag to icefaces such that if a facelet component requires javascript and it is displayed then that would cause the javascript to execute (ie: rather than use backing bean)
      >>>>
      >>>> I'd like to be able to do something like
      >>>>
      >>>> <ice:javascriptHead>
      >>>> alert('hello');
      >>>> </ice:javascriptHead>
      >>>>
      >>>> or
      >>>>
      >>>> <ice:javascriptInline>
      >>>> alert('hello');
      >>>> </ice:javascriptInline>
      >>>>
      >>>> or
      >>>>
      >>>> <ice:javascript src="/contextrelativepath/sample.js"/>
      >>>>
      >>>> right in the xhtml facelet file...
      >>>>
      >>>>
      >>>> Thanks,
      >>>>
      >>>> Ty
      >>>
      >

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Adnan Durrani
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: