[jboss-user] [JBoss Tools] - JSF 2.0 and other issues in Visual Editor

henk de boer do-not-reply at jboss.com
Sat Jan 29 10:59:02 EST 2011


henk de boer [http://community.jboss.org/people/henk53] created the discussion

"JSF 2.0 and other issues in Visual Editor"

To view the discussion, visit: http://community.jboss.org/message/584074#584074

--------------------------------------------------------------
When using JSF 2.0 & Facelets, a few problem occur in the JBoss Tools Visual Editor. I'm using 3.2 CR1.

*EL methods with parameters*

When I call a method via EL with parameters (which thus results in a value) an error is flagged:

 http://community.jboss.org/servlet/JiveServlet/showImage/2-584074-11266/el_parameters.png  http://community.jboss.org/servlet/JiveServlet/downloadImage/2-584074-11266/450-54/el_parameters.png 

Because a method is involved, the editor seems to think it's a method expression, but this is clearly not the case. Even with the == operator no method expression is involved here. The == operator should even make it more clear the component to which this EL expression is bound will receive a value.

Needless to say, the code runs perfectly well on JBoss AS 6.


*Annotated managed beans*

When I annotate a JSF managed bean instead of declaring it in faces-config.xml, the editor does not seem to have any knowledge of the bean. Neither navigate into and auto-completion work. E.g. if I have the following bean:


import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.event.ActionEvent;
 
@ManagedBean
@ViewScoped
public class MyBean {
 
          public String getFoo() { return "foo"; }
          public void setFoo(String foo) {}
 
}
 


And a simple Facelet using this bean:


<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core">

  <h:body>  
      <h:outputText value="#{myBean.foo}" />  
  </h:body>
</html>



Then I can't do anything in the editor with "myBean". Here too, the code runs fine on JBoss AS 6.

*Implicit EL Objects*

The editor does not seem to have full knowledge about the EL implicit objects. When trying to auto-complete an EL expression bound to a component, e.g. <h:outputText value="#{...}"/> certain EL implicit objects pop up, but others not.

Available are:

* applicationScope
* component
* cc
* cookie
* facesContext
* flash
* header
* headerValues
* initParam
* param
* paramValues
* requestScope
* resource
* sessionScope
* view
* viewScope

Missing are thus:

* application
* request
* session

Then for some of those implicit EL objects it makes sense to be able to navigate into them and have auto-completion. This is exactly what the default Eclipse 3.6.1 "HTML Editor" allows. E.g. navigating into +view+ would bring me to UIViewRoot and navigating into +component+ would bring me to UIComponent. For auto-completion this is even more convenient.

Finally, for some reason implicit objects are only available in the editor when I bind an expression to a component's attribute. If I directly start a #{} expression on a Facelet and try to auto complete, then no implicit objects show up at all.

*Duplicate tag suggestions*

When I try to auto complete tags, the editor shows me a lot of duplicate suggestions:

 http://community.jboss.org/servlet/JiveServlet/showImage/2-584074-11267/duplicate_tag_suggestions.png  http://community.jboss.org/servlet/JiveServlet/downloadImage/2-584074-11267/425-475/duplicate_tag_suggestions.png 

As can be seen, basically every suggestion appears twice. When I first restarted Eclipse after the initial installation of JBoss Tools Visual Editor (Richfaces), I even saw the same ones appearing 3 times. This is not the end of the world, but it does look a little awkward.

I hope this feedback will be valuable to you  ;)
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/584074#584074]

Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110129/18308f78/attachment.html 


More information about the jboss-user mailing list