Menu

Which Version(s) Currently Work Together

2013-08-28
2013-09-23
  • Paul Morris

    Paul Morris - 2013-08-28

    What is the currently recommended combination of CRUD generator/JSF/PrimeFaces/Glassfish that works together. I’m working under deadlines and having issues with my code, while trying to stay current on the latest technology. I’m currently targeting GF 3.12 using PF 3.5 with JSF 2.1 and the 15.2-7.3.1 version of the CRUD generator. I would really like to target GF 4 with JSF 2.2 but PF 4.0 isn’t going to be released fro a couple more weeks and I cannot delay the project to wait.

    Under my current setup, the generator is outputting xhtml code for Boolean fields with a ‘title’ property, which NetBeans objects to. Also, I think I'm getting grief from CDI based on the errors thrown when I try to deploy.

     
  • Kay Wrobel

    Kay Wrobel - 2013-08-28

    Hi Paul.

    Generally speaking, the generator should work with Glassfish 3.1.2 and JSF 2.1, even if you're on the latest version of NetBeans. NetBeans made a method call change in one of their non-API modules after updating NB 7.3 to its latest. This change broke version 0.15 and so I put out 0.15.2 that takes care of the change in method call of that API. 7.3.1 had the same change, of course, right out of the box.

    The current state of affairs is very confused for me because of many changes that came with recent versions. The generator is currently producing bad code if you're using Glassfish 4 and JSF 2.2. PrimeFaces 3.5 does not support JSF 2.2 until 4.0 as you already stated. Also, please be aware that the project is still in beta status. I've not had much testing feedback from users to feel good about turning it into stable. So please keep that in mind working on a production project.

    Probably will take a while, but there are changes on the horizon that I've been approached for by a NetBeans team member. They are planning to completely overhaul the Wizard integration for this type of generator and turn some of their non-API, implementation-specific code into a public API that can be utilized by third-party modules such as this one.

    If you're working on a CDI project, I strongly recommend you download and add the MyFaces CODI library to your project before you run the generator. It will take advantage of the @ViewAccessScoped annotation to implement proper ViewScope. See View Access Scope of the CODI documentation for more about its implementation. CODI also seems to work only up to JSF 2.1, as I get tons of deployment errors with GF4/JSF2.2 and CDI+CODI.

    Regarding the title attribute, it is a warning, but you can edit the Edit.xhtml template under Templates --> PrimeFaces CRUD Generator --> PrimeFaces Pages from Entity Classes. Edit the line with <p:selectBooleanCheckbox> tag and remove the title= attribute. Do the same with *Create.xhtml` and you'll get rid of those warnings.

     
  • Paul Morris

    Paul Morris - 2013-08-28

    Hi Kay,

    Thank you for the quick response! I'm using CDI+CODI already, specifically so I can take advantage of the @ViewAccessScoped annotation. A restart of the server got rid of the CDI errors. I'll play with the templates to fix the title warnings as you suggested.

    Glad to hear the NB folks are going to tap your brain.

     

    Last edit: Paul Morris 2013-08-28
  • Kay Wrobel

    Kay Wrobel - 2013-08-28

    Anytime.

    Yeah, they're actually currently in bug-fix mode for their next feature release and this project is not high on the agenda. But the person who contacted me said he ran this idea by his superiors and they seemed interested and green-lit it. So I signed the Oracle Contributor Agreement for the project. Guess I'm now kinda part of their fold. Could also possibly show up in their NetBeans release someday... maybe...

    That said, if "minor" changes to core APIs like JSF 2.1 to 2.2 can break the generated code so badly as it does right now, and also the PrimeFaces version they ship (3.5) doesn't support JSF 2.2, one wonders how this can ever be integrated fully.

     

    Last edit: Kay Wrobel 2013-08-28
  • Paul Morris

    Paul Morris - 2013-09-05

    Hi Kay,
    I'm still encountering problems using NB7.3.1 w/15.2 .
    1. I have CDI checked and CODI 1.0.5 in my libraries but I still get @ViewScoped controllers and not @ViewAccessScoped.
    2. I'm getting the buttons for Create, Edit etc not layed out properly at the bottom of the index pages. They look like they are hovering over the footer. (See attached PNG file)

    I can work around item 1 by editing the files but number 2 is really biting me bad. Any idea what I need to do to fix this?

     

    Last edit: Paul Morris 2013-09-05
    • Kay Wrobel

      Kay Wrobel - 2013-09-18

      Hi Paul. Thanks for your feedback. I have noticed the button layout issue in my own test projects. It's weird because when you visit PF's demo showcase and compare the code, it looks pretty much identical.

       
      • Paul Morris

        Paul Morris - 2013-09-19

        I know, I did the same. Very strange. Must be something to do with the combination of Glassfish, PrimeFaces, JSF and whatever else they are using for the showcase. But as you said, they aren't supporting JSF 2.2 until the new major release.

         
    • Kay Wrobel

      Kay Wrobel - 2013-09-18

      Regarding the @ViewAccessScoped annotation: when you add CODI to the libraries (Ant Libraries from the Tools menu), you also have to add the library to your project as well. If that's the case, the generator should identify the CODI version at the bottom of the window next to the PrimeFaces version. If it is properly identified, then it is being passed through to the template engine. Look at the template for the Controller.java. You should see an <#if myFacesCodiVersion??> directive there querying the CODI version. That's where it should generate the @ViewAccessScoped annotation. So I assume you created a CDI project. Right? Not sure if this will even work with J2EE 7, but definitely J2EE 6. So you need CDI checked, CODI library added to your project, then run the generator.

       

      Last edit: Kay Wrobel 2013-09-18
    • Kay Wrobel

      Kay Wrobel - 2013-09-19

      Hi again. So I just tested 0.15.2 with NB7.3.1/GF3.1.2/PF3.5 and CODI 1.0.5, and yeah, it does not generate the @ViewAccessScoped annotation anymore. I will have to debug this and see what's cooking.

       
  • Kay Wrobel

    Kay Wrobel - 2013-09-19

    I am getting more and more disturbed with NetBeans. So the reason the @ViewAccessScoped annotation and quite a few others, too, don't get generated is because the generator is unable to determine if the project is CDI-enabled. It utilizes a NetBeans function call for that, and that call returns false instead of true. I may have to file a bug report with the NetBeans team for that.

     
    • Paul Morris

      Paul Morris - 2013-09-19

      Big changes for a sub-point release. I'm pissed too. All you have to do to seriously break your project is to run the updates on a NB 7.3 and all your work turns to mud. I lost about two weeks on this before I went back to 7.3 and rolled back my source in SVN.

       
      • Kay Wrobel

        Kay Wrobel - 2013-09-19

        And when I confronted them on the nbdev mailing list about that relating to a different change they made to their "internal" API I got following reponse from Geertjan Wielenga brushing off the fact thay they can simply do that:
        Compile error: JSFUtils.isJSF20Plus has additional parameter

        Can't say I'm happy with that response, though he spoke the truth.

         

        Last edit: Kay Wrobel 2013-09-19
  • Kay Wrobel

    Kay Wrobel - 2013-09-23

    I have filed a bug report with NetBeans regarding CDI-enabled projects not being detected as such inside their code. Unfortunately, I depend on their code to properly detect CDI and pass that result on to the template engine.

    Will have to wait for an answer on that. As you suggested, I would stick with a previous version of NetBeans that works for you and don't upgrade or even apply any updates. Basically freeze that version. That's the only advice I can give you right now. Sorry.

     
  • Kay Wrobel

    Kay Wrobel - 2013-09-23

    Per the bug maintainer: it's fixed in NB7.4. Now it's time for PrimeFaces to come out with a full release of version 4 that supports JSF 2.2. And let's hope that it's a stable version.

    I for one still advocate an older NetBeans/JSF/PrimeFaces version where everything still worked. But I have to prepare for the new versions when they come out.

     

Anonymous
Anonymous

Add attachments
Cancel