Problem in populating textbox in jsf on clicking submit button
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   gopi_krishna
Posted On:   Monday, January 16, 2012 11:59 PM

I am having inputText box, dropdownlist , outputText box and a submit button in my jsp page. I am pre populating the dropdown list from my managed bean. On clicking the submit button and based on selected item from the drop down list, I need to perform populating outputText box. Page is coming up but lstService dropdown box is not displayed at all. But mnNum inputText and submitButton is showing properly. Also after pressing submit button, "abc" text must be displayed in outputText box. But its also not displayed. Instead, the below error is shown, Error opening /portlets/tools/webservicehelper/webservicehelper.faces. The source of this error is: java.util.Missing   More>>

I am having inputText box, dropdownlist , outputText box and a submit button in my jsp page.



I am pre populating the dropdown list from my managed bean.
On clicking the submit button and based on selected item from the drop down list, I need to perform populating outputText box.



Page is coming up but lstService dropdown box is not displayed at all. But mnNum inputText and submitButton is showing properly.
Also after pressing submit button, "abc" text must be displayed in outputText box. But its also not displayed. Instead, the below error is shown,



Error opening /portlets/tools/webservicehelper/webservicehelper.faces.
The source of this error is:



java.util.MissingResourceException: Can't find bundle for base name resources.bundles.ValidationMessages, locale en at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1521) at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260) at java.util.ResourceBundle.getBundle(ResourceBundle.java:962) at javax.faces.component.MessageFactory.getMessage(MessageFactory.java:102) at javax.faces.component.MessageFactory.getMessage(MessageFactory.java:175) at javax.faces.component.UIInput.validateValue(UIInput.java:1001) at javax.faces.component.UISelectOne.validateValue(UISelectOne.java:130) at javax.faces.component.UIInput.validate(UIInput.java:868) at



Any problems in below code?



My entire code below for UserBean.java and webservicehelper.jsp.



			
package net.verizon.portlet.bean;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.faces.*;
import javax.faces.model.*;


import java.util.*;


public class UserBean extends FacesBean {

private static final long serialVersionUID = 1L;

private String mnNum;
private String serviceType;
private String txtVal;


public String getmnNum() {
return mnNum;
}

public void setmnNum(String mnNum) {
this.mnNum = mnNum.toUpperCase();
}


public String getServiceType() {
return serviceType;
}

public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}

private ArrayList serviceItems = null;

public ArrayList getServiceItems() {
serviceItems = new ArrayList ();
serviceItems.add(new SelectItem(null,"select one..."));
serviceItems.add(new SelectItem("SearchService","SearchService"));
serviceItems.add(new SelectItem("basicService","basicService"));
return serviceItems;
}

public String submit() {

try {

txtVal = "abc";

}

catch(Exception e) {
logger.error("error in submit method" + e);
}
return null;


}

public String getRequesttxt() {

return txtVal;
}



}



--webservicehelper.jsp

<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://bea.com/faces/adapter/tags-naming" prefix="netuix" %>
<%@ taglib uri="http://www.bea.com/servers/portal/tags/netuix/render" prefix="render" %>













































   <<Less

Re: Problem in populating textbox in jsf on clicking submit button

Posted By:   jester_g  
Posted On:   Saturday, January 28, 2012 04:58 AM

sorting through all these codes is a headache for a beginner like me. I'm pretty sure that someone out there can help you with your query.

Shirley J. Bishop


home remedies for pimples
About | Sitemap | Contact