Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

Scrollable list...

Thread view: 
gbattine - 27 Jul 2006 17:36 GMT
Hi guys,
i've a question for you.
I'm developing a jsf application,i have a login page in which the user
has tree fields to insert, a login(free text), a password(free text)
and a team.
I want the user can choices team(student or worker) from a scrollable
list of two values.
How can realize this scrollable list?
Can you help me with code?
The form have to be authenticated by this action method called by
backing bean.
My doubles are about how can submit the value selected from the
2values-list(selectOneMenu i think..) to authenticationBean.
Please help me,i need your help because google hasn't helped
me..thanks...can you help me with simple code?
Thanks very much

public class AuthenticationBean extends BaseBean {
    /**
    *
    */
    private static final long serialVersionUID = 1;

    private String loginName;

    private String password;

    private String teamName;

    boolean registered;

    public AuthenticationBean() {
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPassword() {
        return password;
    }

    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }

    public String getTeamName() {
        return teamName;
    }

public String login(){
    String risultato=null;
    try{
        DataSource dataSource=Singleton.getInstance().getDataSource();
        Connection connection=dataSource.getConnection();
        if (connection != null) {
                    Statement statm = connection.createStatement();
                    String query = "SELECT * FROM user " + "WHERE username = '"
                            + loginName + "' " + "AND password = '" + password
                            + "' " + "AND teamname ='" + teamName + "'";
                    ResultSet rs = statm.executeQuery(query);
                    registered = false;
                    if (rs.next()) {
                        registered = true;
                                                connection.close();
                        risultato="login";
                    }
                    else risultato="failure";
                }
              
           
        }
Andrew Thompson - 27 Jul 2006 18:12 GMT
..
> I want the user can choices team(student or worker) from a scrollable
> list of two values.
> How can realize this scrollable list?

The same way it is done in HTML.

> Can you help me with code?

Sure..
<http://www.w3.org/MarkUp/html-spec/html-spec_8.html#sec8.1.3>

Andrew T.
gbattine - 27 Jul 2006 22:55 GMT
yes...but i want to use jsf tags...........


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.