From users-return-60442-apmail-myfaces-users-archive=myfaces.apache.org@myfaces.apache.org Wed Jan 30 13:06:30 2013 Return-Path: X-Original-To: apmail-myfaces-users-archive@www.apache.org Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0EECCEE9E for ; Wed, 30 Jan 2013 13:06:30 +0000 (UTC) Received: (qmail 6742 invoked by uid 500); 30 Jan 2013 13:06:29 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 6514 invoked by uid 500); 30 Jan 2013 13:06:24 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 6475 invoked by uid 99); 30 Jan 2013 13:06:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jan 2013 13:06:23 +0000 X-ASF-Spam-Status: No, hits=2.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_REPLYTO_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [106.10.151.67] (HELO nm23-vm4.bullet.mail.sg3.yahoo.com) (106.10.151.67) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jan 2013 13:06:11 +0000 Received: from [106.10.166.112] by nm23.bullet.mail.sg3.yahoo.com with NNFMP; 30 Jan 2013 13:05:47 -0000 Received: from [106.10.151.123] by tm1.bullet.mail.sg3.yahoo.com with NNFMP; 30 Jan 2013 13:05:47 -0000 Received: from [127.0.0.1] by omp1005.mail.sg3.yahoo.com with NNFMP; 30 Jan 2013 13:05:47 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 90818.21222.bm@omp1005.mail.sg3.yahoo.com Received: (qmail 17972 invoked by uid 60001); 30 Jan 2013 13:05:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1359551147; bh=VBISqPTZNB+oTQ62NaUH7mtvOf1Tr2lKp1cBvQTIxmQ=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=GG2xeLT2LVcy+w+CNH/8+jy211hhM77uirtrTToWC19sReIaO7T5o2tgbSAv53c1jSVSpnygCKwzyPOf8xZPsenXrMjGhdLdWI9TcsftTPc0l360JE4GB8a05ArGb6zu6iAWtipMcs/B2q9rexGf6a2CjvEUhNBw2WhBlJe7xF8= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=idnf96w5cyKhxMhPH54mGq2s5+AfppLEc2cC8H/AtDZWDoNF0CvAXAFAkaQF9E6Vx4WEDS69abAIUMs4zE9GgcVdJt+2j/A0eGXQ6UyW9AUCaCCDn0xyl87e6JoCq9yneOEdRweGFSCp4N4UXQupWVAVnHfG8ADbt1LSuqxf7nw= ; X-YMail-OSG: 6BF7zwwVM1nDrQMnCWsUNwKDFXgRpRqezdSO8UE9Y7GnpQD EKAyqBdmEg0sigI3ydrEW.R4.t7BrV.iZMly4n3.PyTwn86laAZHlZUmtc5r lGe8GILVhFxGgngdd2hFv6lQh8FwxHwcwtaqtcMMzQEclXHr.ewytvv_gBEg 87miE3XMlz_qRTk.FVrKypBC5S9YL4LzfXEsozye4i351WhufNFR9q6ombAe 4uhvYnLdV.Rn3ST7n4IWP5LOknm9uLGYodHQg2UxBISkw_Qb1KyUOk5Vu584 eCYpD2gutK2QuDfz9ZiVC0rgkkk1GoRQZx1wHyJG1fZAkWZSVIL4REwEFHAZ GBhKF7dejkg0gjWu.3iwpTwrQxvEIaOZID2Z4dVNEo3HTqnZr15XpP8vAxVo LFTB2Vf1k27V_XeqzMBPwHLqvH7A_wmcw_qYl2rRRdgMI6nGEyR4QGI.0kur FAMIl4Xc.irX_1DdxFK3Ko9sgFXAyUs2y1b5VP2KQwaikgD5lVkbyaBzFHuf x2pCa0MpwJH9RfSR6fA4- Received: from [122.174.115.73] by web192705.mail.sg3.yahoo.com via HTTP; Wed, 30 Jan 2013 21:05:46 SGT X-Rocket-MIMEInfo: 001.001,SGVsbG8gQWxsLAoKwqBJIGhhdmUgYSB2ZXJ5IHNpbXBsZSBqc2YgcGFnZSBhbmQgYSBiYWNraW5nIGJlYW4gZm9yIHRoaXMganNmLCB3aGljaCBpcyBpbXBsZW1lbnRlZCBpbiBoaWJlcm5hdGUgdXNpbmcgTmV0YmVhbnMuCgrCoDxTZWxlY3Q.IGJ1dHRvbiBkb2VzIHByb3Blcmx5IHBvcHVsYXRlIHRoZSBsaXN0IGJveC4gPERldGFpbHM.IGJ1dHRvbiBkb2VzIGRpc3BsYXkgdGhlIGRlYnVnIG1lc3NhZ2UgaW4gZ2xhc3NmaXNoIGxvZywgd2hlbiBubyBlbnRyeSBpbiBsaXN0IGJveCBpcyBjaG9zZW4uCgrCoEEBMAEBAQE- X-Mailer: YahooMailWebService/0.8.131.499 Message-ID: <1359551146.11217.YahooMailNeo@web192705.mail.sg3.yahoo.com> Date: Wed, 30 Jan 2013 21:05:46 +0800 (SGT) From: Giri Prasad Reply-To: Giri Prasad Subject: Jsf Hibernate problem in SelectOneList event To: MyFaces Discussion MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-2118248970-1347091959-1359551146=:11217" X-Virus-Checked: Checked by ClamAV on apache.org ---2118248970-1347091959-1359551146=:11217 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hello All,=0A=0A=A0I have a very simple jsf page and a backing bean for thi= s jsf, which is implemented in hibernate using Netbeans.=0A=0A=A0, choose a entry from the list, pressing button, is not executing the backing bean function 'studDet()'. On this = situation, the screen just refreshes, the list goes empty, and the backing = bean function is not executed.=0A=0A=A0The same backing bean function ['stu= dDet()']=A0 is executed when nothing is selected from the list. Apparently = the logic when implemented via jpa seems to work just perfectly correctly.= =0A=0ACan any one provide your insights, as why this problem is occuring. T= hanks in advance.=0A=0ARegards,=0A=0A**************=0ACode=0A**************= =0A<%-- =0A=A0=A0=A0 Document=A0=A0 : StudentPage.jsp=0A--%>=0A=A0=0A<%@pag= e contentType=3D"text/html" pageEncoding=3D"UTF-8"%>=0A=A0=0A<%@taglib pref= ix=3D"f" uri=3D"http://java.sun.com/jsf/core"%>=0A<%@taglib prefix=3D"h" ur= i=3D"http://java.sun.com/jsf/html"%>=0A=A0=0A=0A=A0=0A=0A=A0=A0=A0 =0A=A0=A0=A0=A0=A0=A0=A0 =0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <= title>Student Page=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0= =A0 =A0=0A=A0=0A=0A=A0=0A<= h:inputText id=3D"Student" value=3D"#{studBean.teacherName}" size=3D"20" ma= xlength=3D"50">=0A=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 =A0=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 = =0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =0A= =A0=0A=0A=0A=A0=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 =A0=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =0A=A0=A0=A0=A0=A0=A0= =A0 =0A=0A=0A=A0=0A=A0=0A***************************= ******************************=0A// Backing bean=0A=A0=0A@ManagedBean=0A@Se= ssionScoped=0Apublic class StudBean implements Serializable=A0 {=0A=A0=0A= =A0=A0=A0 private String teacherName;=0A=A0=A0=A0 private List studentList;= =0A=A0=0A=A0=A0=A0 // Getter and setter methods omitted=0A=A0=A0=A0 //=0A= =A0=0A=A0=A0=A0 public String studSel() {=0A=A0=A0=A0=A0=A0=A0=A0 studentli= st =3D new ArrayList();=0A=A0=A0=A0=A0=A0=A0=A0 List cList =3D getStudentDe= tailForTeacher();=0A=A0=A0=A0=A0=A0=A0=A0 if(cList.isEmpty())=0A=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 return null;=0A=A0=A0=A0=A0=A0=A0 =A0=0A=A0=A0=A0= =A0=A0=A0=A0 for (int i =3D 0; i < cList.size(); i++) {=0A=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 SelectItem studentid =3D new SelectItem(cList.get(i).toS= tring());=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 studentList.add(studentid);= =0A=A0=A0=A0=A0=A0=A0=A0 }=0A=A0=A0=A0=A0=A0=A0=A0 return null;=0A=A0=A0=A0= }=0A=A0=0A=A0=0A=A0=A0=A0 public List getStudentDetailForTeacher= () {=0A=A0=A0=A0=A0=A0=A0=A0 this.session =3D HibernateUtil.getSessionFacto= ry().getCurrentSession();=0A=A0=A0=A0=A0=A0=A0=A0 List studentlis= t =3D null;=0A=A0=A0=A0=A0=A0=A0=A0 String strQuery =3D "select c.id.studen= tId "=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 + "from TeacherStuden= t c WHERE c.id.teacherId =3D :teachid1";=0A=A0=A0=A0=A0=A0=A0=A0 org.hibern= ate.Transaction tx =3D session.beginTransaction();=0A=A0=A0=A0=A0=A0=A0=A0 = Query cQuery =3D session.createQuery(strQuery);=0A=A0=0A=A0=A0=A0=A0=A0=A0= =A0 cQuery.setParameter("teachid1", teacherName);=0A=A0=A0=A0=A0=A0=A0=A0 s= tudentlist =3D (List) cQuery.list();=0A=A0=0A=A0=A0=A0=A0=A0=A0= =A0 return studentlist;=0A=A0=A0=A0 }=A0=A0 =A0=0A=A0=0A=A0=A0=A0 public vo= id studentCodeChanged(ValueChangeEvent e){=0A=A0=A0=A0=A0=A0=A0=A0 studentI= d =3D e.getNewValue().toString();=0A=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 System.out.println("studentId =3D "+studentId);=0A=A0=A0=A0=A0 }=0A= =A0=0A=A0=0A=A0=A0=A0 public Boolean studDet() {=0A=A0=A0=A0=A0=A0=A0=A0 Sy= stem.out.println("studentId id =3D "+studentId);=A0=A0 =A0=0A=A0=A0=A0=A0= =A0=A0=A0 return null;=0A=A0=A0=A0 }=A0=A0=A0=A0=A0=A0 =A0=0A=A0=0A} ---2118248970-1347091959-1359551146=:11217--