Search Results

Search found 3678 results on 148 pages for 'jsf jsp el'.

Page 34/148 | < Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • JavaFX in a JSF 2.0 Custom Tag?

    - by Geertjan
    I followed these instructions and now have a simple JSF 2.0 tag handler: The reason I created this is because I'm curious about whether it would be possible to change the tag created above: <my:hello name="Jack" /> ...to something like this: <my:chart type="pie" xAxis="${some-expression}" yAxis="${some-expression}" width="300" height="500" /> Has anyone tried this? That could be a way to incorporate a JavaFX chart into a Java EE application. That's different to how Adam Bien is doing it in LightFish, but might be a simpler and more reusable way of doing the same thing.

    Read the article

  • Can I ReRender a JSF Component from backing bean code?

    - by Ben
    Hi, Can I rerender a jsf ui component when a valuechangelistener method is run? The reason i'm asking is that my valuechangelistener method changes the values of the input boxes but when I run it, they don't seem to be rerender. The following doesn't work: <h:inputText id="inputbox_id"/> <h:selectOneMenu valueChangeListener="#{myBean.changeCountryMenu}"> <a4j:support event="onchange" rerender="inputbox_id" action="#{bean.test}> </h:selectOneMenu> Notice that bean.test() is never run. So the solution I thought of is to rerender the inputbox from the valueChangeListener. If there is some other better solution i'd be glad to hear... Thank you! Ben.

    Read the article

  • How to consume RESTful web service in my JSF project?

    - by Nitesh Panchal
    Hello, As RESTful web services is url based and is not a object, we can't call methods on it. I have a simple web service with only one method in it with is @GET. I saw one screencast and it used some javascript library to consume the web service. But, how do i use it with my JSF project? I can't even inject it like a normal web service. Please help. I am new to REST. Can i not consume it in my managed bean? If the only way to consume the webservice is through javascript, can anybody here give me details of how to consume it through JQuery? Thanks in advance :)

    Read the article

  • Are there any JSF components for implementing breadcrumb navigation?

    - by kazanaki
    As far as I know there are two "kinds" of breadcrumbs. The static/hierarchy one Works like a stack Entries are pushed when a user goes "deeper" into the site Entries are poped when user goes "up" into the site Is the same for all users (for a given page) Shows location rather than history A simple Example would be HOME - BIG CATEGORY - SMALL CATEGORY - ARTICLE The dynamic/historical one Works like a queue Entries are pushed at the end when a user goes to another page Entries are removed from the front when the maximum size is reached Is different for each user, since it is personalized. Shows timeline/history instead of location. A simple example would be SMALL CATEGORY - HOME - BIG CATEGORY - HOME The question is: Are there any ready-made JSF component for these types of navigation?

    Read the article

  • What is viewstate in JSF, and how is it used?

    - by MatthieuF
    In JSF, there is a viewstate associated with each page, which is passed back and forth with submits etc. I know that viewstate is calculated using the states of the various controls on the page, and that you can store it either client side or server side. The question is: how is this value used? Is it used to validate the values sent at submit, to ensure that the same request is not sent twice? Also, how is it calculated - I realise that richfaces may be calculated differently from myfaces, but an idea would be nice. Thanks.

    Read the article

  • JSF, How to set a property in a different page/backing bean and then navigate to that page?

    - by kgrad
    I am using JSF 2.0 and attempting to pass values between different pages in my App. The setup is as follows: I have a page called userSelect that has a backing bean userSelectBacking. On this page I display a list of users that can be selected and submit using an h:commandbutton, when the page is submit the navigation goes to a userEdit page. I have a page called userEdit, that has a backing bean userEditBacking which displays the information for a user and allows that user to be edited. I would like to pass the user selected from the userSelect page into the userEdit page. I am currently using f:setPropertyActionListener to set the user in my userEdit backing from the userSelect page, however when I navigate to the userEdit page, it loses the information I set. is there a way that I can pass the values between the two pages/backing beans? thanks

    Read the article

  • Using JSF, JPA and DAO. Without Spring?

    - by ich-bin-drin
    Hi, till now i still worked with JSF and JPA without DAOs. Now i'd like to use DAOs. But how can i initialize the EntityManager in the DAO-Classes? public class AdresseHome { @PersistenceContext private EntityManager entityManager; public void persist(Adresse transientInstance) { log.debug("persisting Adresse instance"); try { entityManager.persist(transientInstance); log.debug("persist successful"); } catch (RuntimeException re) { log.error("persist failed", re); throw re; } } } Have I to use Spring or is there a solution that works without Spring? Thanks.

    Read the article

  • how to get http get request params in jsf 2.0 bakcing bean?

    - by Marko
    Hi all, I having trouble with passing http get parameters to jsf 2.0 backing bean. User will invoke URl with some params containing id of some entity, which is later used to persist some other entity in db. whole process can be summarized by fallowing: 1. user open page http://www.somhost.com/JsfApp/step-one.xhtml?sid=1 2. user fills some data and goes to next page 3. user fills some more data and then entity is saved to db with sid param from step one. I have session scoped backing bean that hold data from all the pages (steps), but I cant pass param to bean property.. any ideas?

    Read the article

  • How to pass a action string into a JSF 2 composite component?

    - by Brian Leathem
    I'm creating a simple menuing composite component in JSF 2. However, I am unable to pass a String attribute into the composite component to use in the action attribute of the <h:commandLink>. My component looks like: <composite:interface> <composite:attribute name="title" required="true" type="java.lang.String"/> <composite:attribute name="view" required="true" /> </composite:interface> <!--implementation--> <composite:implementation> <li><h:commandLink action="#{cc.attrs.view}" value="#{cc.attrs.title}" /></li> </composite:implementation> How can I get an action String into the action attribute of the <h:commandLink>?

    Read the article

  • Are all "GET" requests to JSF "Initial Request"s?

    - by Pradyumna
    Hi, In JSF 1.1, I am assuming that GET requests are treated as initial requests (resulting in the creation of a new view), and POST requests are treated as Postbacks (resulting in the restoration of the old view). However, my application is behaving differently - it restores the same old view even for GET requests. Why does this happen? Is there a way to force the creation of a new view for GET requests? (My state-saving method is 'server'. I'm using MyFaces with JSP, and I have a t:saveState on a managed bean in the view) Regards, Pradyumna

    Read the article

  • Why do I get error "prefix [..] is not defined" when I try to use my jsf custom tag?

    - by Roman
    I created a jsf custom tag (I'm not sure that it's correct, I could miss something easily, so I attached code below). Now I'm trying to use this tag but I get an error: error on line 28 at column 49: Namespace prefix gc on ganttchart is not defined So, here is the xhtml-page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html 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:gc="http://myganttchart.org"> <body> <ui:composition template="/masterpage.xhtml"> <ui:define name="title">Gantt chart test</ui:define> <ui:define name="content"> <f:view> <gc:ganttchart width="300" height="100" rendered="true"/> ... </f:view> </ui:define> </ui:composition> </body> </html> And here is tld-file (it's placed in WEB-INF/): <taglib xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1"> <tlib-version> 1.0 </tlib-version> <short-name> oext </short-name> <uri> http://myganttchart.org </uri> <tag> <name>ganttchart</name> <tag-class>usermanagement.support.ganttchart.GanttChartTag</tag-class> <body-content>empty</body-content> <attribute> <name>binding</name> <deferred-value> <type>javax.faces.component.UIComponent</type> </deferred-value> </attribute> ... </tag> </tablib> Here is a part of tag-class code: public class GanttChartTag extends UIComponentELTag { private ValueExpression width; private ValueExpression height; private ValueExpression styleClass; public String getComponentType () { return "org.myganttchart"; } public String getRendererType () { return null; } ... } Correspondent block from faces-config: <component> <component-type>org.myganttchart</component-type> <component-class>usermanagement.support.ganttchart.UIGanttChart</component-class> </component> And the last part if UIGanttChart: public class UIGanttChart extends UIOutput { public UIGanttChart() { setRendererType (null); } //some test code public void encodeBegin(FacesContext context) throws IOException { ResponseWriter writer = context.getResponseWriter (); writer.startElement("img", this); writer.writeAttribute("src", "no-img", "source"); writer.writeAttribute("width", getAttributes ().get ("width"), "width"); writer.writeAttribute("height", getAttributes ().get ("height"), "height"); writer.writeAttribute("class", ".someclass", "styleClass"); writer.endElement("img"); } } So, what did I miss?

    Read the article

  • Where do I put jar files in Tomcat 6?

    - by Simon
    I am having trouble getting my JSP page to load a Java class which is in a jar file. The message I get appears to indicate a class not found exception: Jan 6, 2011 12:21:45 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 72 in the jsp file: /xmlloader.jsp FactArray cannot be resolved to a type 69: sourceType = "1"; 70: } 71: 72: FactArray fa = new FactArray(); 73: Fact f; 74: 75: /***********************/ The Type FactArray is one of my classes in a package com.mypackage.fact.FactArray which exists in myjar.jar. myjar.jar is a separate Java project (using NetBeans, but I don't think that's relevant). I include the package in my JSP as follows: <%@ page import="com.mypackage.fact.*" %> I deploy my web site and JSPs into Tomcat 6 as a WAR file. I include myjar.jar in that WAR in WEB-INF/lib but that doesn't work. I tried putting myjar.jar in my tomcat/lib folder, but that doesn't work either. I have bounced the server several times between changes. I have read a whole bunch of questions on here which say "put it in WEB-INF/lib" but that isn't working, so I'm asking my own question. Where do I need to put common JAR files so they get picked up by Tomcat?

    Read the article

  • are custom classes imported API included in .class files?

    - by kyrogue
    i have a question, i have a custom class which imports java.sql.; and i am creating a jsp page, in the jsp page, i did a page import of the custom class , however when i tried to call my custom class database methods it cant work. only when i did a page import of java.sql. did it work. so are custom classes imported API included in .class files? An error occurred at line: 6 in the jsp file: /resetpw.jsp Statement cannot be resolved to a type 3: 4: <% 5: db.connect(); 6: Statement stmt = db.getConnection().createStatement(); 7: ResultSet rs = stmt.executeQuery("SELECT * FROM created_accounts"); 8: 9: An error occurred at line: 7 in the jsp file: /resetpw.jsp ResultSet cannot be resolved to a type 4: <% 5: db.connect(); 6: Statement stmt = db.getConnection().createStatement(); 7: ResultSet rs = stmt.executeQuery("SELECT * FROM created_accounts"); 8: 9: 10: Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:319) org.apache.jasper.compiler.Compiler.compile(Compiler.java:298) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.31 logs. edited. added what error will come up if i did not do a page import of java.sql.*;

    Read the article

  • Error with JSF2 and RichFaces

    - by Miguel Ping
    Hi, I'm trying to use RichFaces on a working JSF2 application. I incorporated the RichFaces jars, changed the web.xml but got the following error: 17:49:13,097 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] Error Rendering View[/login.xhtml]: java.lang.NullPointerExcept ion at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:936) at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.createComponent(CompositeComponentTagHandler.java:154) at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.createComponent(ComponentTagHandlerDelegateImpl.java:311) at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:145) at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:114) at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:91) at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:120) at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:204) at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:114) at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:91) at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:86) at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:91) at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:75) at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:301) at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:360) at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:339) at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:191) at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:149) at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:86) at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:75) at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:145) at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:716) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:351) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126) at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100) at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:336) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:318) at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:243) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:559) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:872) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) at java.lang.Thread.run(Thread.java:619) It seems that some jars are missing, but I cannot seem to find this cause. The above error is the only thing that the log spits out. Here's web.xml: <context-param> <param-name>javax.faces.FACELETS_LIBRARIES</param-name> <param-value>/WEB-INF/faces-validator-tags/general.taglib.xml; /WEB-INF/faces-converter-tags/general.converter.taglib.xml </param-value> </context-param> <!-- Startup Servlet <servlet> <servlet-name>StartUpServlet</servlet-name> <servlet-class>pt.cgd.agile.util.StartupServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> --> <context-param> <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>org.richfaces.SKIN</param-name> <param-value>blueSky</param-value> </context-param> <!-- Making the RichFaces skin spread to standard HTML controls --> <context-param> <param-name>org.richfaces.CONTROL_SKINNING</param-name> <param-value>enable</param-value> </context-param> <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>server</param-value> </context-param> <context-param> <param-name>org.richfaces.SKIN</param-name> <param-value>blueSky</param-value> </context-param> <context-param> <param-name>org.richfaces.CONTROL_SKINNING</param-name> <param-value>enable</param-value> </context-param> <filter> <display-name>RichFaces Filter</display-name> <filter-name>richfaces</filter-name> <filter-class>org.ajax4jsf.Filter</filter-class> </filter> <filter-mapping> <filter-name>richfaces</filter-name> <servlet-name>Faces Servlet</servlet-name> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> </filter-mapping> <listener> <listener-class>com.sun.faces.config.ConfigureListener</listener-class> </listener> <!-- Just here so the JSF implementation can initialize, *not* used at runtime --> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- Just here so the JSF implementation can initialize --> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/login.jsf</form-login-page> <form-error-page>/loginError.jsf</form-error-page> </form-login-config> </login-config> <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/errors/error.jsf</location> </error-page>

    Read the article

  • Getting started with SVG graphics objects in JSF 2.0 pages.

    - by AlanObject
    What I want to do is create web pages with interactive SVG content. I had this working as a Java desktop application using Batik to render my SVG and collect UI events like mouseclick. Now I want to use those SVG graphics files in my JSF (Primefaces) web application in the same way. Trying to get started, I found this didn't work: <h:graphicImage id="gloob" value="images/sprinkverks.svg" alt="Graphic Goes Here"/> I don't mind doing some reading to get up the learning curve. It was just a bit surprising that some google searches didn't turn up anything useful. What I did find suggested that I would have to do this with the f:verbatim tag as if I were hand-coding the HTML. I would then have to add some script to capture the SVG events and feed them back into the AJAX code. If I have to do all that I will, but I was hoping there would be an easier and automated way. So the questions are: How to get the image to render in the first place? How to get the DOM events from the SVG portion of the page back to the backing beans? Much thanks for any pointers.

    Read the article

  • How can I load txt file from internet into my jsf app?

    - by Elena
    Hi all! It's me again) I have another problem. I want to load file (for example - txt) from web. I tried to use the next code in my managed bean: public void run() { try { URL url = new URL(this.filename); URLConnection connection = url.openConnection(); bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream())); if (bufferedReader == null) { return; } System.out.println("wwwwwwwwwwwwwwwwwwwww"); String str = bufferedReader.readLine(); System.out.println("qqqqqqqqqqqqqqqqqqqqqqq = " + str); while (bufferedReader.readLine() != null) { System.out.println("---- " + bufferedReader.readLine()); } } catch(MalformedURLException mue) { System.out.println("MalformedURLException in run() method"); mue.printStackTrace(); } catch(IOException ioe) { System.out.println("IOException in run() method"); ioe.printStackTrace(); } finally { try { bufferedReader.close(); } catch(IOException ioe) { System.out.println("UOException wile closing BufferedReader"); ioe.printStackTrace(); } } } public String doFileUpdate() { String str = FacesContext.getCurrentInstance().getExternalContext().getRequestServletPath(); System.out.println("111111111111111111111 str = " + str); str = "http://narod.ru/disk/20957166000/test.txt.html";//"http://localhost:8080/sfront/files/test.html"; System.out.println("222222222222222222222 str = " + str); FileUpdater fileUpdater = new FileUpdater(str); fileUpdater.run(); return null; } But the BufferedReader returns the html code of the current page, where i am trying to call managed bean's method. It's very strange thing - I have googled and none have had this problem. Maybe I do something wrong, maybe there us a simplest way to load file into web (jsf) app not using net API. Any ideas? Thanks very much for help! With best wishes)

    Read the article

  • How to implement custom JSF component for drawing chart?

    - by Roman
    I want to create a component which can be used like: <mc:chart data="#{bean.data}" width="200" height="300" /> where #{bean.data} returns a collection of some objects or chart model object or something else what can be represented as a chart (to put it simple, let's assume it returns a collection of integers). I want this component to generate html like this: <img src="someimg123.png" width="200" height="300"/> The problem is that I have some method which can receive data and return image, like: public RenderedImage getChartImage (Collection<Integer> data) { ... } and I also have a component for drawing dynamic image: <o:dynamicImage width="200" height="300" data="#{bean.readyChartImage}/> This component generates html just as I need but it's parameter is array of bytes or RenderedImage i.e. it needs method in bean like this: public RenderedImage getReadyChartImage () { ... } So, one approach is to use propertyChangedListener on submit to set data (Collection<Integer>) for drawing chart and then use <o:dynamicImage /> component. But I'd like to create my own component which receives data and draws chart. I'm using facelets but it's not so important indeed. Any ideas how to create the desired component? P.S. One solution I was thinking about is not to use <o:dynamicImage/> and use some servlet to stream image. But I don't know how to implement that correctly and how to tie jsf component with servlet and how to save already built chart images (generating new same image for each request can cause performance problems imho) and so on..

    Read the article

  • Open a dialog box in same window on selectOneMenu change

    - by Pravingate
    I have a jsf page where I have a selectOneMenu and , I want to open a dialog box on selectOneMenu changes. As a example if user selects a value ="passive" from jsf selectOneMenu it should open a dialog box or a light box on same page where I want to display a small jsf form like as here done. http://www.primefaces.org/showcase-labs/ui/dialogLogin.jsf and I also want save that submitted data in my backing bean somewhere so I can store it in to database later. I dont know how to open a dialog box or light box from backing bean in same window,as we will identify value change using valueChangeListener event or by using ajax event. I am able to identify which value is selected from selectOneMenu(DropdownMenu), but dont know how to open a dialog box on selecting particular value. <h:outputLabel value="* Country: "/> <h:selectOneMenu id="someSelect" value="#{testController.countryName}" required="true"> <f:selectItem itemLabel="Select Country" itemValue=""/> <f:selectItems value="#{testController.countryNamesSelectItems}"/> </h:selectOneMenu> Supoose we have 2 options in selectItems as India and Austrlia, then If a user choose India a dialog box should open on same page where a user need to fill some information and need to submit if he is from india (like here in example http://www.primefaces.org/showcase-labs/ui/dialogLogin.jsf user will put his username and password and submits data) Hope this helps How can I achieve that by using jsf or javascript or ajax or by any else way?

    Read the article

  • displaying data from database in to text box

    - by srinayak
    I have 2 JSP pages as below: projectcategory.jsp <% Connection con = DbConnect.connect(); Statement s = con.createStatement(); ResultSet rs = s.executeQuery("select * from projectcategory"); %> <DIV class="TabbedPanelsContent" align="center"> <TABLE border="1"> <TR> <TH>CATEGORY ID</TH> <TH>CATEGORY NAME</TH> <TH>Edit/Update</TH> </TR> <% while (rs.next()) { %> <%String p=rs.getString(1);%> <TR> <TD><%=rs.getString(1)%></TD> <TD><%=rs.getString(2)%></TD> <TD> <FORM action="EditPcat.jsp?pcatid=p"><INPUT type="submit" value='edit/update'></INPUT> </FORM> </TD> </TR> <% } %> </TABLE> </DIV> another is Editpcat.jsp: </head> <body> <%String s=request.getParameter("p"); %> <form action="ProjCatServlet" method="post"> <div align="right"><a href="projectcategory.jsp">view</a></div> <fieldset> <legend>Edit category</legend> <table cellspacing="2" cellpadding="2" border="0"> <tr> <td align="left">Category Id</td> <td><input type="text" name="pcatid" value="<%=s%>" ></td> </tr> <tr> <td align="right">Category Name</td> <td><input type="text" name="pcatname"></td> </tr> <tr> <td><input type="submit" value="submit"></td> </tr> </table> <input type="hidden" name="FUNCTION_ID" value="UPDATE"> </fieldset> </form> How to display value from one JSP page which we get from database in to text box of another JSP?

    Read the article

  • How to check if there is an active session in a JSF page?

    - by Roberto de Santis
    Hi, there is a way to check if there is an active session directly in jsf page? I have try this but it doesn't work: <p:ajaxStatus onerror="#{session == null ? 'idleDialog.show();' : null}" thank you in advance @Update I have see that onerror isn't fired even if viewExpiredException occurr. @Update 1 Ok i have implemented something that may work: <h:form> <p:idleMonitor timeout="10000" idleListener="#{idleMonitorController.idleListener}" onidle="sessionPoll.stop();idleDialog.show();"/> </h:form> <p:dialog header="Sessione scaduta per inattività" widgetVar="idleDialog" modal="true" width="400"> <h:outputText value="Sessione scaduta" /> <h:button value="Ripristina Sessione" onclick="idleDialog.hide();sessionPoll.start();" /> </p:dialog> <h:form prependId="false"> <p:poll widgetVar="sessionPoll" interval="1"/> </h:form> and this is the listner: public void idleListener(IdleEvent event) { System.out.println("aaaa"); final HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(); request.getSession(false).invalidate(); } now the only problem is that the session.invalidate doesn't work

    Read the article

  • JSF: How to forward a request to another page in action?

    - by Satya
    I want to forward request to another page from action class I am using below code in my jsf action : public String submitUserResponse(){ ...... ...... parseResponse(uri,request,response); .... return "nextpage"; } public String parseResponse(String uri,request,response){ if(uri != null){ RequestDispatcher dispatcher = request.getRequestDispatcher(uri); dispatcher.forward(request, response); return null; } ................. .................. return "xxxx"; } "submitUserResponse" method is being called when user clicks the submit button from the jsp and this method returns "nextpage" string here request forwards to next page in normal flow. but in my requirement i will call "submitUserResponse () " which will execute and forwrd request to next page.It is going. but it is displaying some exceptions in server That is : java.lang.IllegalStateException: Cannot forward after response has been committed Here my doubts are: 1.why next lines of code is being executed after forwarding my request using dispatched.forward(uri) . Same thing happening in response.sendRedirect("").

    Read the article

  • How to enforce jsf to create new instance of bean instead of throwing NullPointerException?

    - by Roman
    I'm almost sure that I do something wrong and thus the question's title is a bit incorrect. I have a form with several fields for creating a new User-objects (fields like login, password, birthday etc). And I have 2 buttons - Cancel and Create. I didn't finish Create yet :) , but when I press Cancel I see NullPointerException. Here is simplified code: <f:view> <h:form> <h:panelGroup layout="block"> <h:inputText id="add_login" value="#{userSupport.user.login}"/> <h:inputSecret id="add_password" value="#{userSupport.user.password}"/> <h:inputText id="add_name" value="#{userSupport.user.name}"/> <h:inputText id="add_surname" value="#{userSupport.user.surname}"/> <h:commandButton value="Cancel" action="cancel"/> </h:panelGroup> </h:form> </f:view> UserSupport class has field user with getter and setter and some other methods. It's a Spring bean with Session scope. When I press cancel, I see NPE because jsf tries to save values from inputs in user-object, but user-object is null. What is the correct way of doing this?

    Read the article

  • como puedo hacer funcionar el subwoofer sonicmaster en mi asus n46vb ubuntu 12.04?

    - by Leonidas Franco Carranza Oliva
    soy nuevo en ubuntu y me compre hace poco el asus n46vb con ubuntu 12.04 y que viene con un subwoofer sonicmaster, pero parece que no esta configurado en el sistema y no lo reconoce cuando lo conecto, estuve leyendo y probé con esto No sound from external subwoofer "Sonic Master" on an Asus N76VM pero no me sirvió ya que hay un archivo que no existe y creo que debe ser por el modelo, en fin si, por favor si me pueden ayudar les estaré muy agradecido.

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >