Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


puppy
Own Entries
1 Answer(s)      6 years ago
Posted in : Java Server Faces Questions



Advertisement
View Answers

December 23, 2008 at 6:47 AM


Hi Friend,

Code to help in solving the problem :

<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %>

<f:view>
<html>
<body>
<h:form>
<h:selectOneMenu id="som" value="#{MyBean.som}" title="select any one in this menu" onchange="submit()">
<f:selectItem id="si1" itemLabel="Thums Up" itemValue="11" />
<f:selectItem id="si2" itemLabel="Limca" itemValue="22" />
<f:selectItem id="si3" itemLabel="Pepsi" itemValue="33" />
<f:selectItem id="si4" itemLabel="Sprite" itemValue="44" />
<f:selectItem id="si5" itemLabel="Frooti" itemValue="55" />
<f:selectItem id="si6" itemLabel="Coca-Cola" itemValue="66" />
<f:valueChangeListener type="roseindia.MyBean" />
</h:selectOneMenu>
</h:form>
</body>
</html>
</f:view>

"MyBean.java"

package roseindia;

import java.util.*;
import javax.swing.*;
import javax.faces.event.*;

public class MyBean implements ActionListener,ValueChangeListener{
String som = "";
private Date today = new Date();
public void processAction(ActionEvent e){
JOptionPane.showMessageDialog(null,"Hi");
}

public void processValueChange(ValueChangeEvent ce){
JOptionPane.showMessageDialog(null, ce.getSource());
}

public String getSom(){
return som;
}

public void setSom(String som){
this.som = som;
}

public Date getToday(){
return today;
}

public void setToday(Date today) {
this.today = today;
}
}

For read more information on JSF visit to :

http://www.roseindia.net/jsf/

Thanks


Related Tutorials/Questions & Answers:
Own Entries - Java Server Faces Questions
their own entries in the Drop Down list.I want to use in this ValueChangeListener...Own Entries  Hi All, I have Date & Format Drop Down List boxes fields.when we click on the date field in the format field it should display
selecting entries
selecting entries  I have a textbox by the name country in the browser...and I have some entries of country in database like india, china, australia etc... As soon as I start to type "c" in the textbox , china should appear
Advertisements
Show all the entries of zip file.
Show all the entries of zip file. In this tutorial, We will  discuss how to show all the entries of a zip file.  The ZipFile   class is used to read entries of zip files. The entries() methods of ZipFile class 
class with in its own objects?
class with in its own objects?  Is it a good idea to declare a class with in its own objects
Own tag in XML
Own tag in XML  Hi.... Does XML let me make up my own tags? please anyone give the answer Thanks
How to fetch entries/values from database to a jsp page one by one?
How to fetch entries/values from database to a jsp page one by one?  I have a table in Microsoft SQL server Management Studio with two columns title... to display different database entries of the each column in different blocks. Now
to display NEXT and previous option after 10 entries in java
to display NEXT and previous option after 10 entries in java  As after jsp code we refer to java for connectivity and i want that directly only 10 entries will be open and next there will be pages. so what would i do for coding
Importing Your Own Package
Importing Your Own Package  I would like to know if it is possible to create a class with your own methods so that you can import them when writing programs
Making own SDK - MobileApplications
Making own SDK  Hi all, I am trying to make my own universal installer for installing the JavaME mobile application to all the phones supports java.For this where from i start to think
creating a own interceptor - Struts
creating a own interceptor   i want to create own interceptor how i will create and which class i want implement  Hi friend, Interceptors: An intercept is a method used to intercept a business method
You handle your own transaction
You handle your own transaction  How do you handle your own transaction
creating own ArrayList without Collections?
creating own ArrayList without Collections?  How can we write our own arraylist without using collections in JAVA
Import My Own Package (Automatically)
Import My Own Package (Automatically)   How can I import my own package in every java program ( automatically )....? For example :- java.lang.String... automatically imported, we need not to import
How to create own help forum - JSP-Servlet
How to create own help forum  Hi All, My client given requirements, they need to create their own help forum, I need to do case study for, how to create any forum. if you have any documentation or technical ideas please
how to make list in our own style in pdfwriter
how to make list in our own style in pdfwriter  can u please any of one help me i want to make a list as follows in pdf file from java by pdfwriter account calculation ------------------------- amount -100.00
Creating your own package in java
the real classes in the package. To know more about how to create own package and subpackage click on the following links Create Your Own Package Create
how to create own tld and use it in jspx file
how to create own tld and use it in jspx file  I wanted to add fmt as own tag and internationalize add.title=Add. please help me solve the problem. <!-- Document : add Created on : Mar 4, 2012, 7:00:38 PM
how to create own tld and use it in jspx file
how to create own tld and use it in jspx file  I wanted to add fmt as own tag and internationalize add.title=Add. please help me solve the problem. <!-- Document : add Created on : Mar 4, 2012, 7:00:38 PM
Create your own Notepad in Java
Create your own Notepad in Java           You must have worked with Notepad to write programs. Now its turn to create notepad by own with the help of java language
Creating own Interceptor
Creating own Interceptor Though Interceptors are provided by default in the stack, one can also create custom interceptors and add it to already existing list of interceptors. It is very easy to create your own interceptor. Custom made
What is "Bring Your Own Device" (BYOD)?
What is "Bring Your Own Device" (BYOD)? Bring your own device or as commonly... with their own tech devices ranging from mobile phones to laptops to tablets or other... of desktops all over the world in an unprecedented way. By referring to bring your own
I need to display parts of my own website on another website in an iframe
I need to display parts of my own website on another website in an iframe  I need to display parts of my own website on another website in an iframe. please refer me how do i do
How to put our own wanted thread into running state..?
How to put our own wanted thread into running state..?  How to put our own wanted thread into the running state by stopping already running one
Identify correct and incorrect statements about the purpose and use of the deployment descriptor elements for environment entries, EJB references, and resource manager connection factory r
of the deployment descriptor elements for environment entries, EJB... descriptor elements for environment entries, EJB references, and resource... ENTRIES are stored directly in the environment naming context, or in any
Retriving zip file stored in database into my own filesystem
Retriving zip file stored in database into my own filesystem  Hi all, I have a table named tempdb with tempid and zipfile as two column.Currently I am using sybase db. create table tempdb(tempid int,zipfile image) i have
Is there a data structure like a class that doesn't need to be defined as a class in it's own file?
Is there a data structure like a class that doesn't need to be defined as a class in it's own file?  I am new to java, and I am trying to make a complex program with ArrayLists of objects. Within the classes of these objects, I
Writing SEO Articles for Own Website,How to Write Effective SEO Articles for Own Website
Writing SEO Articles for Own Website Writing SEO articles for our own website requires a lot of commitment and hard work on our part. The article written by us must be capable in selling our services and publicizing our
we can create our own header file in java?n how to create?
we can create our own header file in java?n how to create?  we can create our own header file in java?n how to create
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p  Hi, I have designed a "back" button for jsp page. Now I want to disable Browser's default button So that people will use "back
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p  Hi, I have designed a "back" button for jsp page. Now I want to disable Browser's default button So that people will use "back
Create Your Own Package
Create Your Own Package       The package to which the source file belongs is specified with the keyword package at the top left of the source file, before the code
 

 

 

DMCA.com