Re: 2 different RadioButtons (completely free to eachother ) behave like connected to each other

2012-05-21 Thread nofear
Thanks Jens,

i'm trying it now.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



2 different RadioButtons (completely free to eachother ) behave like connected to each other

2012-05-21 Thread nofear
Hello guys,

I have a weird problem in my project , basicly speaking , I created a
widget called readingQuestionsWidget , it has UI to show the reading
questions for my exam project , in its controller class i fetch
reading questions from my database ( a question has a reading text and
4 different options below the text, so i prepared 4 radio buttons for
the options.) , for all different reading questions i put a READING
WIDGET which i created, for example , if there are 2 reading questions
i put 2 different READING WIDGETs(which they have 2 different text
boxes for the reading texts and 8 different radio buttons ( each 4
belongs to a reading text) ) on my page.

While i want to control the answers (which i check a radio button) ,
for example , the radio button for the option "A)" of two different
questions behave like connected to each other. I mean , when i check
the A) option for the 2 different questions , the first one that i
checked behave like NOT CHECKED.

here are my classes;

OgrenciReadingWidget.java
---

package tr.edu.gsu.yds.client.view.widget;

import com.google.gwt.i18n.client.HasDirection.Direction;

public class OgrenciReadingWidget extends Composite
{

private Label   soruMetniLabel  = new Label( 
"Reading Sorusu
Metni" );
private FormWidget  formWidget  = new 
FormWidget();
private RichTextAreareadingTextBox  = new RichTextArea();
private HorizontalPanel horizontalPanel1= new HorizontalPanel();
private HorizontalPanel horizontalPanel2= new HorizontalPanel();
private HorizontalPanel horizontalPanel3= new HorizontalPanel();
private HorizontalPanel horizontalPanel4= new HorizontalPanel();

private VerticalPanel   verticalPanel1  = new VerticalPanel();





private RadioButton radioButtonSecenekA ;

Label   lblSecenekIcerikA   = new Label();

private RadioButton radioButtonSecenekB ;

Label   lblSecenekIcerikB   = new Label();

private RadioButton radioButtonSecenekC ;

Label   lblSecenekIcerikC   = new Label();

private RadioButton radioButtonSecenekD ;

Label   lblSecenekIcerikD   = new Label();

private Button  clearButton = new Button( 
"Temizle" );
private Button  okayButton  = new Button( 
"Tamam" );

public OgrenciReadingWidget()
{
radioButtonSecenekA = new RadioButton( "A)" );
radioButtonSecenekB = new RadioButton( "B)" );
radioButtonSecenekC = new RadioButton( "C)" );
radioButtonSecenekD = new RadioButton( "D)" );

formWidget.getFormWidgetContainer().setWidget( 0, 0,
soruMetniLabel );
readingTextBox.setPixelSize( 450, 200 );
formWidget.getFormWidgetContainer().setWidget( 1, 0,
readingTextBox );
horizontalPanel1.setSpacing(1);


horizontalPanel1.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
verticalPanel1.add( horizontalPanel1 );
horizontalPanel1.setSize("470px", "30px");
horizontalPanel2.setSpacing(1);


horizontalPanel2.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
verticalPanel1.add( horizontalPanel2 );
horizontalPanel2.setSize("470px", "30px");
horizontalPanel3.setSpacing(1);


horizontalPanel3.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
verticalPanel1.add( horizontalPanel3 );
horizontalPanel3.setSize("470px", "30px");
horizontalPanel4.setSpacing(1);


horizontalPanel4.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
verticalPanel1.add( horizontalPanel4 );
horizontalPanel4.setSize("470px", "30px");




horizontalPanel1.add( radioButtonSecenekA );
horizontalPanel2.add( radioButtonSecenekB );
horizontalPanel3.add( radioButtonSecenekC );
horizontalPanel4.add( radioButtonSecenekD );


lblSecenekIcerikA.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);


horizontalPanel1.add( lblSecenekIcerikA );
horizontalPanel1.setCellVerticalAlignment(lblSecenekIcerikA,
HasVerticalAlignment.ALIGN_MIDDLE);
horizontalPanel1.setCellHorizontalAlignment(lblSecenekIcerikA,
HasHorizontalAlignment.ALIGN_CENTER);
lblSecenekIcerikA.setSize("426px", "20px");

lblSecenekIcerikB.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
horizontalPanel2.add( lblSecenekIc

How to get connected client count ?

2012-05-16 Thread nofear
Hello guys,

I have a simple question and i couldn't find the answer yet,

- I'm developing an exam project with GWT , and how can i get the
current client number which is connected to my system ? For example,
students will connect to the web site and i have to calculate the
connected client number.
Is there a method or a way to do this ?

Thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: hibernate , getting data List from database problem

2012-03-19 Thread nofear
Thanks , i fixed the problem , basicly , the problem was on the domain
class SinavTakvim , because sinavtakvimId is type varchar(10) on the
database  but in this class , i typed integer for it. I've fixed the
lines and it works perfectly now.


Best Regards.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



hibernate , getting data List from database problem

2012-03-18 Thread nofear
Hi guys ,

İ have a hibernate problem again, here's my problem ,
I have an exam schedule table in my database and i inserted 3 rows of
data in this table. But when i try to get the data from database using
hibernate, just the first data comes. i mean , if there are 3 rows in
the table , so the FIRST ROW returns 3 times!. please help to fix this
issue.

here's my code ;


SinavTakvim.java
***
//ExamSchedule domain class


package tr.edu.gsu.yds.shared.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import net.sf.gilead.pojo.gwt.LightEntity;

//ExamSchedule Domain

@Entity
@Table(name = "sinavtakvim")
public class SinavTakvim extends LightEntity implements Serializable
{
private static final long serialVersionUID = 1L;

private Integer sinavTakvimId;
private String sinavTarih;
private String sinavSinif;
private String sinavNot;

@Id
@Column(name = "sinavTakvimId", nullable = false, length=10)
public Integer getSinavTakvimId()
{
return sinavTakvimId;
}

public void setSinavTakvimId( Integer sinavTakvimId )
{
this.sinavTakvimId = sinavTakvimId;
}

@Column(name = "sinavTarihi", nullable = false, length=20)
public String getSinavTarihi()
{
return sinavTarih;
}

public void setSinavTarihi( String sinavTarihi )
{
this.sinavTarih = sinavTarihi;
}

@Column(name = "sinavSinif", nullable = false, length=45)
public String getSinavSinif()
{
return sinavSinif;
}

public void setSinavSinif( String sinavSinif )
{
this.sinavSinif = sinavSinif;
}

@Column(name = "sinavNot", length=45)
public String getSinavNot()
{
return sinavNot;
}

public void setSinavNot( String sinavNot )
{
this.sinavNot = sinavNot;
}

}

-




SinavTakvimDao.java

package tr.edu.gsu.yds.server.dao;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.Transaction;

import tr.edu.gsu.yds.server.util.GileadHibernateUtil;
import tr.edu.gsu.yds.shared.domain.SinavTakvim;

//ExamSchedule DAO

public class SinavTakvimDao
{
public List getSinavTakvimList()
{
Session session = null;
Transaction transaction = null;
try
{
session = 
GileadHibernateUtil.getSessionFactory().openSession();
transaction = session.beginTransaction();
List sinavTakvimList = 
session.createQuery("from
SinavTakvim").list();
transaction.commit();
return sinavTakvimList;
}
catch ( RuntimeException e )
{
transaction.rollback();
throw e;
}
finally
{
if ( session != null )
{
session.close();
}
}
}


}

-




Here's i get the data from database and put the data into a celltable
*


package tr.edu.gsu.yds.client.controller.ogrenci;

import java.util.List;

import tr.edu.gsu.yds.client.remote.YdsRemoteService;
import tr.edu.gsu.yds.client.remote.YdsRemoteServiceAsync;
import
tr.edu.gsu.yds.client.view.ogrenci.sinavislemleri.SinavTarihiGoruntuleme;
import tr.edu.gsu.yds.shared.domain.SinavTakvim;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class OgrenciSinavTarihiGoruntulemeController
{
private YdsRemoteServiceAsync ydsRemoteServiceAsync =
GWT.create( YdsRemoteService.class );
private SinavTarihiGoruntuleme ogrenciSinavTarihiGoruntulemeSayfasi;




public
OgrenciSinavTarihiGoruntulemeController( SinavTarihiGoruntuleme
ogrenciSinavTarihiGoruntulemeSayfasi )
{
this.ogrenciSinavTarihiGoruntulemeSayfasi =
ogrenciSinavTarihiGoruntulemeSayfasi;

}

public void send()
{


ydsRemoteServiceAsync.getSinavTakvimList( new
AsyncCallback>()
{
public void onFailure( Throwable caught 
)
{

Hibernate , how to get data from join tables.

2012-03-18 Thread nofear
Hello guys,

My main problem is that i cant write and i couldnt find the correct
query form to fetch data from join tables , for example in my
project , here's my database form ;

Student Table Result Table
-studentId   -resultId
-studentName -resultPoint
-studentSurname -studentId   (FK with Student Table)
-..   -..
-..   -..
-..

what i want to ask is that i cant fetch the resultPoint with using
studentId and please help me to fix this problem, here's my code ;



Student.java

package tr.edu.gsu.yds.shared.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import net.sf.gilead.pojo.gwt.LightEntity;


//RESULT DOMAIN

@Entity
@Table(name = "sonuc")
public class Sonuc extends LightEntity implements Serializable
{
private static final long serialVersionUID = 6L;

private String sonucId;
private Integer sonucPuan;
private String sonucSeviye;
private Ogrenci ogrenci;


@Id
@Column(name = "sonucId", nullable = false, length=10)
public String getSonucId() {
return sonucId;
}

public void setSonucId(String sonucId) {
this.sonucId = sonucId;
}

@Column(name = "sonucPuan", nullable = false, length=3)
public Integer getSonucPuan() {
return sonucPuan;
}

public void setSonucPuan(Integer sonucPuan) {
this.sonucPuan = sonucPuan;
}

@Column(name = "sonucSeviye", length=25)
public String getSonucSeviye() {
return sonucSeviye;
}

public void setSonucSeviye(String sonucSeviye) {
this.sonucSeviye = sonucSeviye;
}

@OneToOne(fetch = FetchType.LAZY)
@PrimaryKeyJoinColumn
public Ogrenci getOgrenci()
{
return ogrenci;
}

public void setOgrenci( Ogrenci ogrenci )
{
this.ogrenci = ogrenci;
}


}






SonucDao.java

package tr.edu.gsu.yds.server.dao;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;

import tr.edu.gsu.yds.server.util.GileadHibernateUtil;
import tr.edu.gsu.yds.shared.domain.Sonuc;

//Result - (point result of a student)
public class SonucDao
{
//gets the result with studentNo
public Sonuc getSonuc( String ogrenciNo ) throws
IllegalArgumentException
{
Session session = null;
Transaction transaction = null;
try
{
session = 
GileadHibernateUtil.getSessionFactory().openSession();
transaction = session.beginTransaction();

StringBuffer mysqlQuery = new StringBuffer();

//here, i dont' know if this query is correct, that's my main
question.
mysqlQuery.append("from Sonuc sonuc where
sonuc.ogrenci=:ogrenciNo");

Query query = 
session.createQuery(mysqlQuery.toString());
query.setString("ogrenciNo", ogrenciNo);


Sonuc sonuc = (Sonuc) query.uniqueResult();
transaction.commit();

return sonuc;
}
catch ( RuntimeException e )
{
transaction.rollback();
throw e;
}
finally
{
if ( session != null )
{
session.close();
}
}
}

}

-




And here , i'm trying to fetch the data from database and put the into
a CELLTABLE , but the return value is NULL.
*
package tr.edu.gsu.yds.client.controller.ogrenci;

import java.util.ArrayList;
import java.util.List;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;

import tr.edu.gsu.yds.client.remote.YdsRemoteService;
import tr.edu.gsu.yds.client.remote.YdsRemoteServiceAsync;
import
tr.edu.gsu.yds.client.view.ogrenci.sinavislemleri.SinavSonucuGoruntuleme;
import tr.edu.gsu.yds.shared.domain.Sonuc;

public class OgrenciSinavSonucuGoruntulemeController
{
private YdsRemo

Using Showcase Sample widgets in my project

2012-02-11 Thread nofear
Hi everybody ,

I'm just a beginner of GWT , so here's my question;
i'm currently developping a project with GWT and i saw the sample
site  http://gwt.google.com/samples/Showcase/Showcase.html  and i
really liked the widgets so i would like to use this widgets in my
projects as they are in showcase project..I have an idea to use them
like ( but i'm not sure if it's the right way to do that.);
-i imported the showcase project in Eclipse and i made it work.
-withright click on the project -> export -> jar  (Showcase.jar
for example), i made the project like JAR file to use the widgets in
my project.
- i put the JAR file to   var/lib  folder of my project  and added to
my projects's classpath.

when i try to add widgets with  RootPanel.get().add()  and run , there
were a lot of errors.
in short, what i want to ask is there a way to use Showcase  sample
widgets in my project and is my way wrong to do that ?

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



changing pages in GWT

2012-02-04 Thread nofear
Hello ,
i'm currently developing an exam project but i'm kind of started to
GWT. So here's my question :

I have a log in page which asks username and password to log in for
students or teachers. After confirmation the informations of students
or teachers, i would like to redirect user to his proper page (i mean
change the log-in page to his proper page) , basicly i didn't
understand how can i do that after clicking the "CONFIRM" button.


Thanks for all help.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.