Details
-
Bug
-
Resolution: Done
-
Major
-
3.3.0.Beta2
-
None
Description
Case 1.
EXECUTE: Write <p>#
EXECUTE: Find this text in Visual editor and double click against 'name' in the second instance of EL.
ASSERT: Source of bean 'employee' is open with method getName() selected.
FAILURE: Source of bean 'user' is open, no method is selected.
Case 2.
EXECUTE: <h:outputLabel value="#{user.name}
" /> in a page. (or h:outputText)
EXECUTE: Find this text in Visual editor and double click against 'name'.
ASSERT: Source of bean 'user' is open with method getName() selected.
FAILURE: Source of bean 'user' is open, but no method is selected.
Methods DocbookTextTemplate.getSourceRegionForOpenOn() and AbstractEditableJsfTemplate.getSourceRegionForOpenOn() find position for open-on as TextUtil.getStartELDocumentPosition(sourceNode), which finds first occurence of '#
{' and first non-space symbol after it; the exact position of double click is neglected. The two cases above can be fixed by {code}Point selection = pageContext.getSourceBuilder().getSelectionRange();
if(selection != null)
inserted in the beginning of these methods, because double click in Visual part selects a word, so that selection in source is correct.
Unfortunately, there are other cases, e.g. <h:inputText value="#
{user.name}"/> (or h:commandButton, h:inputTextArea, etc.). In these cases, double click does not select a word, so that source selection will not be correct. Why? Attribute 'value' that is used for rendering these elements is often bound by EL to a bean property. I suggest that selecting/editing text in 'value' in h:inputText (as well as in all similar cases) be implemented as it is in h:outputText.