History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-25150
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Maxim Mossienko
Reporter: Mike Hanafey
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

Define external variable in comment annotation

Created: 21 Feb 08 17:23   Updated: 06 Mar 08 23:34
Component/s: Editor. Code Completion, J2EE.JSF
Fix Version/s: Diana 8243, Selena 7.0.4

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Issue Links:
Duplicate
 
This issue is duplicated by:
IDEA-17261 Complition in jsf using @elvariable Resolved

Build: 7,675
Fixed in build: 8,212
Severity: High


 Description  « Hide
When editing JSF views it is often necessary to use a comment annotation to reveal the type of a variable so that IDEA can do the very important code completion and navigation functions. This is often the case with 3rd party JSF components that do some kind of looping, and therefore define a local variable for the scope of the looping.

IDEA comment annotations seem to have no clue about scope. The example below illustrates the problems:

<h:form id="Commentary">
  <rich:tree id="CmtTree" var="citem" value="#{leadReport.lead.commentaryUiTree}" switchType="client"
             nodeFace="#{citem.nodeFace}" adviseNodeOpened="#{leadReport.adviseNodeOpened}">
    <!--@elvariable id="citem" type="genomix.tractor.Lead.CommentUi"-->
    <rich:treeNode id="top" type="top">
      <h:outputText value="#{citem.rootData}"/>
    </rich:treeNode>
    <rich:treeNode id="c" type="c" nodeClass="C-wrappingTreeNode">
      <trak:comment id="cmtNode" lead="#{leadReport.lead}" cmt="#{citem}" reRender="Commentary:CmtTree"/>
    </rich:treeNode>
  </rich:tree>
</h:form>

<h:form id="Sequence">
  <rich:tree id="SeqTree" var="sitem" value="#{leadReport.lead.sequenceUiTree}" switchType="client"
             nodeFace="#{sitem.editable ? 'es' : 's'}" adviseNodeOpened="#{leadReport.adviseNodeOpened}">
    <!--@elvariable id="sitem" type="genomix.tractor.Lead.SequenceUi"-->
    <rich:treeNode id="s" type="s" nodeClass="C-wrappingTreeNode">
      <trak:sequence id="seqNode" lead="#{leadReport.lead}" seq="#{sitem}" reRender="Sequence:SeqTree"/>
    </rich:treeNode>
    <rich:treeNode id="es" type="es" nodeClass="C-wrappingTreeNode">
      <trak:sequenceEditable id="seqEdNode" lead="#{leadReport.lead}" seq="#{sitem}" reRender="Sequence:SeqTree"/>
    </rich:treeNode>
  </rich:tree>
</h:form>

The two rich:tree components define local variable under the attribute "var", and these must artifically be given different names so that different comment annotations can be attached. Ideallly, a comment annotation would only apply to the element (including its attributes) it is contained in.

The EL nodeFace="#{citem.nodeFace}" is fully understood with the comment annotation, but value="#{citem.rootData}" is not understood. In the latter case navigation to its defintion leads you back to var="citem" of the rich:tree, but in the former case navigation is back to the comment annotation. It does not matter where the comment annotation is located. This makes no sense and appears to be just a bug.

Of course it is nice when no comment annotations are needed, but it is a much more serious problem when the annotations cannot be used to put brains in EL expressions.



 All   Comments   Work Log   Change History      Sort Order:
Mike Hanafey - 21 Feb 08 17:30
Another problem is <!-@elvariable id="citem" type="genomix.tractor.Lead.CommentUi"-> refers to innier class CommentUi. IDEA does completion to fill in the "type" attribute, but then it does not allow navigation to CommentUi. All of the preceding terms can be navigated to, but CommentUi is dead.