jsf-2

preRenderView-Event triggered before an action (commandbutton)

六眼飞鱼酱① 提交于 2019-12-11 05:26:56
问题 I am in a little bit of trouble with my preRenderView-Event. My page also uses a commandbutton to submit data but unfortunately the preRenderView-Event is always called before the buttons action is invoked. The preRenderView-Event is responsible for loading data from a service. Since the page is simple and doesnt have to store any data I dont need any Session or ViewScoped-Beans. As far as I understood the event is called in the Render-Response-Phase and the action in the button should happen

How to maintain state of the DOM manipulated by jQuery/javasscript when reRendering richfaces/jsf components?

荒凉一梦 提交于 2019-12-11 05:26:33
问题 I've have problem when it comes to rendering some of my components in my jsf application. The problem is when i use jQuery on my page for example hiding the button. When the page reRenders the button come back to its original form which is supposed to be hidden. Has someone has expertise on this matter that will be able to help me find a suitable solution or there is some principles here or techniques which was i blindly misunderstood? Thanks. :) 回答1: The problem is when I use jQuery on my

JSF file download NullPointerException with view Parameter

血红的双手。 提交于 2019-12-11 05:25:03
问题 I hope I get this one straight: I try to create an JSF 2.0 Page optimized for mobile use on Tomcat 7 . Therefore I use Mojarra 2.1.6 and PrimeFaces (Core 3.1.1 and Mobile 0.9.1). My scenario: User visits simplified URL, e.g. www.someurl.eu/view.xhtml/12345678 ServletFilter rewrites Url to www.someurl.eu/view.xhtml?id=12345678 Url Parameter gets provided to ManagedBean Necessery Data gets evaluated and published to my view.xhtml On my view.xhtml a button for download is provided My problem: By

Prevent Double Submit on JSF Dialog AJAX CRUD

前提是你 提交于 2019-12-11 05:18:56
问题 Just would like to know why do I encounter this behavior in my application. I used primefaces for the UI and almost all of my pages follows this pattern. I heavily used AJAX in all of my CRUD operations and using dialogs to show it to the user. <ui:composition template="myTemplate.xhtml"> <ui:define name="content"> <ui:include src="/pages/CreateDialog.xhtml" /> <ui:include src="/pages/UpdateDialog.xhtml" /> <ui:include src="/pages/DeleteDialog.xhtml" /> </ui:define> </ui:composition> My only

JSF Converter warning

有些话、适合烂在心里 提交于 2019-12-11 05:16:48
问题 From my xhtml file: <h:inputTextarea value="#{newPostForm.post.body}"> <f:converter converterId="NL2BRConverter" /> </h:inputTextarea> From my java file: @FacesConverter(forClass=String.class) public class NL2BRConverter implements Converter { @Override public Object getAsObject(FacesContext ctx, UIComponent comp, String str) { return str.replaceAll("\r\n+", "<br />"); //return str.replaceAll("\r\n+", "&#13"); } @Override public String getAsString(FacesContext ctx, UIComponent comp, Object

ui:include in richfaces 4 only gets updated on second click

故事扮演 提交于 2019-12-11 05:15:12
问题 I am new to Richfaces4 and JSF2 and having lots of issues. Same code start to work suddenly and then it breaks. Currently I have a ui:include tag that update the page when the a4j:commandLink is clicked. Using debugging feature of eclipse I can see that the methods are being called and correct value is stored in the bean but page never gets updated until I click on it the second time. It seems the page is updated before the values are set in the backing bean. Following is my code. The same

JSF component binding without bean property throwing conversion error

﹥>﹥吖頭↗ 提交于 2019-12-11 05:08:39
问题 In a column of a table I've tried to bind a component value to a local scoped EL variable and later on to use that variable as a paramter: <h:column> <h:outputLabel value="Enter a quantity to put into the cart" for="qty"/> <h:inputText id="qty" binding="#{qty}" converter="javax.faces.Number"/> </h:column> <h:column> <h:commandButton value="Put into cart" type="submit" action="#{shoppingCart.addToCart(product, qty)}"/> </h:column> Where product is the current element of the datatable (a list

Schedule + OutputPanel + SelectOneRadio issue

☆樱花仙子☆ 提交于 2019-12-11 04:59:53
问题 I'm facing a strange problem here. In my page i have two outputPanel . Inside the first, there is a schedule exhibiting my events queried from the database. Inside the other one, there is a datatable exhibiting the same events just as another means of visualization. Furthermore, there is a selectOneRadio that alternates between the two outputPanels. The problem is: When the page loads, the default outputPanel (the one containing the schedule) (SCREEN 1) is loaded perfectly. But when i

Restore text value after validation fail

眉间皱痕 提交于 2019-12-11 04:57:56
问题 I am using jQuery to bind a keyup event of an inputText, so that the value of it will be set to the span text. <h:form id="formId"> <script type="text/javascript"> $(document).ready(function(){ var portletNamespace = '#<portlet:namespace/>\\:formId\\:'; $(portletNamespace+'txtSimpleText').live('keyup',function(){ $(portletNamespace+'spanText').text($(portletNamespace+'txtSimpleText').val()); }); }); </script> <h:inputText id="txtSimpleText" value=""/> <h:inputText required="true" value=""/>

How to load JSF / facelets library from a common directory? [duplicate]

佐手、 提交于 2019-12-11 04:57:44
问题 This question already has an answer here : Obtaining Facelets templates/files from an external filesystem or database (1 answer) Closed 3 years ago . We have a number of webapps that all use a certain JSF library. We'd like to place the library in a common location or on the main classpath. The trouble is that the system expects the library to be in WEB-INF/lib so the webapp classloader can scan it and load it. We are the creators of this particular library, and during development it's way