I am trying to clone example here http://primefaces.org/showcase/ui/datatableRowSelectionRadioCheckbox.jsf
But Netbeans tell me that "type ListDataModel does not take parameters" at
public class CarDataModel extends ListDataModel<Car> implements SelectableDataModel<Car>
line at CarDataModel.java
If I remove Car parameter, like
public class CarDataModel extends ListDataModel implements SelectableDataModel<Car>
it compiles without any error and jsf page open with empty datatable.
what am I doing wrong?
Thanks for helping.
PM 4.0.4, Jboss 7.1.1
The error you've got implies that you're trying to indicate a type parameter on a class that's not generic, that is, the class that doesn't expect it.
Examination of past Java EE releases showed that within Java EE 5 the ListDataModel is non-generic, while in Java EE 6+ ListDataModel<E> indeed is.
As generics has become a Java artifact since Java SE 5 ages, Sun probably decided to leave a non-generic version of list model for Java EE 5.
As for the solution, look for old JSF libraries in your classpath and upgrade them to JSF 2+ (as of December 2013, the JSF version is 2.2). Alternatively, as application servers come bundled with JSF, and that you've got the most recent one, you can just as safely remove the webapp's JSF library altogether.
Related
I have a problem when trying to use
#ManagedBean, it appears like this :
#ManagedBean,
Check the image below :
here is a photo of the code
Yesterday, I could create a project and use it, but today I cannot, I don't know what happened , maybe because I changed GlassFish 4 to 5 , and PostgreSQL 9.3 to 10?
EDIT: I tried to see my others project, and they are all stricken out in #ManagedBean.
The crossed line (aka "strikethrough") on a class, method, or annotation means that it has been deprecated by the author and you should no longer use it. If you mouse over the annotation, it should give you some sort of explanation as to why it was deprecated, and what you should use instead.
In this case, the JSF #ManagedBean annotation was "strongly discouraged" in JSF 2.2, and officially deprecated in JSF 2.3 (hence the strikethrough in your IDE). Instead, you should use the #Named annotation which is provided by CDI and is a more standard way of creating a bean in Java EE.
I am using Netbeans and Scenebuilder to create a JavaFX project. I realized that Scenebuilder does not have a date picker component so I downloaded the jfxtras and added the library to my classpath. I used the following code to add the CalendarTextField Object to my FXML file:
<?import jfxtras.labs.scene.control.*?>
<CalendarTextField fx:id="setupdate" prefWidth="200.0" showTime="true" GridPane.columnIndex="3" GridPane.rowIndex="8" />
It appeared to have worked ok, however, when I opened my FXML file in Scenebuilder I am getting the following error:
fxml:99: error:
javafx.fxml.LoadException: Element does not define a default property.
I am not sure what this means.
Java 8 DatePicker
Use Java 8 + SceneBuilder 2, it has a DatePicker.
Both are early access (especially SceneBuilder 2). Don't expect much in the way of SceneBuilder 2 stability for a little while, it's implementation is currently pretty rough and not as polished as SceneBuilder 1.1.
jfxtras and fxml
With regards to the use of jfxtras controls in SceneBuilder 1.1, my guess is that it is just not supported.
In order to build the jfxtras controls for Java 7, it was necessary for the jfxtras developers to make use of private APIs as feature complete public APIs for building custom controls are not available in Java 8. Usage of private APIs may cause compatibility issues with different SceneBuilder versions as it ties the control binaries to only work with certain JavaFX versions (as backward compatibility of private JavaFX apis is not guaranteed in new Java versions).
Also, the jfxtras developers may not have implemented the builder classes required to make their controls work with FXML. This would seem to be the case, as lack of an appropriate builder is what generates the error: javafx.fxml.LoadException: Element does not define a default property.
Implementing your own builder
You can read more about builders and fxml in an Introduction to FXML. You could implement a builder for the jfxtras CalendarTextField if you wish (I will not write one in this answer though). If you did implement an appropriate builder, there is a reasonable chance that you would then be able to use the control in FXML used by SceneBuilder 1.1.
I am using Netebans 7.3 to develop a JSF application with JPA. When I create a new Entity, there is a warning at the #Entity line just above the class decleration "Create Subclass" and when I click on the it leads me to create a class with default name adding Impl suffix to the original class. Why it gives such warning and what can I do with the new subclass?
Netbeans documentation says 'Create Subclass' is a suggestion.
http://wiki.netbeans.org/Java_Hints
It also says that it was added in version 7.2 , I guess they have not perfected it yet and it is showing up as suggestion in a few more places than required.
I use Tomcat 7, JSF2.1, JSTL 1.1 JDK 1.6, EclipeLink for JPA and Netbeans 7.1.2
I have this problem.
javax.servlet.ServletException: Absent Code attribute in method that is not native or abstract in class file...
I have read in many forums that just add the libraries JavaEE version 6 with the ones I've tried to import into NetBeans does not work.
Can anyone tell me how to do
Thanks in Advance
I got this error when I upgraded from primefaces 3.0.M3 to 3.0.M4-SNAPSHOT
#60,114 Parent is not of type ActionSource, type is: javax.faces.component.html.HtmlForm#1d9c3e7
I understand that it is happening in other libraries like icefaces too, but I couldn't figure out how to fix it. Any help is appreciated.
The PrimeFaces tags/components are not been parsed at all and thus treated as plain HTML which caused that the real closest parent JSF component is a <h:form>.
This can have at least 2 causes:
You didn't update the taglib namespace URI from http://primefaces.prime.com.tr/ui to the new namespace http://primefaces.org/ui which was introduced in M4.
The PrimeFaces 3.0 M4 JAR file isn't in the webapp's runtime classpath. Verify if this is done right. This is to be achieved by dropping the JAR in /WEB-INF/lib, or if it's been dropped elsewhere, by including it in Deployment Assembly list in project's properties (assuming that you're using Eclipse).