jsf-2

h:outputScript not defined in library h

亡梦爱人 提交于 2020-01-07 09:24:29
问题 I enetered this code <h:outputScript name="jsf.js" library="javax.faces" target="head"/> But my IDE says that <h:outputScript> tag is not defined in library h which I declared as below. <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> What's going on? 回答1: The JSF 2.0 <h:head> , <h:body> , <h:outputScript> , <h:outputStylesheet> , <f:ajax> and all <ui:xxx> tags are not available when you use the ancient JSP as view technology. You should instead be using its successor Facelets, which

h:outputScript not defined in library h

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-07 09:24:01
问题 I enetered this code <h:outputScript name="jsf.js" library="javax.faces" target="head"/> But my IDE says that <h:outputScript> tag is not defined in library h which I declared as below. <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> What's going on? 回答1: The JSF 2.0 <h:head> , <h:body> , <h:outputScript> , <h:outputStylesheet> , <f:ajax> and all <ui:xxx> tags are not available when you use the ancient JSP as view technology. You should instead be using its successor Facelets, which

Javascript does not work under JSF template again

时光怂恿深爱的人放手 提交于 2020-01-07 07:37:10
问题 I have found the thread answered by BalusC It describes the exact problem I have. When I found it I thought I have found my answer as well, but for me the solution is not working. I had problems with the < h:outputScript> tag already, maybe it is the same problem (the < script> tag is working). I have the same project description as the user Plaha, that put the question. I am trying to call a JavaScript function defined in the template page with the parameters attributes of the backing JSF

Best way to “switch” bean on selection in JSF

允我心安 提交于 2020-01-07 05:46:08
问题 I have a bean "Player" When I select a value in the selectOneMenu I would like to "switch" to the bean that's matching in the database. I have the beans sent back to the select one menu in public List<Player> getAllPlayers() { } Updated the dropdown to this. <h:selectOneMenu value="#{servicePlayer.myPlayer.combinedName}" converter="playerConverter" id="playerList"> <f:selectItems value="#{servicePlayer.allPlayers}" var="player" itemLabel="#{player.combinedName}" itemValue="#{player.id}" /> <

JSF - Managed Bean fields not initialized at PostConstruct

浪尽此生 提交于 2020-01-07 05:05:22
问题 Hellow I am trying to load a jsf page depending on a parameter I pass from a previous page. note: the application I am building is not purely JSF, I am using Jdeveloper to build a java ee web application, which includes JSF, JSP and servlets. My web pages are .jspx here is my code page1: <a href="page2.jspx?displayText=test"> goto page2 </a> page2 backing bean: @ManagedProperty(value= "#{param.displayText}") private String displayText; private HtmlOutputText outputText; @PostConstruct public

How to edit data in cell of datatable primefaces 3.4.2

£可爱£侵袭症+ 提交于 2020-01-07 04:37:07
问题 My project use primefaces ver 3.4.2. I don't see that version supporting cell editing in datatable as showcased here. 3.4.2 has row editing that has many action to edit data in datatable. I cannot upgrade the primefaces library version. How can I achieve cell editing in 3.4.2? 回答1: try this : editable="true" and editMode="cell" which will allow us to edit cell.. (this is supported in 3.4.2) and columns must be written as below .. <p:dataTable id="cars" var="car" value="#{tableBean.carsSmall}"

JSF2 download file returns xhtml page source

佐手、 提交于 2020-01-07 03:56:46
问题 I've been working on this for hours : When a button is pressed I need to generate XML and download it to the user. I've tried using primefaces StreamedContent with p:fileDownload - but the only output I ever get is the .xhtml source of the actual page. I can use log statements to display the contents of the the StreamedContent before returning it and I can see my XML code correctly there, but the downloaded file always has the page source instead. (I've tried lots of other ways as well, tied

Why can't I get ViewScope to work? Throws errors every time

天涯浪子 提交于 2020-01-07 03:12:15
问题 Ok I'm trying to do something real simple. Just to note this works fine with SessionScope. I have a datatable and when I select a row it needs to update a form that a user could edit. Every time I try and fire the row selector it comes back with this. SEVERE: Error Rendering View[/index.xhtml] java.lang.IllegalStateException: PWC3999: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2867) at org.apache.catalina

p:dataTable rowEdit doesn't update row object [duplicate]

…衆ロ難τιáo~ 提交于 2020-01-06 19:51:33
问题 This question already has an answer here : How and when should I load the model from database for h:dataTable (1 answer) Closed 4 years ago . I'm trying to edit rows on datatable using rowEdit mode but it doesn't work for me. Here is the rowEdit event : <p:ajax event="rowEdit" listener="#{saisirHeuresForm.updateMyRow}" update=":saisirHeuresForm:messages"/> And the managedBean corresponding method : public void updateMyRow(RowEditEvent event) { event.getObject(); } The event.getObject() method

How to select the <p:dataTable> by CSS?

核能气质少年 提交于 2020-01-06 19:40:54
问题 First I was using <h:dataTable> and I was OK with this but after then I needed some more functionality, So I started using Primefaces and used its <p:dataTable> . Everything is going fine but the CSS that I applied on tables stopped woking. Then I found that <p:dataTable> is first creating a <div> and then inside the <div> , it is creating a <table> . <div id="tcform:tclist" .......> <table role="grid">....</table> </div> But <h:dataTable> creates just HTML <table> . Now I want to know how