Search Results

Search found 99 results on 4 pages for 'a4j'.

Page 4/4 | < Previous Page | 1 2 3 4 

  • how to settle JSF combobox with values depending on another combobox if both are set to required

    - by mykola
    Hi, everybody! Can anyone tell me how to automatically set <h:selectOneMenu (or any other component) with values depending on another <h:selectOneMenu if there empty elements with 'required' set to 'true' on the form? If to set <a4j:support event="onchange" reRender="anotherElement" immediate="true"/ then nothing is changed because changed value isn't set. But without immediate i always have message that this or that element cannot be empty. Here's code example that doesn't work :) <h:outputLabel value="* #{msg.someField}: "/> <h:panelGrid cellpadding="0" cellspacing="0"> <h:selectOneMenu id="someSelect" value="#{MyBean.someObj.someId}" required="true" label="#{msg.someField}" > <a4j:support event="onchange" reRender="anotherSelect" limitToList="true" immediate="true"/> <f:selectItem itemValue=""/> <f:selectItems value="#{MyBean.someList}"/> </h:selectOneMenu> <rich:message for="someSelect" styleClass="redOne"/> </h:panelGrid> <h:outputLabel value="* #{msg.anotherField}: "/> <h:panelGrid cellpadding="0" cellspacing="0"> <h:selectOneMenu id="anotherSelect" value="#{MyBean.someObj.anotherId}" required="true" label="#{msg.anotherField}" > <f:selectItem itemValue=""/> <f:selectItems value="#{MyBean.anotherList}"/> </h:selectOneMenu> <rich:message for="anotherSelect" styleClass="redOne"/> </h:panelGrid> <h:outputLabel value="* #{msg.name}: "/> <h:panelGrid cellpadding="0" cellspacing="0"> <h:inputText id="myName" value="#{MyBean.someObj.myName}" required="true" label="#{msg.name}"/> <rich:message for="myName" styleClass="redOne"/> </h:panelGrid> So, here (i repeat), if i try to change 'someSelect' then 'anotherSelect' should update its values but it doesn't because either when it tries to get value of 'someSelect' it gets null (if immediate set to 'true') or form validation fails on empty elements. How can i skip validation but get this changed value from 'someSelect'?

    Read the article

  • How to stop page refresh when hit enter button from rich:inputNumberSpinner field?

    - by eswaramoorthy-nec
    Hi, I use rich:inputNumberSpinner tag. The problem is : I set cursor focus to inside of rich:inputNumberSpinner field, then i hit the enter button from my keyboard, that time page will be automatically refresh. But i don't need page refresh when i hit the enter button from my keyboard. The code : spinnerTagTest.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %> <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <f:view> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Spinner Tag Test</title> </head> <body> <h:form id="SpinnerForm"> <rich:panel id="SpinnerPanel"> <h:outputText value="Input Spinner Tag : "/> <rich:inputNumberSpinner id="spinnerField" value="" maxValue="23" inputSize="2"/> </rich:panel> </h:form> </body> I also use rich:hotKey for that inputNumberSpinner field. But Page refreshed. <rich:hotKey key="return" selector="#spinnerField" handler="event.stopPropagation();event.preventDefault(); return false;"/> And i check anotherway using javasccript, but page refreshed. The specific tag and javascript is : <rich:inputNumberSpinner id="spinnerField" value="" maxValue="23" inputSize="2" oninputkeypress="return stopPageRefresh();"/> <script type="text/javascript"> function stopPageRefresh() { return false; } </script> Here i use one alert message inside of stopPageRefresh(). But i hit enter button, first page refreshing and then alert message displayed. Help me about this. Thanks in advance.

    Read the article

  • Load script with parameters

    - by Doseke
    Before I used .jsp pages for jsf, and the below code was pretty fine <script language="javascript" src='<%= renderResponse.encodeURL(renderRequest.getContextPath() +"/resources/jsCropperUI/scriptaculous.js?load=effects,builder,dragdrop") %>' > </script> Now, I'm using .xhtml with RichFaces, and the below code does not work <a4j:loadScript src="/resources/jsCropperUI/scriptaculous.js?load=effects,builder,dragdrop"/> Exception is Static resource not found for path /resources/jsCropperUI/scriptaculous.js?load=effects,builder,dragdrop How can I fix this?

    Read the article

  • JEE frameworks, a road map to learn? and should I learn them?

    - by vibhor
    Background Information I have been into programming since past 1 years professionally, my day to day work includes writing BIRT reports, designing and validating forms using JEE (struts/spring, hibernate). I don't have a comp Sci 4 year degree (Electronics), so I have very Limited experience in comp Sci. Question JEE frameworks (struts1/2, spring, hibernate etc) are hot nowadays, however java world have a tendency of building A4j, B4J... mayway4J kind of stuff (and I am tired of it). AFAIK, frameworks are nothing but bunch of XML config files and hundreds of classes built to cram (by developer). And sooner then later a new framework come into picture that says I am the best among all. So My Question is - 1.What will you do to learn a framework (many frameworks) considering that it can be obsolete till you'll be master in it (Learning frameworks can take significant amount of time)? 2.Considering early into your career, will you give a damn that how well someone knows framework (knowing frame work is important but still..) and why/how should I learn a framework knowing I have to (un)learn it in order to learn other one (plenty of of 4Js....)? I am just trying to get a big picture, that, if you're in place of me, what would be your learning/cramming strategy (Road map)? I am not intended to start a holy war between A versus B, (frameworks are more or less essential).

    Read the article

  • Richfaces calendar manual input value not binding

    - by John
    Hi, I've got a richfaces calendar component defined as <rich:calendar id="startDate" value="#{myBean.dateSet.startDate}" timeZone="#{myBean.dateSet.timeZone}" datePattern="#{myBean.dateSet.datePattern}" enableManualInput="true" immediate="true"> <a4j:support event="onchanged" action="#{myBean.adjustEndDate}" reRender="startDate,endDate" ajaxSingle="true" /> </rich:calendar> when I'm changing the date using the calendar popup/gui everything is working fine. However when I'm changing it via the input text field, the value is not being updated to myBean.dateSet.startDate, although it is being updated correctly on the calendar component itself (i.e. if I click the icon for calendar popup it shows the updated current date). Any suggestions on how I can get it to update the value to myBean correctly? Thanks!

    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

  • JSF Deferred EL conditional syntax problem

    - by Mark Lewis
    Hello I can't find any resources which can answer why I'm getting an error with this: oncomplete="#{MyBacking.oError ? #{rich:component('oErrorPanel')}.show() : return false;}" in a richfaces a4j:commandButton. oError is referring to a method in my bean called isOError. I'm getting the error SEVERE: Servlet.service() for servlet Faces Servlet threw exception org.apache.el.parser.ParseException: Encountered " "?" "? "" at line 1, column 30. Was expecting one of: "}" ... "." ... ... I want to say 'if a method returns true, show modal panel A otherwise false'. Any help much appreciated.

    Read the article

  • JSF and Ajax4JSF on WebSphere 6.1 --> Problem with Form Submission

    - by Shamik
    Has anyone setup JSF1.1 with Ajax4JSF on websphere 6.1 ? I followed the instructions as mentioned in the developer guide . The problem that I am facing is that once I use a4j:support on any of my h:inputText item, the form values are not getting set in the backing bean on the submission of the form. I do have <h:messages> tag present just above the form so that all the problems should be reported there but I do not see any error message once I submit the form. But I do see that the values are not getting set. I need to find the solution as early as possible otherwise I probably have to throw the ajax4jsf framework and write javascripts instead :(

    Read the article

  • Click event of buttons is not fired when it causes onChange event of textbox is fired first

    - by bakkujp
    Hi All, I have a textbox like below <h:inputText value="#{bean.strQuantite}"> <a4j:support actionListener="#{tabacListCommandeAltadisDetailBean.actionListenerQuantity}" event="onchange" /> </h:inputText> I input some value into the textbox above and keep the caret inside the textbox. After that, when I continue to click a other button, the event onchange of the input text above is fired. I want to when clicking the button, the click event is fired before. Can anyone help me to solve this problem ?

    Read the article

  • Using java to create a dynamic rich:panelMenu

    - by Mark Lewis
    Hail This attempt at using component libs to access a Map<String, ArrayList<String>> <rich:panelMenu style="width:35%" mode="ajax" iconExpandedTopGroup="/img/logListIcon.png" iconCollapsedTopGroup="/img/logListIcon.png" iconCollapsedGroup="/img/logListFolderIconClosed.png" iconExpandedGroup="/img/logListFolderIconOpen.png" iconGroupTopPosition="left" iconItem="/img/logFileIcon.png"> <!-- feed iteration --> <ui:repeat items="#{PanelMenu.panelNodes}" var="map"> <rich:panelMenuGroup label="#{map.key}" style="padding-left: 20px;"> <ui:repeat items="${map.value}" var="entry"> <rich:panelMenuItem label="#{entry}" action="#{PanelMenu.updateCurrent}"> <f:param name="current" value="#{entry}" /> </rich:panelMenuItem> </ui:repeat> </rich:panelMenuGroup> </ui:repeat> </rich:panelMenu> <rich:panel style="width:65%" bodyClass="rich-laguna-panel-no-header"> <a4j:outputPanel ajaxRendered="true"> <h:outputText value="#{PanelMenu.currentLog}" id="current" /> </a4j:outputPanel> </rich:panel> resulted in |STDOUT| 2010-03-06 22:46:22,212 | ERROR | [http-8181-2]: Exception in the filter chain javax.servlet.ServletException: com.sun.facelets.component.UIRepeat cannot be cast to org.richfaces.component.UIPanelMenuItem so I think I need to get onto a resource to use FacesContext context = FacesContext.getCurrentInstance(); but as I'm fairly new to both java and jsf I need a bit of help. Can anyone suggest either the (probably small) java method to represent this intention or a really good resource specifically about programming dynamic stuff in RichFaces using java? Naturally I've read the javadocs, but they don't give me a concrete example of some JSF, the associated backing bean java code, and a screen shot of the resulting component. It may be asking a bit much, but I'm sure I'm not alone in thinking that with these three, I'd be able to understand the idea and apply it to many other component types in this family. The RF demo doesn't include dynamic panelMenus or drop downs so I'm a bit stumped. Thanks IA EDIT @BalusC: Thanks for the response, here is complete stack trace: 07-Mar-2010 19:05:52 com.sun.facelets.FaceletViewHandler handleRenderException SEVERE: Error Rendering View[/index.xhtml] java.lang.ClassCastException: com.sun.facelets.component.UIRepeat cannot be cast to org.richfaces.component.UIPanelMenuItem at org.richfaces.renderkit.html.PanelMenuRenderer.insertScript(PanelMenuRenderer.java:141) at org.richfaces.renderkit.html.HtmlPanelMenuRenderer.doEncodeEnd(HtmlPanelMenuRenderer.java:260) at org.richfaces.renderkit.html.HtmlPanelMenuRenderer.doEncodeEnd(HtmlPanelMenuRenderer.java:271) at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:134) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:281) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258) at org.richfaces.renderkit.TabRendererBase.encodeChildren(TabRendererBase.java:113) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258) at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeChildren(TabPanelRenderer.java:266) at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeChildren(TabPanelRenderer.java:261) at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:234) at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:180) at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:127) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:234) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:239) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:239) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:106) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258) at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:200) at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:195) at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258) at org.richfaces.renderkit.html.PageRenderer.doEncodeChildren(PageRenderer.java:265) at org.richfaces.renderkit.html.PageRenderer.doEncodeChildren(PageRenderer.java:254) at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:594) 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:110) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178) 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:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) 07-Mar-2010 19:05:52 com.sun.faces.lifecycle.Phase doPhase SEVERE: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /index.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@30f369] 07-Mar-2010 19:05:52 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet Faces Servlet threw exception java.lang.ClassCastException: com.sun.facelets.component.UIRepeat cannot be cast to org.richfaces.component.UIPanelMenuItem at org.richfaces.renderkit.html.PanelMenuRenderer.insertScript(PanelMenuRenderer.java:141) at org.richfaces.renderkit.html.HtmlPanelMenuRenderer.doEncodeEnd(HtmlPanelMenuRenderer.java:260) at org.richfaces.renderkit.html.HtmlPanelMenuRenderer.doEncodeEnd(HtmlPanelMenuRenderer.java:271) at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:134) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:281) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258) at org.richfaces.renderkit.TabRendererBase.encodeChildren(TabRendererBase.java:113) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258) at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeChildren(TabPanelRenderer.java:266) at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeChildren(TabPanelRenderer.java:261) at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:234) at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:180) at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:127) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:234) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:239) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:239) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:106) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258) at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:200) at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:195) at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258) at org.richfaces.renderkit.html.PageRenderer.doEncodeChildren(PageRenderer.java:265) at org.richfaces.renderkit.html.PageRenderer.doEncodeChildren(PageRenderer.java:254) at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:594) 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:110) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178) 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:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) |STDOUT| 2010-03-07 19:05:52,683 | ERROR | [http-8181-1]: Exception in the filter chain javax.servlet.ServletException: com.sun.facelets.component.UIRepeat cannot be cast to org.richfaces.component.UIPanelMenuItem at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178) 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:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassCastException: com.sun.facelets.component.UIRepeat cannot be cast to org.richfaces.component.UIPanelMenuItem at org.richfaces.renderkit.html.PanelMenuRenderer.insertScript(PanelMenuRenderer.java:141) at org.richfaces.renderkit.html.HtmlPanelMenuRenderer.doEncodeEnd(HtmlPanelMenuRenderer.java:260) at org.richfaces.renderkit.html.HtmlPanelMenuRenderer.doEncodeEnd(HtmlPanelMenuRenderer.java:271) at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:134) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:281) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258) at org.richfaces.renderkit.TabRendererBase.encodeChildren(TabRendererBase.java:113) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258) at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeChildren(TabPanelRenderer.java:266) at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeChildren(TabPanelRenderer.java:261) at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:234) at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:180) at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:127) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:234) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:239) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:239) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:106) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258) at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:200) at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:195) at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258) at org.richfaces.renderkit.html.PageRenderer.doEncodeChildren(PageRenderer.java:265) at org.richfaces.renderkit.html.PageRenderer.doEncodeChildren(PageRenderer.java:254) at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:594) 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:110) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) ... 18 more

    Read the article

  • Using JBoss EL with Websphere

    - by rat
    Hey, I'm doing a project which is going to run on Websphere. I'm using JSF/Facelets/Richfaces for this project. I want to use the JBoss EL implementation as it allows calling methods with parameters from EL etc. ... usually this is accomplished by getting the JBoss EL jar and then putting this in the web.xml: <context-param> <param-name>com.sun.faces.expressionFactory</param-name> <param-value>org.jboss.el.ExpressionFactoryImpl</param-value> </context-param> However this isn't working ... I don't know if its a problem with Websphere or ...??? I get a stack trace when going to the page saying it can't parse the EL where I have passed a method a parameter: <a4j:commandLink value="Delete" action="#{mcsaAdmin.deleteLanguage(1234)}" /> Looking at the stacktrace it appears to still be using the standard sun EL: Caused by: javax.el.ELException: Error Parsing: #{mcsaAdmin.deleteLanguage(1234)} at com.sun.el.lang.ExpressionBuilder.createNodeInternal(Unknown Source) at com.sun.el.lang.ExpressionBuilder.build(Unknown Source) at com.sun.el.lang.ExpressionBuilder.createMethodExpression(Unknown Source) at com.sun.el.ExpressionFactoryImpl.createMethodExpression(Unknown Source) at com.sun.facelets.tag.TagAttribute.getMethodExpression(TagAttribute.java:141) Note the 'com.sun.el.ExpressionFactoryImpl' instead of 'org.jboss.el.ExpressionFactoryImpl' as specified above ... Am I doing something obviously wrong? Anyone have any ideas... I'm using standard JSF implementation from majorra project or whatever provided on sun website and richfaces 3.1.4 and facelets 1.1.14.

    Read the article

  • seam page parameters not working as expected.

    - by rangalo
    Hi, I am learning seam and following a very famous book Seam In Action by Dan Allen. This is an example from this book. Seam 2.2.0.GA JBoss 5.1.0.GA Here the page parameter roundId is always null even after a round is serialized, it is never passed. Neither to Roud.xhtml nor to RoundEdit.xhtml after clicking save on RoundEdit.xhtml. The entity always stays unmanaged. RoundEdit.page.xml <?xml version="1.0" encoding="UTF-8"?> <page xmlns="http://jboss.com/products/seam/pages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd" login-required="true"> <begin-conversation join="true" /> <param name="roundId" value="#{roundHome.id}" converterId="javax.faces.Long"/> <param name="teeSetId" value="#{teeSetHome.teeSetId}" /> <param name="roundFrom" /> <action execute="#{roundHome.wire}" /> <navigation from-action="#{roundHome.persist}"> <rule if-outcome="persisted"> <end-conversation/> <redirect view-id="#{null != roundFrom ? roundFrom : '/Round.xhtml'}" /> </rule> </navigation> </page> RoundEdit.xhtml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml"> <ui:define name="body"> <h:form id="roundform"> <rich:panel> <f:facet name="header>"> #{roundHome.managed ? 'Edit' : 'Add' } Round </f:facet> <s:decorate id="dateField" template="layout/edit.xhtml"> <ui:define name="label">Date:</ui:define> <rich:calendar id="date" datePattern="dd/MM/yyyy" value="#{round.date}"/> </s:decorate> <s:decorate id="notesField" template="layout/edit.xhtml"> <ui:define name="label">Notes:</ui:define> <h:inputTextarea id="notes" cols="80" rows="3" value="#{round.notes}" /> </s:decorate> <s:decorate id="totalScoreField" template="layout/edit.xhtml"> <ui:define name="label">Total Score:</ui:define> <h:inputText id="totalScore" value="#{round.totalScore}" /> </s:decorate> <s:decorate id="weatherField" template="layout/edit.xhtml"> <ui:define name="label">Weather:</ui:define> <h:selectOneMenu id="weather" value="#{round.weather}"> <s:selectItems var="_weather" value="#{weatherCategories}" label="#{_weather.label}" noSelectionLabel=" Select " /> <s:convertEnum/> </h:selectOneMenu> </s:decorate> <h:messages/> <div style="clear: both;"> <span class="required">*</span> required fields </div> </rich:panel> <div class="actionButtons"> <h:commandButton id="save" value="Save" action="#{roundHome.persist}" rendered="#{!roundHome.managed}" disabled="#{!roundHome.wired}" /> <h:commandButton id="update" value="Update" action="#{roundHome.update}" rendered="#{roundHome.managed}" /> <h:commandButton id="delete" value="Delete" action="#{roundHome.remove}" rendered="#{roundHome.managed}" /> <s:button id="discard" value="Discard changes" propagation="end" view="/Round.xhtml" rendered="#{roundHome.managed}" /> <s:button id="cancel" value="Cancel" propagation="end" view="/#{empty roundFrom ? 'RoundList' : roundFrom}.xhtml" rendered="#{!roundHome.managed}" /> </div> <rich:tabPanel> <rich:tab label="Tee Set"> <div class="association"> <h:outputText value="Tee set not selected" rendered="#{round.teeSet == null}" /> <rich:dataTable var="_teeSet" value="#{round.teeSet}" rendered="#{round.teeSet != null}"> <h:column> <f:facet name="header">Course</f:facet>#{_teeSet.course.name} </h:column> <h:column> <f:facet name="header">Color</f:facet>#{_teeSet.color} </h:column> <h:column> <f:facet name="header">Position</f:facet>#{_teeSet.pos} </h:column> </rich:dataTable> </div> </rich:tab> </rich:tabPanel> </h:form> </ui:define> </ui:composition> Round.page.xml <?xml version="1.0" encoding="UTF-8"?> <page xmlns="http://jboss.com/products/seam/pages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd"> <param name="roundId" value="#{roundHome.id}" converterId="javax.faces.Long"/> </page> Round.xhtml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml"> <ui:define name="body"> <h:form id="roundform"> <rich:panel> <f:facet name="header>">Round</f:facet> <s:decorate id="id" template="layout/display.xhtml"> <ui:define name="label">Id:</ui:define> <h:outputText value="#{null == roundHome.id ? 'null' : roundHome.id}"> <s:convertDateTime type="date" /> </h:outputText> </s:decorate> <s:decorate id="date" template="layout/display.xhtml"> <ui:define name="label">Date:</ui:define> <h:outputText value="#{roundHome.instance.date}"> <s:convertDateTime type="date" /> </h:outputText> </s:decorate> <s:decorate id="golfer" template="layout/display.xhtml"> <ui:define name="label">Golfer:</ui:define> #{roundHome.instance.golfer.name} </s:decorate> <s:decorate id="totalScore" template="layout/display.xhtml"> <ui:define name="label">Total Score:</ui:define> #{roundHome.instance.totalScore} </s:decorate> <s:decorate id="weather" template="layout/display.xhtml"> <ui:define name="label">Weather:</ui:define> #{roundHome.instance.weather} </s:decorate> <s:decorate id="notes" template="layout/display.xhtml"> <ui:define name="label">Notes:</ui:define> #{roundHome.instance.notes} </s:decorate> <div style="clear:both"/> </rich:panel> <div class="actionButtons"> <s:button id="edit" view="/RoundEdit.xhtml" value="Edit" /> </div> <rich:tabPanel> <rich:tab label="Tee Set"> <div class="association"> <h:outputText value="Tee set not selected" rendered="#{roundHome.instance.teeSet == null}" /> <rich:dataTable var="_teeSet" value="#{roundHome.instance.teeSet}" rendered="#{roundHome.instance.teeSet != null}"> <h:column> <f:facet name="header">Course</f:facet>#{_teeSet.course.name} </h:column> <h:column> <f:facet name="header">Color</f:facet>#{_teeSet.color} </h:column> <h:column> <f:facet name="header">Position</f:facet>#{_teeSet.pos} </h:column> </rich:dataTable> </div> </rich:tab> </rich:tabPanel> </h:form> </ui:define> </ui:composition> The entityHome RoundHome.java @Name("roundHome") public class RoundHome extends EntityHome<Round>{ @In(required = false) private Golfer currentGolfer; @In(create = true) private TeeSetHome teeSetHome; @Logger private Log logger; public void wire() { logger.info("wire called"); TeeSet teeSet = teeSetHome.getDefinedInstance(); if (null != teeSet) { getInstance().setTeeSet(teeSet); logger.info("Successfully wired the teeSet instance with color: " + teeSet.getColor()); } } public boolean isWired() { logger.info("is wired called"); if(null == getInstance().getTeeSet()) { logger.info("wired teeSet instance is null, the button will be disabled !"); return false; } else { logger.info("wired teeSet instance is NOT null, the button will be enabled !"); logger.info("teeSet color: "+getInstance().getTeeSet().getColor()); return true; } } @RequestParameter public void setRoundId(Long id) { logger.info("in Setter RoundId is: " + id); super.setId(id); } public Long getRoundId() { Long id = (Long) getId(); logger.info("Setting RoundId : " + id); return id; } @Override protected Round createInstance() { Round round = super.createInstance(); round.setGolfer(currentGolfer); round.setDate(new java.sql.Date(System.currentTimeMillis())); logger.info("Created a Round with roundId: " + round.getId()); return round; } @Override protected Round loadInstance() { logger.info("loadInstance for id: " + getId()); return (Round) getEntityManager().createQuery( "select r from Round r " + "join fetch r.golfer g " + "join fetch r.teeSet ts " + "join fetch ts.course c " + "where r.id = :id ") .setParameter("id",getId()) .getSingleResult(); } }

    Read the article

  • Question: Richfaces tabPanel - using the same page for the different tabs changing the content dinam

    - by user280320
    I am using Seam 2.1.2 and RichFaces 3.3.2.SR1. <a4j:form> <rich:tabPanel switchType="ajax"> <rich:tab label="TAB 1" actionListener="#{outControl.tab1}" immediate="true"> <ui:include src="/pages/agenda/TabContain.xhtml" /> </rich:tab> <rich:tab label="TAB 2" actionListener="#{outControl.tab2}"> <ui:include src="/pages/agenda/TabContain.xhtml" /> </rich:tab> ... TabContain.xhtml: <rich:extendedDataTable value="#{manBean.seDataModel}" var="out" id="bc_table" sortMode="#{manBean.sortMode}" selectionMode="#{manBean.selectionMode}" tableState="#{manBean.tableState}" selection="#{manBean.selection}" rowKeyVar="rkvar"> <rich:column sortable="false" id="bc_col_0"> ... The content of extendedDataTable should be dependent of the tab selected. My first approach was to set an actionListener in the tabs and change the manBean within that action. After that actionListener even if I can see in the logs that the manBean has changed, this is not reflected in the page in the browser. It's like not refreshing. I tried setting a rerender in the rich:tab but that's also not doing it. Any idea? Also happy about other approaches, this might be not the best one.

    Read the article

  • Can I add round cornres to HtmlPanelGrid in code or in page? If yes - how?

    - by Elena
    Hi all! I have a task - add round corners to HtmlPanelGrid. Now I am trying to do it with css (using 4 images for each corner - that css create our designer). I load css and try to do this in my code: this.grid = new HtmlPanelGrid(); this.grid.setStyleClass("toplist,toplist-top"); But no changes I could see in my page. I tried to load css and use it with tags, but it also didnt work and created one more problem - my jsf didn't reload and redisplay: <div class="toplist"> <div class="toplist-top"><h2>Top 10 List</h2></div> <div class="toplist-bg"> <div class="toplist-cont"> <rich:tab label="Top-List" id="screenTop"> <h:panelGrid id="topListTable" binding="#{chartBean.topListTable}" /> </rich:tab> <a4j:support event="onclick" reRender="menuSection" actionListener="#{chartBean.doChangeTab}" /> </div> </div> <div class="toplist-bottom"></div> </div> I am interesting of adding round corners to topListTable in the code. How can I do it? I load my css as: <link href="#{facesContext.externalContext.requestContextPath}/css/stylesheet.css" rel="styleSheet" type="text/css"/> If anybody knows, how can I add corners to the panelGrid. Sorry for stupid question, but I am newborn in jsf and richfaces, and I want to solve this task right Thanks!

    Read the article

  • How to hide some nodes in Richfaces Tree (do not render nodes by condition)?

    - by VestniK
    I have a tree of categories and courses in my SEAM application. Courses may be active and inactive. I want to be able to show only active or all courses in my tree. I've decided to always build complete tree in my PAGE scope component since building this tree is quite expensive operation. I have boolean flag courseActive in the data wrapped by TreeNode<T>. Now I can't find the way to show courses node only if this flag is true. The best result I've achieved with the following code: <h:outputLabel for="showInactiveCheckbox" value="show all courses: "/> <h:selectBooleanCheckbox id="showInactiveCheckbox" value="#{categoryTreeEditorModel.showAllCoursesInTree}"> <a4j:support event="onchange" reRender="categoryTree"/> </h:selectBooleanCheckbox> <rich:tree id="categoryTree" value="#{categoryTree}" var="item" switchType="ajax" ajaxSubmitSelection="true" reRender="categoryTree,controls" adviseNodeOpened="#{categoryTreeActions.adviseRootOpened}" nodeSelectListener="#{categoryTreeActions.processSelection}" nodeFace="#{item.typeName}"> <rich:treeNode type="Category" icon="..." iconLeaf="..."> <h:outputText value="#{item.title}"/> </rich:treeNode> <rich:treeNode type="Course" icon="..." iconLeaf="..." rendered="#{item.courseActive or categoryTreeEditorModel.showAllCoursesInTree}"> <h:outputText rendered="#{item.courseActive}" value="#{item.title}"/> <h:outputText rendered="#{not item.courseActive}" value="#{item.title}" style="color:#{a4jSkin.inactiveTextColor}"/> </rich:treeNode> </rich:tree> the only problem is if some node is not listed in any rich:treeNode it just still shown with title obtained by Object.toString() method insted of being hidden. Does anybody know how to not show some nodes in the Richfases tree according to some condition?

    Read the article

  • h:commandButton action not working inside a h:datatable.

    - by Chris
    I'm stuck with this piece of jsf code that I don't understand why it's working when used outside a datatable and doesn't inside a datatable... <h:dataTable id="myTable" rendered="true" value="#{bean.selectedItemsList}" var="items"> <h:column> <h:commandButton action="#{bean.removeItemFromList}" image="/resources/images/deleterow.gif"> <f:actionListener binding="#{bean.actionListenerImpl}" type="com.mycorp.ActionListenerImpl"/> </h:commandButton> </h:column> <h:column> <h:outputText value="#{items}" /> </h:column> </h:dataTable> I read around the net to put value="#{items}" inside the action listener so the action can get the items in the row like this: <f:actionListener value="#{items}" binding="#{bean.actionListenerImpl}" type="com.mycorp.ActionListenerImpl"/> But it's doesn't work either. Bu if I do the action outside the data table everything work fine. <h:commandButton action="#{bean.removeItemFromList}" image="/resources/images/deleterow.gif"> <f:actionListener binding="#{bean.actionListenerImpl}" type="com.mycorp.ActionListenerImpl"/> </h:commandButton> Side note I also tried a4j:commandButton and didn't so I guess my problem is probably the actionlistener or how the bean handling it.

    Read the article

  • In JSF - What is the correct way to do this? Two dropdown lists with dependency.

    - by Ben
    Hi, I'm making two dropdown lists in JSF which are dependent. Specifically, one list has all the languages and the second list contains values that are displayed in the currently selected language. I've implemented this by having the second list use information from a Hash and rebuilding that Hash in the setter of the currently selected language. JSF Code Bit: <rich:dropDownMenu value="#{bean.currentlySelectedLanguage}" id="languageSelector"> ... (binding to languages hash) ... <rich:dropDownMenu value="#{bean.currentlySelectedScript}" id="ScriptPullDown"> ... (binding to scripts hash) ... Backing Bean Code Bit: setCurrentlySelectedLanguage(String lang){ this.currentlySelectedLanguage = lang; rebuildScriptNames(lang); } I'm wondering if that's a good way of doing this or if theres a better method that I am not aware of. Thank you! EDIT - Adding info.. I used a a4j:support that with event="onchange" and ReRender="ScriptPullDown" to rerender the script pull down. I could probably add an action expression to run a method when the value changes. But is there a benefit to doing this over using code in the setter function?

    Read the article

  • How hide some nodes in Richfaces Tree (do not render nodes by condition)?

    - by VestniK
    I have a tree of categories and courses in my SEAM application. Courses may be active and inactive. I want to be able to show only active or all courses in my tree. I've decided to always build complete tree in my PAGE scope component since building this tree is quite expensive operation. I have boolean flag courseActive in the data wrapped by TreeNode<T>. Now I can't find the way to show courses node only if this flag is true. The best result I've achieved with the following code: <h:outputLabel for="showInactiveCheckbox" value="show all courses: "/> <h:selectBooleanCheckbox id="showInactiveCheckbox" value="#{categoryTreeEditorModel.showAllCoursesInTree}"> <a4j:support event="onchange" reRender="categoryTree"/> </h:selectBooleanCheckbox> <rich:tree id="categoryTree" value="#{categoryTree}" var="item" switchType="ajax" ajaxSubmitSelection="true" reRender="categoryTree,controls" adviseNodeOpened="#{categoryTreeActions.adviseRootOpened}" nodeSelectListener="#{categoryTreeActions.processSelection}" nodeFace="#{item.typeName}"> <rich:treeNode type="Category" icon="..." iconLeaf="..."> <h:outputText value="#{item.title}"/> </rich:treeNode> <rich:treeNode type="Course" icon="..." iconLeaf="..." rendered="#{item.courseActive or categoryTreeEditorModel.showAllCoursesInTree}"> <h:outputText rendered="#{item.courseActive}" value="#{item.title}"/> <h:outputText rendered="#{not item.courseActive}" value="#{item.title}" style="color:#{a4jSkin.inactiveTextColor}"/> </rich:treeNode> </rich:tree> the only problem is if some node is not listed in any rich:treeNode it just still shown with title obtained by Object.toString() method insted of being hidden. Does anybody know how to not show some nodes in the Richfases tree according to some condition?

    Read the article

  • Setting initial state of a JSF component to invalid

    - by user359391
    Hi there I have a small JSF application where the user is required to enter some data about themselves. For each component on the page that has required="true" I want to show an icon depending if there is data in the field or not. My problem is that when the page is initially shown all fields are valid, even if they do not have any data in them. So my question is how I can set a component to be invalid based on if there is data in the field or not? After a submit of the page (or after the component loses focus) the icon is shown properly, it is only on the initial page load I have a problem. (i.e there is no post data) Here is my xhtml for a component that needs to be validated: <s:decorate id="employeeIdDecoration" template="/general/util/errorStyle.xhtml"> <ui:define name="label">#{messages['userdetails.employeeId']}</ui:define> <h:inputText value="#{authenticator.user.employeeId}" required="true"> <a4j:support event="onblur" reRender="employeeIdDecoration" bypassUpdates="true"/> </h:inputText> the template: <s:label styleClass="#{invalid?'error':''}"> <ui:insert name="label"/> <s:span styleClass="required" rendered="#{required}">*</s:span> </s:label> <span class="#{invalid?'error':''}"> <s:validateAll> <ui:insert/> </s:validateAll> <h:graphicImage value="/resources/redx.png" rendered="#{invalid}" height="16" width="16" style="vertical-align:middle;"/> <h:graphicImage value="/resources/Checkmark.png" rendered="#{!invalid}" height="16" width="16" style="vertical-align:middle;"/> </span> Any help will be appreciated.

    Read the article

  • JavaScript: Replacement for XMLSerializer.seralizeToString()?

    - by NRaf
    I'm developing a website using the Seam framework and the RichFaces AJAX library (these isn't really all that important to the problem at hand - just some background). I seem to have uncovered a bug, however, in RichFaces which, in certain instances, will cause AJAX-based updating to fail in IE8 (see here for more info: http://community.jboss.org/message/585737). The following is the code where the exception is occurring: var anchor = oldnode.parentNode; if(!window.opera && !A4J.AJAX.isWebkitBreakingAmps() && oldnode.outerHTML && !oldnode.tagName.match( /(tbody|thead|tfoot|tr|th|td)/i ) ){ LOG.debug("Replace content of node by outerHTML()"); if (!Sarissa._SARISSA_IS_IE || oldnode.tagName.toLowerCase()!="table") { try { oldnode.innerHTML = ""; } catch(e){ LOG.error("Error to clear node content by innerHTML "+e.message); Sarissa.clearChildNodes(oldnode); } } oldnode.outerHTML = new XMLSerializer().serializeToString(newnode); } The last line (the one with XMLSerializer) is where the exception is occurring in IE. I was wondering if anyone knows of any replacement method / library / etc I could use there (only on IE is fine). Thanks.

    Read the article

  • set/unset checkboxes in JSF

    - by mykola
    Hello, i've got one problem with checkboxes in JSF. I want them to behave dependently on each other, e.g., when i check a box which belongs to some object that has children then all checkboxes that belong to these children components must be checked either. And also when i uncheck one of child's checkbox the parent should be unchecked too. It's pretty simple with plain HTML/javascript, but i can't do anything with this under JSF. For some reason i can't set ID's for them because all checkboxes are rendered dynamically in a treetable and it prevents me from setting my own ID's, i.e. whatever i set in ID property only constant part will apply, all dynamic data that i pass is ignored. I tried to do it through valueChangeListener or validator but in both cases after i set needed values something sets them back! I don't know who does it and i can't do anything with this. Here's some code (i use OpenFaces treeTable): <o:treeTable id="instTreeTable" var="inst" ...> <...> <o:column id="isGranted" width="10%"> <f:facet name="header"> <h:outputText value="#{msg.access_granted}" /> </f:facet> <h:selectBooleanCheckbox value="#{inst.assignedToUser}" styleClass="treeTableText" valueChangeListener="#{MbUserInstitutions.onAccessGrantedChanged}" > <a4j:support event="onchange" reRender="instTreeTable"/> </h:selectBooleanCheckbox> </o:column> <...> </o:treeTable> MbUserInstitutions: public void onAccessGrantedChanged(ValueChangeEvent event) { Boolean granted = (Boolean) event.getNewValue(); Institution inst = getInstitution(); if (granted.booleanValue() && inst.hasChildren()) { setChildrenInsts(inst); } else if (!granted.booleanValue() && inst.getParentId() != null){ unsetParentInst(inst); } } private Institution getInstitution() { return (Institution) Faces.var("inst"); } private void setChildrenInsts(Institution parent) { for (Institution child: parent.getChildren()) { child.setAssignedToUser(true); if (child.hasChildren()) { setChildrenInsts(child); } } } private void unsetParentInst(Institution child) { child.setAssignedToUser(false); for (Institution inst: coreInsts) { if (inst.getId().equals(child.getParentId())) { unsetParentInst(inst); break; } } }

    Read the article

  • <o:massAttribute> affects another components in same <h:panelGrid>

    - by Ignacio Ayuste
    I'm using the new version of OmniFaces 1.8.1, and particullary I start to use the new tag: <o:massAttribute>. Basically, I have the following form with conditionally rendered and disabled fields: <h:form id="formABMProducto"> <h:panelGrid id="datosProducto" columns="4"> <o:massAttribute name="rendered" value="#{cc.attrs.page != 'baja'}"> <h:outputLabel for="codigo" ... /> <h:inputText id="codigo" ... /> <rich:message for="codigo" /> <h:panelGroup /> </o:massAttribute> <o:massAttribute name="rendered" value="#{cc.attrs.page eq 'baja'}"> <h:outputLabel for="codigo" .../> <rich:autocomplete id="codigoProducto" ... /> <rich:message for="codigo" /> <h:panelGroup /> </o:massAttribute> <o:massAttribute name="disabled" value="#{cc.attrs.disableComponents}"> <h:outputLabel for="nombre" ... /> <h:inputTextarea id="nombre" ... /> <rich:message for="nombre" /> <span /> <h:outputLabel for="descripcion" ... /> <h:inputTextarea id="descripcion" ... /> <rich:message for="descripcion" /> <span /> </o:massAttribute> <h:outputLabel value="#{msgs['producto.abm.panel.proveedor.tipo']}" for="CmbTipoProveedor"/> <rich:select id="CmbTipoProveedor" ... /> <rich:message for="CmbTipoProveedor" /> <a4j:commandButton ... /> </h:panelGrid> </h:form> However, when I open the page, the third <o:massAttribute> is also disabling another input fields codigo and codigoProducto. I think this isn't the expected behaviour.

    Read the article

  • Wired component null in seam EntityHome action

    - by rangalo
    I have a custom EntityHome class. I wire the dependent entity in the wire method, but when I call the action (persist) the wired component is always null. What could be the reason, similar code generated by seam gen is apparently working. Here is the entity class. I have overrden persist method to log the value of the wired element. @Name("roundHome") @Scope(ScopeType.CONVERSATION) public class RoundHome extends EntityHome<Round>{ @In(required = false) private Golfer currentGolfer; @In(create = true) private TeeSetHome teeSetHome; @Override public String persist() { logger.info("Persist called"); if (null != getInstance().getTeeSet() ) { logger.info("teeSet not null in persist"); } else { logger.info("teeSet null in persist"); // wire(); } String retVal = super.persist(); //To change body of overridden methods use File | Settings | File Templates. return retVal; } @Logger private Log logger; public void wire() { logger.info("wire called"); TeeSet teeSet = teeSetHome.getDefinedInstance(); if (null != teeSet) { getInstance().setTeeSet(teeSet); logger.info("Successfully wired the teeSet instance with color: " + teeSet.getColor()); } } public boolean isWired() { logger.info("is wired called"); if(null == getInstance().getTeeSet()) { logger.info("wired teeSet instance is null, the button will be disabled !"); return false; } else { logger.info("wired teeSet instance is NOT null, the button will be enabled !"); logger.info("teeSet color: "+getInstance().getTeeSet().getColor()); return true; } } @RequestParameter public void setRoundId(Long id) { super.setId(id); } @Override protected Round createInstance() { Round round = super.createInstance(); round.setGolfer(currentGolfer); round.setDate(new java.sql.Date(System.currentTimeMillis())); return round; } } Here the xhtml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml"> <ui:define name="body"> <h:form id="roundform"> <rich:panel> <f:facet name="header>"> #{roundHome.managed ? 'Edit' : 'Add' } Round </f:facet> <s:decorate id="dateField" template="layout/edit.xhtml"> <ui:define name="label">Date:</ui:define> <rich:calendar id="date" datePattern="dd/MM/yyyy" value="#{round.date}"/> </s:decorate> <s:decorate id="notesField" template="layout/edit.xhtml"> <ui:define name="label">Notes:</ui:define> <h:inputTextarea id="notes" cols="80" rows="3" value="#{round.notes}" /> </s:decorate> <s:decorate id="totalScoreField" template="layout/edit.xhtml"> <ui:define name="label">Total Score:</ui:define> <h:inputText id="totalScore" value="#{round.totalScore}" /> </s:decorate> <s:decorate id="weatherField" template="layout/edit.xhtml"> <ui:define name="label">Weather:</ui:define> <h:selectOneMenu id="weather" value="#{round.weather}"> <s:selectItems var="_weather" value="#{weatherCategories}" label="#{_weather.label}" noSelectionLabel=" Select " /> <s:convertEnum/> </h:selectOneMenu> </s:decorate> <div style="clear: both;"> <span class="required">*</span> required fields </div> </rich:panel> <div class="actionButtons"> <h:commandButton id="save" value="Save" action="#{roundHome.persist}" rendered="#{!roundHome.managed}" /> <!-- disabled="#{!roundHome.wired}" /> --> <h:commandButton id="update" value="Update" action="#{roundHome.update}" rendered="#{roundHome.managed}" /> <h:commandButton id="delete" value="Delete" action="#{roundHome.remove}" rendered="#{roundHome.managed}" /> <s:button id="discard" value="Discard changes" propagation="end" view="/Round.xhtml" rendered="#{roundHome.managed}" /> <s:button id="cancel" value="Cancel" propagation="end" view="/#{empty roundFrom ? 'RoundList' : roundFrom}.xhtml" rendered="#{!roundHome.managed}" /> </div> <rich:tabPanel> <rich:tab label="Tee Set"> <div class="association"> <h:outputText value="Tee set not selected" rendered="#{round.teeSet == null}" /> <rich:dataTable var="_teeSet" value="#{round.teeSet}" rendered="#{round.teeSet != null}"> <h:column> <f:facet name="header">Course</f:facet>#{_teeSet.course.name} </h:column> <h:column> <f:facet name="header">Color</f:facet>#{_teeSet.color} </h:column> <h:column> <f:facet name="header">Position</f:facet>#{_teeSet.pos} </h:column> </rich:dataTable> </div> </rich:tab> </rich:tabPanel> </h:form> </ui:define> </ui:composition>

    Read the article

< Previous Page | 1 2 3 4