1 2 3 Previous Next 32 Replies Latest reply on Feb 2, 2010 4:09 PM by dgolovin

    Enabling code assist in xhtml files

    asookazian

      I am working on a Seam 2.1.1.GA, RF 3.3.1.GA, JBoss Tools 3.1.0 (I think) project.

       

      How do I enable code assist for tags in my xhtml files?

       

      Also, CTRL-SHFT-T does not work anymore.  I created a new workspace, created two new java projects, exec'd:

       

      mvn eclipse:clean

      mvn eclipse:eclipse

       

      but I notice that there are still no source folders on build path for one of my projects in the workspace.  when I add the source folders to the build path, I get hundreds of errors.

        • 1. Re: Enabling code assist in xhtml files
          asookazian
          I am using Eclipse Galileo.
          • 2. Re: Enabling code assist in xhtml files
            asookazian
            How do I exec a search in the JBoss Tools forum only?  This used to be possible before the conversion to this new website.
            • 3. Re: Enabling code assist in xhtml files
              akazakov

              Try right click on the project->Configure...->Add JSF capabilities

              It should enable code assist in xhtmls.

              And see Problems view to find out the reason of java errors.

              1 of 1 people found this helpful
              • 4. Re: Enabling code assist in xhtml files
                asookazian

                For my web project, I tried Properties --> JBoss Tools --> add JSF capabilities.

                 

                In the dialog/wizard 2nd screen, I see "JSF 1.1.02 - RI" in the environment field but it's disabled.

                 

                1) Why is it disabled?

                 

                2) I was expecting to see JSF 1.2.x - RI.  Why the older version?

                 

                Here is the partial .classpath file for this project (see attached for complete file):

                 

                <classpath>
                  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
                  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
                  <classpathentry kind="output" path="target/classes"/>
                  <classpathentry kind="var" path="M2_REPO/javax/el/el-api/1.2/el-api-1.2.jar"/>
                  <classpathentry kind="var" path="M2_REPO/javax/javaee/javaee/5.0/javaee-5.0.jar" sourcepath="M2_REPO/javax/javaee/javaee/5.0/javaee-5.0-sources.jar">
                    <attributes>
                      <attribute value="jar:file:/C:/Documents%20and%20Settings/asookazian/.m2/repository/javax/javaee/javaee/5.0/javaee-5.0-javadoc.jar!/" name="javadoc_location"/>
                    </attributes>
                  </classpathentry>
                  <classpathentry kind="var" path="M2_REPO/javax/faces/jsf-impl/1.2_04-p02/jsf-impl-1.2_04-p02.jar">
                    <attributes>
                      <attribute value="/WEB-INF/lib" name="org.eclipse.jst.component.dependency"/>
                    </attributes>
                  </classpathentry>

                • 5. Re: Enabling code assist in xhtml files
                  asookazian

                  BTW, when I do complete this wizard, what file is created and where or what file is modified?  thx.

                   


                  EDIT: jsfnature is added to .project file.

                   

                  <natures>       
                          <nature>org.jboss.tools.jsf.jsfnature</nature>
                  </natures>

                  • 6. Re: Enabling code assist in xhtml files
                    akazakov

                    This combox will be enabled if you check "Add Librares". But please don't do it since you already have JSF libs in the project classpath.

                    But as soon as you enable it you will see a few options there. JSF 1.2 is among them.

                    BTW you can enable Seam Tools features for java project using Project Propeties->Seam Settings.

                    1 of 1 people found this helpful
                    • 7. Re: Enabling code assist in xhtml files
                      asookazian
                      Is it possible to configure my Maven pom.xml, etc. to pre-configure these JSF capability and Seam capability settings for my Eclipse project such that another developer will not have to do it themselves?
                      • 8. Re: Enabling code assist in xhtml files
                        asookazian

                        It does not do the code assist after the wizard completion.

                         

                        I added facelets support via the JBoss Tools:

                         

                        <!-- Facelets support -->
                            <application>
                                <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
                            </application>

                         

                        Is there anything else I need to do?

                         

                        For example:

                         

                        For this facelet fragment: <h:inputText value="#{cardBillingAndSettlementEditorUI.}"/>

                         

                        I see this when I enter ".": "#{cardBillingAndSettlementEditorUI.}"

                         

                        I created a new xhtml for testing.  Same result.

                         

                        There are no errors in the problems view.

                         

                        ???

                        • 9. Re: Enabling code assist in xhtml files
                          asookazian
                          Here is the current .project file.
                          • 10. Re: Enabling code assist in xhtml files
                            asookazian

                            I created a new JSF project in the same workspace following these directions:

                             

                            http://docs.jboss.org/tools/3.1.0.M2/en/jsf_tools_ref_guide/html_single/index.html#d0e327

                             

                            Looks like I am using 3.1.0.M4 based on the installation notes from Eclipse:

                             

                            org.jboss.tools.common (3.1.0.v200910281724M-H247-M4) "Red Hat Common" [Active]

                             

                            Still does not work.  In this case it's worse, when I type a Seam component name like #{foo} then type ".", nothing happens at all.  No errors.

                            • 11. Re: Enabling code assist in xhtml files
                              asookazian
                              Keep in mind that I have approx. 10 projects in the same workspace.  Must the Seam components and xhtml files be located in the same project??
                              • 12. Re: Enabling code assist in xhtml files
                                asookazian

                                Here is the .project file for the new test project:

                                 

                                <?xml version="1.0" encoding="UTF-8"?>
                                <projectDescription>
                                    <name>JSFProjectwithFacelets</name>
                                    <comment></comment>
                                    <projects>
                                    </projects>
                                    <buildSpec>
                                        <buildCommand>
                                            <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
                                            <arguments>
                                            </arguments>
                                        </buildCommand>
                                        <buildCommand>
                                            <name>org.eclipse.wst.common.project.facet.core.builder</name>
                                            <arguments>
                                            </arguments>
                                        </buildCommand>
                                        <buildCommand>
                                            <name>org.eclipse.jdt.core.javabuilder</name>
                                            <arguments>
                                            </arguments>
                                        </buildCommand>
                                        <buildCommand>
                                            <name>org.eclipse.wst.validation.validationbuilder</name>
                                            <arguments>
                                            </arguments>
                                        </buildCommand>
                                        <buildCommand>
                                            <name>org.jboss.tools.common.verification.verifybuilder</name>
                                            <arguments>
                                            </arguments>
                                        </buildCommand>
                                        <buildCommand>
                                            <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
                                            <arguments>
                                            </arguments>
                                        </buildCommand>
                                    </buildSpec>
                                    <natures>
                                        <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
                                        <nature>org.eclipse.jdt.core.javanature</nature>
                                        <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
                                        <nature>org.jboss.tools.jsf.jsfnature</nature>
                                        <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
                                        <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
                                        <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
                                    </natures>
                                </projectDescription>

                                • 13. Re: Enabling code assist in xhtml files
                                  asookazian

                                  Here is a sample facelet template in the new JSF project.  So I type "." after person and nothing happens.

                                   

                                  <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                                      xmlns:ui="http://java.sun.com/jsf/facelets"
                                      xmlns:h="http://java.sun.com/jsf/html"
                                      xmlns:f="http://java.sun.com/jsf/core"
                                      xmlns:echo="http://www.echo-inc.com/common/web/facelets/taglib"
                                      xmlns:s="http://jboss.com/products/seam/taglib"
                                      xmlns:c="http://java.sun.com/jstl/core"
                                      xmlns:j4j="http://javascript4jsf.dev.java.net/">

                                   

                                     
                                           <!-- Balance out panel grid -->
                                           <h:outputText value="#{person.}" /> <!-- Used to balance out panelGrid -->
                                          
                                     
                                  </ui:composition>

                                  • 14. Re: Enabling code assist in xhtml files
                                    asookazian
                                    Is this a possible problem in the build of JBT I'm using?  How can I easily upgrade/downgrade version of JBT?
                                    1 2 3 Previous Next