Search Results

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

Page 23/148 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • NullpointerException Binding not working JSF managed bean.

    - by Nitesh Panchal
    Hello, I created a simple HtmlInputText <h:inputText binding="#{IndexBean.objUIInput}" /> Then in my managed bean, it is :- private UIInput objUIInput; public UIInput getObjUIInput() { objUIInput.setValue("laala"); return objUIInput; } public void setObjUIInput(UIInput objUIInput) { System.out.println("Set!!"); this.objUIInput = objUIInput; } But i always get NullpointerException. Do i need to do anything extra on my JSF page? like we do jsp:usebean setproperty? Please help me.

    Read the article

  • Conditionally setting the font color of an item in a drop down box in JSF

    - by Greg
    I'm a newbie to web programming, so please bear with me. I am using JSF 1.2 and I want to conditionally set the color of the items in my drop down list. In other words, I have a collection of items that, along with a key and a value, also have a boolean property, warning, that is dynamically set by user action. I want the drop down to show all of the items, but those whose warning property is set to true should be displayed in red. I assume I have to extend the SelectItem class to add in the boolean property. How do I then conditionally set the color of the font of those items whose warning property is set to true in my JSP pages? Thanks in advance

    Read the article

  • User forms authentication in JSF

    - by Proton
    I'm a novice at JSF and I got a couple of questions concerning organizing user authentication there. 1) How can i redirect the registered user to a welcome page (for example welcome.xhtml)? I heard about using Filter or navigation-rule tag, but i didn't found a full-blown tutorial of how it works. 2) How can i tell the server that unauthorized users can access not only the login page but also the registration page? Is there an analog for ASP.NET web.config tag or something like this?

    Read the article

  • JSF Pass parameter to another page

    - by DD
    In JSF how do you pass a parameter from one page to another without using managed beans? e.g. <h:dataTable value="#{myObjects}" var="object"> <h:column> <h:commandButton value="View Object" action="view-object"/> </h:column> </h:dataTable> I want to pass the object so an the next page I can simply do #{object.displayValue} Thxs.

    Read the article

  • JSF - 2 a4j:actionParam in one commandlink bug

    - by Yurish
    Hi! I have such structure in my jsp: <h:commandLink action=#{docbean.save}> <a4j:actionParam value="bill_all" assignTo="#{billdoc.billType}"/> <a4j:actionParam value="bill_document" assignTo="#{docbean.doctype}"/> </h:commandLink> While debugging i saw, that billdoc.billtype and docbean.doctype have the same values: "bill_document". Is it bug? If not, then how can i put value to my managed-bean?

    Read the article

  • How do I make a third party .jar available to my .jsp page?

    - by Matthew
    I'm just starting to learn JSP (and I'm pretty new to Java in general), and I'd like to use JSON-lib with it. I want to make a page something like this: <%@ page import="net.sf.json.JSONObject"%> <% String json = new JSONObject().put("hello", "world").toString(); out.println(json); %> I downloaded json-lib-2.3-jdk15.jar and put it in the same directory as the .jsp page. But I get this error org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 6 in the generated java file Only a type can be imported. net.sf.json.JSONObject resolves to a package An error occurred at line: 3 in the jsp file: /getCard.jsp JSONObject cannot be resolved to a type 1: <%@ page import="net.sf.json.JSONObject" %> 2: <% 3: String json = new JSONObject().put("hello", "world").toString(); 4: out.println(json); 5: %> 6: How do I make the JSONObject class available to my .jsp page?

    Read the article

  • Not getting image in h:graphicImage in JSF

    - by Nitesh Panchal
    Hello, I have this very strange error with h:graphicImage This code works fine :- <h:graphicImage value="/Common/Images/#{item.templatePicName}"/> And this one doesn't :- <h:graphicImage alt="${app:getCommonImagePath(item.templatePicName)}" value="${app:getCommonImagePath(item.templatePicName)}" /> It only shows alt value /Common/Images/Sunset.jpg which is perfectly fine and works in 1st case. Then why doesn't it work in 2nd case? There are no problems with my images. They are present in right directory. here getCommonImagePath is my custom EL function, whose definition is : package Common; public final class AppDeployment { private AppDeployment(){ //hide constructor } private static String commonImageFolderPath = "/Common/Images/"; public static String getCommonImagePath(String picName){ return commonImageFolderPath + picName; } }

    Read the article

  • Getting ClassCastException with JSF 1.2 Custom Component and BEA 10.3

    - by Tobi
    Im getting a ClassCastException if i use Attributes in my Custom Headline Tag. Without Attributes rendering works fine. Calling <t:headline value="test" /> gives a ClassCastException even before a Method in my HeadlineComponent or HeadlineTag-Class is called. <t:headline /> works fine. I'm using MyFaces-1.2, on BEA 10.3 default.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <%@ taglib prefix="t" uri="http://www.tobi.de/taglibrary" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Tobi Test</title> </head> <body> <f:view> <t:headline value="test" /> </f:view> </body> </html> HeadlineComponent.java package tobi.web.component.headline; import java.io.IOException; import javax.el.ValueExpression; import javax.faces.component.UIOutput; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; public class HeadlineComponent extends UIOutput { private String value; private Integer size; @Override public Object saveState(FacesContext context) { Object values[] = new Object[3]; values[0] = super.saveState(context); values[1] = value; values[2] = size; return ((Object)(values)); } @Override public void restoreState(FacesContext context, Object state) { Object values[] = (Object[])state; super.restoreState(context, values[0]); value = (String)values[1]; size = (Integer)values[2]; } @Override public void encodeBegin(FacesContext context) throws IOException { // Wenn keine Groesse angegeben wurde default 3 String htmlTag = (size == null) ? "h3" : "h"+getSize().toString(); ResponseWriter writer = context.getResponseWriter(); writer.startElement(htmlTag, this); if(value == null) { writer.write(""); } else { writer.write(value); } writer.endElement(htmlTag); writer.flush(); } public String getValue() { if(value != null) { return value; } ValueExpression ve = getValueExpression("value"); if(ve != null) { return (String)ve.getValue(getFacesContext().getELContext()); } return null; } public void setValue(String value) { this.value = value; } public Integer getSize() { if(size != null) { return size; } ValueExpression ve = getValueExpression("size"); if(ve != null) { return (Integer)ve.getValue(getFacesContext().getELContext()); } return null; } public void setSize(Integer size) { if(size>6) size = 6; if(size<1) size = 1; this.size = size; } } HeadlineTag.java package tobi.web.component.headline; import javax.el.ValueExpression; import javax.faces.component.UIComponent; import javax.faces.webapp.UIComponentELTag; public class HeadlineTag extends UIComponentELTag { private ValueExpression value; private ValueExpression size; @Override public String getComponentType() { return "tobi.headline"; } @Override public String getRendererType() { // null, da wir hier keinen eigenen Render benutzen return null; } protected void setProperties(UIComponent component) { super.setProperties(component); HeadlineComponent headline = (HeadlineComponent)component; if(value != null) { if(value.isLiteralText()) { headline.getAttributes().put("value", value.getExpressionString()); } else { headline.setValueExpression("value", value); } } if(size != null) { if(size.isLiteralText()) { headline.getAttributes().put("size", size.getExpressionString()); } else { headline.setValueExpression("size", size); } } } @Override public void release() { super.release(); this.value = null; this.size = null; } public ValueExpression getValue() { return value; } public void setValue(ValueExpression value) { this.value = value; } public ValueExpression getSize() { return size; } public void setSize(ValueExpression size) { this.size = size; } } taglibrary.tld <?xml version="1.0" encoding="UTF-8" ?> <taglib xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd" version="2.1"> <description>Tobi Webclient Taglibrary</description> <tlib-version>1.0</tlib-version> <short-name>tobi-taglibrary</short-name> <uri>http://www.tobi.de/taglibrary</uri> <tag> <description>Eine Überschrift im HTML-Stil</description> <name>headline</name> <tag-class>tobi.web.component.headline.HeadlineTag</tag-class> <body-content>empty</body-content> <attribute> <description>Der Text der Überschrift</description> <name>value</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <description>Die Größe der Überschrift nach HTML (h1 - h6)</description> <name>size</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> </taglib> faces-config.xml <?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd" version="1.2"> <component> <description>Erzeugt eine Überschrift nach HTML-Stil</description> <display-name>headline</display-name> <component-type>tobi.headline</component-type> <component-class>tobi.web.component.headline.HeadlineComponent</component-class> <attribute> <attribute-name>value</attribute-name> <attribute-class>java.lang.String</attribute-class> </attribute> <attribute> <attribute-name>size</attribute-name> <attribute-class>java.lang.Integer</attribute-class> <default-value>3</default-value> </attribute> </component> </faces-config>

    Read the article

  • JSF with Enum 'Validation Error: Value is not valid'

    - by Shamik
    I have an enum whose code is like this - public enum COSOptionType { NOTAPPLICABLE, OPTIONAL, MANDATORY; private String[] label = { "Not Applicable", "Optional", "Mandatory"}; @Override public String toString() { return label[this.ordinal()]; } public static COSOptionType getCOSOption(String value) { int ivalue = Integer.parseInt(value); switch(ivalue) { case 0: return NOTAPPLICABLE; case 1: return OPTIONAL; case 2: return MANDATORY; default: throw new RuntimeException("Should not get this far ever!"); } } } I have the converter to convert the enum type public class COSEnumConverter implements Converter { public Object getAsObject(FacesContext context, UIComponent comp, String value) { return COSOptionType.getCOSOption(value); } public String getAsString(FacesContext context, UIComponent comp, Object obj) { if (obj instanceof String) { return (String) obj; } COSOptionType type = (COSOptionType) obj; int index = type.ordinal(); return ""+index; } } The view looks like this <h:selectOneMenu value="#{controller.type}" id="smoking"> <f:selectItems value="#{jnyController.choices}" /> </h:selectOneMenu> Here is the code for create choices private List<SelectItem> createChoicies() { List<SelectItem> list = new ArrayList<SelectItem>(); for (COSOptionType cos : COSOptionType.values()) { SelectItem item = new SelectItem(); item.setLabel(cos.toString()); item.setValue("" + cos.ordinal()); list.add(item); } return list; } I do not understand why this would throw "validation error" all the time ? I can debug and see that the converter is working fine. NOTE: I am using JSF 1.1

    Read the article

  • JQuery, JSF and a4j:commandLink

    - by JQueryNeeded
    Hello ppl, I have a problem with using jQuery Dialog and Ajax submit in JSF. I have the following code for displaying Dialog windows: <script type="text/javascript"> jQuery(function(){ // Dialog jQuery('#dialog').dialog({ dialogClass: 'alert', autoOpen: false, width: 300, height: 150, modal: true, resizable: false, overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { "Ok": function() { jQuery(this).dialog("close"); return true; }, "Cancel": function() { jQuery(this).dialog("close"); return false; } } }); // Dialog Link jQuery('#dialog_link').click(function(){ jQuery('#dialog').dialog('open'); return false; }) .hover( function() { jQuery(this).addClass('ui-hover-state'); }, function() { jQuery(this).removeClass('ui-hover-state'); } ); }); </script> It works as it should - it displays box when link is clicked. Now, I have something like this, for deleting something: <a4j:commandLink actionListener="#some.action" reRender="something" onclick="if(!jQuery('#dialog').dialog('open')){return false}" ok, this commandLink is rendered as follows: <a href="#" id="some:long:id:j_id338" name="formName:something:j_id338" onclick="if(!jQuery('#dialog').dialog('open')){return false};A4J.AJAX.Submit('something:something'); return false;" >drop</a> now, after displaying the dialog box, the A4j.AJAX.Submit(..) is executed, is there anyway, that I can for example, pass the whole A4J.AJAX.Submit(...) to "dialog" and execute it from "ok" option? I simply need to execute submit if and only if user clicks OK. Thank you for help JQ

    Read the article

  • JSF invoke backing bean method and reRender components on ENTER key

    - by Markos Fragkakis
    Hi, I have a datatable with as search fields. I want a method on the backing bean to be invoked when ENTER key is pressed, as well as the DataTable to be re-rendered. My approach so far only works in IE 6, and 7, not in FF. This is the inputText: <h:inputText value="#{applicantProductListBean.applicantNameFilterValue}" id="applicantNameFilterValue" onkeypress="submitByEnter(event)"> </h:inputText> and this is the Javascript method I am invoking: function submitByEnter(e){ if(e.keyCode==13){ // alert("Enter was pressed"); e.returnValue=false; e.cancel=true; document.getElementById("applicantProductListForm:refreshButton").click(); } } As you can see, the Javascript method clicks on the button refresh, which exists on the page: <a4j:commandButton value="Refresh" id="refreshButton" action="#{applicantProductListBean.refreshData}" image="/images/icons/refresh48x48.gif" reRender="table, scroller"> </a4j:commandButton> The refreshData method does not return anything. As said before, this only works in IE 6 and IE 7. Does anyone know why it does not work in FF? An alternative I was considering was HotKey, which can indeed catch the event of ENTER, but it can only invoke Javascript, so it isn't appropriate. Is the proper way to do this via RichFaces or plain JSF? Cheers! UPDATE: Slightly modified the answer by BalusC, the script that works is: if (event.preventDefault) { // Firefox event.preventDefault(); } else { // IE event.returnValue = false; }

    Read the article

  • JSF: SelectOneRadio shortcuts for options

    - by pakore
    I have the following h:selectOneRadio: <h:selectOneRadio style="text-align:left" layout="pageDirection" id="#{prefix}_rating" value="#{examinationPanel.tempResult}" > <f:selectItems value="#{examinationPanel.options}"></f:selectItems> </h:selectOneRadio> And then the backing bean is loading the options based on some userpreferences: public List<SelectItem> loadOptions (Set<ResultEnum> possibleResults){ messages =ResourceBundle.getBundle("com.eyeprevent.resources.Messages",FacesContext.getCurrentInstance().getViewRoot().getLocale()); List<SelectItem> options = new ArrayList<SelectItem>(); for(ResultEnum result:possibleResults){ SelectItem option = new SelectItem(result,messages.getString(result.name())); options.add(option); } return options; } How can I define shortcuts for the options in the radio group? por example typing "1" selects the first option, typing "2" the second, etc... Thanks in advance! ps. I'm using Jsf 1.2, Richfaces, Primefaces and Facelets.

    Read the article

  • JSF ISO-8859-2 charset

    - by Vladimir
    Hi! I have problem with setting proper charset on my jsf pages. I use MySql db with latin2 (ISO-8859-2 charset) and latin2_croatian_ci collation. But, I have problems with setting values on backing managed bean properties. Page directive on top of my page is: <%@ page language="java" pageEncoding="ISO-8859-2" contentType="text/html; charset=ISO-8859-2" %> In head I included: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2"> And my form tag is: <h:form id="entityDetails" acceptcharset="ISO-8859-2"> I've created and registered Filter in web.xml with following doFilter method implementation: public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding("ISO-8859-2"); response.setCharacterEncoding("ISO-8859-2"); chain.doFilter(request, response); } But, i.e. when I set managed bean property through inputText, all special (unicode) characters are replaced with '?' character. I really don't have any other ideas how to set charset to pages to perform well. Any suggestions? Thanks in advance.

    Read the article

  • Conditionally display row using JSF Datatable

    - by Elie
    I have some JSF code that currently works (as shown below), and I need to modify it to conditionally suppress the display of certain rows of the table. I know how to conditionally suppress the display of a particular cell, but that seems to create an empty cell, while what I'm trying to do is to not display the row at all. Any suggestions? <h:dataTable styleClass="resultsTable" id="t1" value="#{r.common}" var="com" headerClass="headerBackgrnd" rowClasses="rowOdd, rowEven" columnClasses="leftAlign, rightAlign, leftAlign"> <h:column> <h:outputText rendered="#{com.rendered}" styleClass="inputText" value="#{com.description}: " /> </h:column> <h:column> <h:outputText styleClass="outputText" value="#{com.v1}" /> </h:column> <h:column> <h:inputText styleClass="inputText" value="#{com.v2}" /> </h:column> </h:dataTable> Basically, the line that says #{com.rendered} will conditionally display the contents of a single cell, producing an empty cell when com.rendered is false. But I want to skip an entire row of the display under certain conditions - how would I go about doing that?

    Read the article

  • JSF and CXF not working together

    - by Milan
    I want to make dynamic web service invoker in JSF with CXF. But when I load this simple code I get error. The code: JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); Client client = dcf.createClient("http://ws.strikeiron.com/IPLookup2?wsdl"); The error: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions! If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml. A typical config looks like this; org.apache.myfaces.webapp.StartupServletContextListener Caused by: java.lang.IllegalStateException - No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions! If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml. A typical config looks like this; org.apache.myfaces.webapp.StartupServletContextListener Any Idea how to solve the problem? I'm using Tomcat 6.

    Read the article

  • How to show data in dataTable lable:data in jsf

    - by palakolanusrinu
    Hi How to display lable: data name: srinu in multiple rows using dataTable in jsf right now i'm getting like | lable | data| data srinu i want it in this formate lable: data name: srinu code which used is <h:dataTable id="fundInfo" value="#{clientFundInfo}" border="1" var="client" first="0" rows="5" rules="all"> <h:column> <h:outputText value="CLIENT:"/> <h:outputText value="#{client.clientName}"></h:outputText> </h:column> <h:column> <h:outputText value="FUND:"/> <h:outputText value="#{client.fundName}"></h:outputText> </h:column> <h:column> <h:outputText value="Employer Identification Number:"/> <h:outputText value="#{client.empIdentificationNum}"></h:outputText> </h:column> <h:column><h:outputText value="FISCAL YEAR ENDED:"/> <h:outputText value="#{client.fye}"></h:outputText> </h:column> <h:column><h:outputText value="Shares Outstanding"/> <h:outputText value="#{client.sharesOutstanding}"></h:outputText> </h:column> </h:dataTable>

    Read the article

  • How do I add a URL parameter to redirected login page using JSF 2.0

    - by Big Al
    I have a question about session timeouts and JSF 2. I have my exception handler working exactly the way everyone prefers but I need to pass a value to the login page. For example, I have a typical login URL - www.acme.com/?companyId=company14 which in turn presents company14 with their own custom login page (using their logo). After they enter the application and do a bit of work, they read an email or 2. The session times out and a session timeout page is shown instructing the user to click Ok to proceed to the login page. How do I add ?companyId=company14 to the URL? I can hardcode it in the exception handler by using this: requestMap.put("companyId", "company14"); and then referring to it on the viewExpired.xhtml page: <h:panelGrid id="expiredGrid" columns="1"> <f:facet name="header"> <h:outputText id="outExpireMsg" value="Your session has expired"/> </f:facet> <h:outputText id="outReqMessage" value="Reloading the page will require login."/> <h:outputText value=""/> <h:button id="okButton" type="submit" value="Ok" outcome="login?companyId=#{companyId}"/> </h:panelGrid> The issue is I can't seem to save the companyId anywhere without it getting wiped out by the session timeout. I'd like to set the companyId in the exceptionhandler using this value. Any ideas?

    Read the article

  • Implementing subtables in JSF 1.1

    - by Xenon
    We're looking for a way to implement subtables in JSF 1.1. We cannot use Rich Faces due to the fact that out target server is WebSphere 6.1. I've tried JSTL and Tomahawk to no avail. Also, our project is using JSP's and not facelets. Here's my HTML/JSTL example: <table border="1" width="700px"> Header 1 Header 2 Header 3 Header 4 Header 5 ${item.value1} ${item.value2} ${item.value3} ${item.value4} ${item.value5} <tr> <td colspan="5"> <table border="1" width="100%"> <thead> <tr> <td>SubHeader 1</td> <td>SubHeader 2</td> <td>SubHeader 3</td> <td>SubHeader 4</td> <td>SubHeader 5</td> </tr> </thead> <!-- For loop iteration over subtable data --> <c:forEach var="subitem" items="${item.subtable}"> <tr> <td>${subitem.value1}</td> <td>${subitem.value2}</td> <td>${subitem.value2}</td> <td>${subitem.value2}</td> <td>${subitem.value2}</td> </tr> </c:forEach> </table> </td> </tr>

    Read the article

  • JSF/Facelets: set `action` attribute to a dynamically evaluated string

    - by harto
    In my JSF/Facelets application, I want to dynamically generate a breadcrumb trail from a list of page IDs using a custom tag: <foo:breadcrumbs trail="foo,bar,baz"/> This should generate something like: <h:commandLink action="foo" ... /> <h:commandLink action="bar" ... /> <!-- (etc.) --> My code looks something like this: <ui:repeat value="#{fn:split(trail, ',')}" var="key"> <h:commandLink action="#{key}" ... /> </ui:repeat> The problem with this code is that #{key} is interpreted as a method binding. However, I just want the string value of #{key} to be returned as the navigation outcome. How can I achieve this? The only thing I could think of was creating a dummy managed-bean that has an outcome field and an action handler, and invoke it like so: <h:commandLink action="#{dummy.click}" ...> <f:setPropertyActionListener target="#{dummy.outcome}" value="#{key}" /> </h:commandLink> with the dummy class defined like so: public class Dummy { private String outcome; public String click() { return outcome; } public void setOutcome(String outcome) { this.outcome = outcome; } public void getOutcome() { return outcome; } } That seems ugly though, and I don't know if it would work.

    Read the article

  • JSF/ADF/PPR can't refresh the page as expected

    - by Nhut Le
    Hi, I am having issues with JSF/ADF/PPR on refreshing the page incorrectly. I have a selectManyCheckBox with 5 options in it, one of the option is 'All'. If users check that checkbox, I should check all the others. <h:panelGrid styleClass="myBox leftAligned" id="applyChangesBox"> <af:selectManyCheckbox id="changesCheckedBox" autoSubmit="true" label="Hello: " value="#{updateForm.applyChangesList}" valueChangeListener="#{updateForm.testValueChanged}"> <af:selectItem value="A" label="All Changes"/> <af:selectItem value="R" label="Residential Address"/> <af:selectItem value="M" label="Mailing Address"/> <af:selectItem value="P" label="Personal Phone/Fax Numbers"/> <af:selectItem value="E" label="Personal Email Addresses"/> </af:selectManyCheckbox> <af:outputText value="#{updateForm.testValue}" partialTriggers="changesCheckedBox"/> </h:panelGrid> I am using valueChangeListener so that I can see my bean updated and printed out correctly, but my page does not refresh and check all the other checkbox if I need to.

    Read the article

  • JSF/Seam - call one component method for many radio groups

    - by purecharger
    I've got the following jsf page: <h:form> <ui:repeat value="#{list.categories}" var="cat"> <h:selectOneRadio id="sel1Rad" value="#{list.choose}" layout="pageDirection"> <f:selectItems value="#{list.names}"/> </h:selectOneRadio> </ui:repeat> <h:commandButton id="submit" action="#{list.submit}" value="Submit"/> </h:form> And a component named list. The variable cat is injected to the component, used by the method list.getNames(). What I am trying to have happen is to have list.choose() be called for each radio group. I'm not sure if this is possible with Seam. Going by the booking example distributed with Seam, there is a distinct separate method for each selectOneRadio or selectOneMenu group. Since I have an unknown number of categories, I can't / don't want to define a method for each possible choice. When I submit the form, all my choices are sent in the POST, I just don't know the correct way to tell Seam how to dispatch them to my component. Any help is appreciated!

    Read the article

  • JSF 2 f:ajax lifecycle problem

    - by gerry
    The problem is, that if a property is changed during an f:ajax request and a binded panelGroup should be newly created depending on that changed value, the old value is used. This code will explain the problem. Here is the backingbean TestBean: public String getFirst() { return first; } public void setFirst(String first) { this.first = first; } public String getLast() { return last; } public void setLast(String last) { this.last = last; } public String getName(){ return first+" "+last; } public void setDynamicPanel(HtmlPanelGroup panel){ } public HtmlPanelGroup getDynamicPanel(){ Application app = FacesContext.getCurrentInstance().getApplication(); HtmlPanelGroup component = (HtmlPanelGroup)app.createComponent(HtmlPanelGroup.COMPONENT_TYPE); HtmlOutputLabel label1 = (HtmlOutputLabel)app.createComponent(HtmlOutputLabel.COMPONENT_TYPE); label1.setValue(" --> "+getFirst()+" "+getLast()); component.getChildren().add(label1); return component; } and now the jsf/facelet code: <h:form id="form"> <h:panelGrid columns="1"> <h:inputText id="first" value="#{testBean.first}" /> <h:inputText id="last" value="#{testBean.last}" /> <h:commandButton value="Show"> <f:ajax execute="first last" render="name dyn" /> </h:commandButton> </h:panelGrid> <h:outputText id="name" value="#{testBean.name}" /> <h:panelGroup id="dyn" binding="#{testBean.dynamicPanel}" /> </h:form> After the page was initially loaded the outputText and panelGroup shows both "null" as first and last. But after the button is pressed, the outputText is updated well, but the the panelgroup shows again only "null". This is due to the problem, that the "binded method" dynamicPanel is executed before the update of the first and last properties. how can workaround this behaviour or what is wrong with my code?

    Read the article

  • JSF Float Conversion

    - by Phill Sacre
    I'm using JSF 1.2 with IceFaces 1.8 in a project here. I have a page which is basically a big edit grid for a whole bunch of floating-point number fields. This is implemented with inputText fields on the page pointing at a value object with primitive float types Now, as a new requirement sees some of the fields be nullable, I wanted to change the value object to use Float objects rather than primitive types. I didn't think I'd need to do anything to the page to accomodate this. However, when I make the change I get the following error: /pages/page.xhtml @79,14 value="#{row.targetValue}": java.lang.IllegalArgumentException: argument type mismatch And /pages/page.xhtml @79,14 value="#{row.targetValue}": java.lang.IllegalArgumentException: java.lang.ClassCastException@1449aa1 The page looks like this: <ice:inputText value="#{row.targetValue}" size="4"> <f:convertNumber pattern="###.#" /> </ice:inputText> I've also tried adding in <f:convert convertId="javax.faces.Float" /> in there as well but that doesn't seem to work either! Neither does changing the value object types to Double. I'm sure I'm probably missing something really simple but I've been staring at this for a while now and no answers are immediately obvious!

    Read the article

  • JSF don't find component in view root with the form id

    - by kenzokujpn
    I have a t:inputFileUpload inside the form, in the html of the display page the id of this component is form:inputFile but when I tried to get the component from the view root using "form:inputFile" the return is null, but when the "form:" is removed the return is the component. The component don't set the value in my managed bean, someone have this problem? EDIT: <h:form id="form" enctype="multipart/form-data"> <t:inputFileUpload id="inputFile" size="40" value="#{managedBean.inputFile}"/> </h:form> In the managed bean: private UploadedFile inputFile; with the gets and sets provided by Eclipse. //This method scans the view root and returns the component with the id passed as parameter findComponentInRoot("form:inputFile"); This returns null, but when I use: //This method scans the view root and returns the component with the id passed as parameter findComponentInRoot("inputFile"); The return is the component I'm looking for, but when I use the View Source in Internet Explorer the id of this component is "form:inputFile". I don't know if this is related, but the component don't set the value in my managed bean and it's strange the fact that the id of the component is different from the HTML source. I'm using JSF 1.2 Mojarra. Someone else has this problem? Or know why this happens?

    Read the article

  • jsf messed up links

    - by Mateusz
    I'm new to JSF. My application is working, but I'm confused with links in browser when using controller. BTW, there is also PrimeFaces in my app so don't be suprised with p: tags. Let's say I have 'list' and 'show' pages with controller doing redirection between them. First I'm on http://localhost:8080/y/r/conversation/list.xhtml page. There is link created with line <p:commandLink action="#{lazyConversationBean.doShow(conv)}" ajax="false" value="View"/>. lazyConversationBean acts here as my Controller. There is method: public String doShow(Conversation c) { this.setSelectedConversation(c); return "view"; } from which I got redirected to ...... again http://localhost:8080/y/r/conversation/list.xhtml (browser shows it) even when it's correct http://localhost:8080/y/r/conversation/view.xhtml page. There I have link <p:commandButton action="#{lazyConversationBean.doList()}" ajax="false" value="Back to list"/> and again controller has method: public String doList() { return "list"; } from which I got redirected to ... yeah, you guessed right ... http://localhost:8080/y/r/conversation/view.xhtml (that is again what browser shows) even when again it is correct http://localhost:8080/y/r/conversation/list.xhtml page. It seams as browser link area is always one step behind page currently being displayed. I don't even know if it's some incorrect behaviour as I have no idea how to query google for this :D Just for test I did this short tutorial, where netbeans created whole stack of code on one of my entities, and behaviour was the same, so it's not PrimeFaces magic related. Can you tell my why it happens, and how to fix it? Users likes to copy correct links ;)

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >