GWT customized history handler

2011-09-09 Thread Sanjay Jain India
Hello all
I am using gwt2.3 with gwtp frame work.In this application I using the
history management provided by gwtp.
Now my issues how to write some code which invoke on as any of name
token fires.
For this I have written a customize history handler like below:

public class NameTokenHandler implements ValueChangeHandler {
@Override
public void onValueChange(ValueChangeEvent event) {

if (event != null) {
final String nameToken = event.getValue();
if (nameToken != null) {
  if(nameToken.equals("main"))
  {
//do some thing
History.newItem(nameToken);
   }else
{
  History.newItem(nameToken);
   }

}
}
}
}

And in entry point class I added this to History like this:

History.addValueChangeHandler(new NameTokenHandler());

Now If i fire some history token name userpage like this:

History.newItem("userpage");

What I am thinking is that it should come it onValueChange method and
from here it will fire again same history token.and the code after
firing history token should execute, only after history token fired in
onValueChange.

As I debugged I came to know that it is coming to
onValueChangeEvent().

But the issues is that If I do not fire history token from
onValueChangeEvent() then also It will execute all the code related to
fired history token.like below

public class NameTokenHandler implements ValueChangeHandler {
@Override
public void onValueChange(ValueChangeEvent event) {

if (event != null) {
final String nameToken = event.getValue();
if (nameToken != null) {
//do nothing

}
}
}
}


Instead of what I want that the code related to history token must be
fired only after it is fired from onValueChnageEvent.So when I
commented the whole code in OnValueChangeEvent it should not do any
thing. But this not in the case.

So may be my assumptions are wrong.
I want such type of code because I want to execute some code (which
will make a call to server side) as history token fires.And after I
get some data from server side I want to fire same  history token
again.

But as I am making a server side call it is taking bit of time, and
other side code related of history token executed,,,even I have not
fired it as my server side code is not came back.

Please suggest me this issue.

-- 
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.



gwt client session time out

2011-09-08 Thread Sanjay Jain India
I am using gwt 2.3 with gwtp framework.In this application I wan to
maintain a session time of 5 mins.This means if current user is not
doing up to 5 min and he comes after five min then on his first event/
action on screen a he should be be logged out. In gwt there is class
named Timer which can be used in this issues.But I am not getting how
to recognize action of user on the screen.I did google on it, & found
the code for gwt-ext.Below is the code of gwt-ext

Ext.get(“pagePanel”).addListener(“click”, new EventCallback() {
@Override public void execute(EventObject e) {
 MessageBox.alert(“On Mouse Click”); }
 }
);

Ext.get(“pagePanel”).addListener(“keydown”, new EventCallback() {

@Override public void execute(EventObject e) {
MessageBox.alert(“On Key Press Click”); }
});

In above code tag in working properly so I am attaching link from
where I got this code.here

Same type of code I am looking in gwt.If there any other better way to
do this then please let me know.

-- 
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.



Server Side Call from a non presenter class

2011-09-08 Thread Sanjay Jain India
Hello all,
I want to make server side to from a class which is not a
presenter.As
it is not a presenter it doesn't have dispatchasync instance.In this
case I am not getting how to make a server side call.
Here is my class which implements ValueChangeEvent.
public class NameTokenHandler implements ValueChangeHandler {
@Inject
DispatchAsync dispatchAsync;
@Override
public void onValueChange(ValueChangeEvent event) {
if (event != null) {
String nameToken = event.getValue();
if(dispatchAsync!=null)
{
System.out.println("yes");
}else {
System.out.println("No");
}
History.newItem(nameToken);
}
}
}

I have putted a dispatchasync instance in this class, But I am not
getting from where I initialize it.Basically I want to make a server
call, if there is any other way then please let me know.
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: How to expand tree in GWT ?

2011-09-07 Thread Sanjay Jain India
 found the solution.First Need to add child then need to set state
true.


private Tree createTree() {
// Create a Tree
TreeItem root = new TreeItem("root");
root.addItem("item0");
root.addItem("item1");
root.addItem("item2");

TreeItem childwithsubchilder = new TreeItem("subitmes");
childwithsubchilder.addItem("item0");
childwithsubchilder.addItem("item1");
childwithsubchilder.addItem("item2");

root.addItem(childwithsubchilder);

// expand the element
root.setState(true);

    Tree t = new Tree();
t.addItem(root);
return t;
}

On Sep 7, 12:56 pm, Sanjay Jain India  wrote:
> I a using GWT 2.3.In which I am using import
> com.google.gwt.user.client.ui.Tree. I want to show tree expanded
> always.For that I did below code for every tree item
>
>     treeItem.setState(true);
>
> But it is not working.I am not getting how to expand tree. Please help
> me out.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.



How to expand tree in GWT ?

2011-09-07 Thread Sanjay Jain India
I a using GWT 2.3.In which I am using import
com.google.gwt.user.client.ui.Tree. I want to show tree expanded
always.For that I did below code for every tree item

treeItem.setState(true);

But it is not working.I am not getting how to expand tree. Please help
me out.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.



how to gwt value of radio button from ui binder

2011-09-01 Thread Sanjay Jain India
Lets say I have three radio buttons belonging to a group.   Upon some
event,
I would like to retrieve the value of the radio button selected in my
UiBInder class.

One possible approach, I guess, is to declare a ui:field for each of
the
radio buttons(like in the example below) and thus retrieve the
selected
value in the UiBInder class.

value1
value2
value3

Is there any other way to achieve this without having to declare a
ui:filed
for each and every radio button of a group.

-- 
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: How to hide column in Cell table GWT?

2011-08-18 Thread Sanjay Jain India
Thanks sowdri for reply

On Aug 19, 9:59 am, -sowdri-  wrote:
> Hi,
>
> Use SingleSelectionModel or MultipleSelectionModel depending uponyour
> requirement. And 
> referhttp://code.google.com/webtoolkit/doc/latest/DevGuideUiCellWidgets.ht...
>
> for more info on adding handlers for 
> SelectionChangeEvent
> !
>
> Thanks,

-- 
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.



How to hide column in Cell table GWT?

2011-08-18 Thread Sanjay Jain India
I am using Cell Table in GWT.In that cell table I am adding these
columns.

   TextColumn idColumn = new TextColumn() {
@Override
public String getValue(Document object) {
return Long.toString(object.getId());
}
};
TextColumn refColumn = new TextColumn() {
@Override
public String getValue(Document object) {
return object.getReferenceNumber();
}
};
/*
 * DateCell dateCell = new DateCell(); Column
dateColumn
 * = new Column(dateCell) {
 *
 * @Override public Date getValue(Contact object) { return
 * object.birthday; } };
 */
TextColumn nameColumn = new TextColumn() {
@Override
public String getValue(Document object) {
return object.getDocumentName();
}
};
table = new CellTable();
table.addColumn(idColumn, "Id");
table.addColumn(refColumn, "Reference Number");
table.addColumn(nameColumn, "Name");
}

Now I have some queries: How to hide the id column?
On click of row how can i get the from selected row?
Please help me out. 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.



Template embedding in the GWT

2011-08-02 Thread Sanjay Jain India
Hello All
I have template with its css and html.Now I want to get all the look
and features (compatibility) of that template in my gwt application.
I am not getting the right way to do that.
One way which I thought is that for control there will be a .html
file , which will be added to the gwt root panel using frame.I also
don't know it is right way or not.

Please help me out to embed all the look and feature of the template
to the gwt application.

-- 
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.



How to set lable of Textbox

2011-06-14 Thread Sanjay Jain India
Hello all
I am using GWT2.3.In this I want to create a form.For This I used a
form panel and texbox.Textbox is for the User Name purpose.So I want
to set the label of text box.But there no way to set label.
I want label at the left side of the text box.

Please help me how to set label, So It come left to text box.
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.