A library that allows using GWT with Gson

2013-05-10 Thread Sang Hero
Hello everyone,

I have written a library that allows using GWT with Gson here:
https://github.com/heroandtn3/bGwtGson

Enjoy it and send me pull requests or open issues if you have any
suggestion for me.

-sangnd

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




MVP For Popups

2013-05-10 Thread Tim Hill
Hi,

I would appreciate some advice, if anyone has any time to spare... I am 
slowly, but surely, getting to grips with GWT (I think) and I have hit my 
next stumbling block. The scenario is as follows:
> The app loads to the calendar view
> User clicks on a date and the 'add new event' dialog/popup is shown
> User enters event info, along with address of the event. If the address 
does not already exist within the app, the user can click a button to 
extend the popup to enter a new address
> User clicks save.
> Events fired to save new data.

My quandary is thus... I am attempting to implement my app using MVP 
(activities/presenters/places/views etc), but I am not sure how best to 
implement popups like I described above as there is more logic in there 
than a simple 'busy' popup, for example. My aim is to have as much of the 
app logic as possible separate from the UI implementation so I can easily 
port the app to a mobile interface. 

Thanks in advance!

Tim

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




Re: GWT + PHP

2013-05-10 Thread Tim Hill
I have been using RestyGWT in my project with success - pretty good too, 
once I got my head around it!!

On Thursday, 9 May 2013 15:11:42 UTC+1, Larissa Costa wrote:
>
> Good morning!
>
> I have a php script like this:
>
> * * for ($ i = 1, $ i <= 10, $ i + +) {*
> * echo "Line". $ i. "";*
> * }*
> *?>*
>
>
> And a variable in my GWT code:
>
> *String = **responsePHP = "";*
>
>
> Is there a simple way (or not) to get the response from PHP script and put 
> in variable GWT?
>

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




Re: When safe at startup to get element positions/dimensions?

2013-05-10 Thread brec


Works ... thanks!

As to HeaderPanel... my HTML layout is working OK. I might have saved effort 
by starting with a more widget-oriented layout, but those costs are now sunk.


On Friday, May 10, 2013 10:55:31 AM UTC-7, Jens wrote:
>
> Use 
>
> Scheduler.get().scheduleDeferred(new ScheduledCommand() {
>   void execute() {
> int topOfSpace = topSection.getAbsoluteBottom();
> int botOfSpace = botSection.getAbsoluteTop();
> int middleHeight = middleSection.getClientHeight();
> int topOfMiddle = topOfSpace + (botOfSpace - topOfSpace - 
> middleHeight)/2;
> DOM.setStyleAttribute(DOM.getElementById("midSection"), "top", 
> topOfBoard + "px");
>   }
> });
>
> The code inside the command is delayed slightly, so it will be executed 
> AFTER all your other JS code is done (so its kind of async) and the browser 
> had some time to do its layout computations.
>
> GWT's HeaderPanel widget (header + center + footer) does the same to 
> recalculate the height of the center area. Maybe you can actually use it?
>
> -- J.
>

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




CellBrowser in MVP

2013-05-10 Thread Kris
Hi, I using the gwt-sample-tab as a template. 

I want to add another tab with a cell browser. My presenter should get data 
from the database in the onBind method. ( or maybe onReset ) 

My problem is how to do this... if I instantiate the cellbrowser in the 
onBind method.. 

Builder builder = new Builder(model, 
null);
cellBrowser = builder.build();

I get a 
com.google.gwt.user.cellview.client.CellBrowser has no default (zero args) 
constructor. To fix this, you can define a @UiFactory method on the 
UiBinder's owner, or annotate a constructor of CellBrowser with 
@UiConstructor.

Sure, I need to create the cellbroser in the view... 
@Inject
public PrintProvidersView(PrintProvidersUiBinder uiBinder) {
final PrintProviderModel model = new PrintProviderModel();
Builder builder = new Builder(model, 
null);
cellBrowser = builder.build();
initWidget(uiBinder.createAndBindUi(this));
}

But how do I now update the model in the cellbrowser in the presenter ??? 


*ui.xml*
http://dl.google.com/gwt/DTD/xhtml.ent";>








 

*View*
public class PrintProvidersView extends ViewImpl implements 
PrintProvidersPresenter.MyView {
interface PrintProvidersUiBinder extends UiBinder {
}

@UiField
CellBrowser cellBrowser;

@Inject
public PrintProvidersView(PrintProvidersUiBinder uiBinder) {
final PrintProviderModel model = new PrintProviderModel();
Builder builder = new Builder(model, 
null);
cellBrowser = builder.build();
initWidget(uiBinder.createAndBindUi(this));
}
public CellBrowser getCellBrowser() {
return cellBrowser;
}
}

*Presenter*
public class PrintProvidersPresenter extends 
Presenter {

private final PrintProviderMockServiceAsync ppmockService = 
GWT.create(PrintProviderMockService.class);

public interface MyView extends View {
public CellBrowser getCellBrowser();
}


@ProxyCodeSplit
@NameToken("PrintProviders")
@TabInfo(container = ApplicationPresenter.class, label = "Print Providers", 
priority = 3)
public interface MyProxy extends 
TabContentProxyPlace {
}

@Inject
public PrintProvidersPresenter(EventBus eventBus, MyView view, MyProxy 
proxy) {
super(eventBus, view, proxy);
}


@Override
protected void revealInParent() {
RevealContentEvent.fire(this, ApplicationPresenter.TYPE_SetTabContent, 
this);
}

@Override
protected void onBind() {
super.onBind();
get data from database and update cellbrowser or if 
possible instantiate cellbrowser here without getting the error about  no 
default (zero args) constructor
}


@Override
protected void onReset() {
super.onReset();
}

}






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




Re: When safe at startup to get element positions/dimensions?

2013-05-10 Thread Jens
Use 

Scheduler.get().scheduleDeferred(new ScheduledCommand() {
  void execute() {
int topOfSpace = topSection.getAbsoluteBottom();
int botOfSpace = botSection.getAbsoluteTop();
int middleHeight = middleSection.getClientHeight();
int topOfMiddle = topOfSpace + (botOfSpace - topOfSpace - 
middleHeight)/2;
DOM.setStyleAttribute(DOM.getElementById("midSection"), "top", 
topOfBoard + "px");
  }
});

The code inside the command is delayed slightly, so it will be executed 
AFTER all your other JS code is done (so its kind of async) and the browser 
had some time to do its layout computations.

GWT's HeaderPanel widget (header + center + footer) does the same to 
recalculate the height of the center area. Maybe you can actually use it?

-- J.

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




HELP: GWT CalenderPanel does not show March 31st for year 2013

2013-05-10 Thread Bheemanagouda Patil
GWT CalenderPanel does not show March 31st for year 2013, when TimeZone of 
the System where web application is accessed is GMT + 01:00. 

Please refer to screen shot.. 

GWT CODE: 

 private void showDateCalendar() {
Date dt = new Date();
FlexTable fTable = new FlexTable();
fTable.setBorderWidth(1);
final CalendarPanel cal = new CalendarPanel(dt);
Label nextMonth = new Label(">");
nextMonth.setStyleName("gwt-Label-link");
Label nextYear = new Label(">>");
nextYear.setStyleName("gwt-Label-link");
cal.setMonthNames(monthNamesArr);
cal.setWeekDayNames(dayNamesArr);
cal.redraw();
final Label lblMonth = new Label(cal.getCurrentMonthName() + " "
+ cal.getCurrentYear());
Label prevMonth = new Label("<");
prevMonth.setStyleName("gwt-Label-link");
Label prevYear = new Label("<<");
prevYear.setStyleName("gwt-Label-link");
Grid header = new Grid(1, 5);
header.setWidth("100%");
header.setWidget(0, 0, prevYear);
header.setWidget(0, 1, prevMonth);
header.setWidget(0, 2, lblMonth);
header.setWidget(0, 3, nextMonth);
header.setWidget(0, 4, nextYear);
header.getCellFormatter().setWidth(0, 0, "15%");
header.getCellFormatter().setWidth(0, 1, "5%");
header.getCellFormatter().setWidth(0, 2, "55%");
header.getCellFormatter().setWidth(0, 3, "5%");
header.getCellFormatter().setWidth(0, 4, "15%");
header.setStyleName("calendar-header");

fTable.setWidget(0, 0, header);
fTable.getFlexCellFormatter().setHorizontalAlignment(0, 0,
HasHorizontalAlignment.ALIGN_CENTER);
fTable.setWidget(1, 0, cal);
cal.setWidth("100%");
cal.addNextMonthActivator(nextMonth);
cal.addPrevMonthActivator(prevMonth);
cal.addNextYearActivator(nextYear);
cal.addPrevYearActivator(prevYear);
cal.addCalendarListener(new CalendarListener() {
public void onDateClick(CalendarDate date) {

txtForecastDate.setText(Constants.getDateText(date.getDate()));
forecastEndTime = date.getDate().getTime();
 if (dynamicUpdate) {
doCommit();
 }
calPopup.hide();
}

public boolean onEventDateClick(CalendarDate date) {
return false;
}

public void onMonthChange(CalendarMonth month) {
lblMonth.setText(cal.getCurrentMonthName() + " "
+ cal.getCurrentYear());
}
});
/* code for calendar panel from GWT-Widgets ends here */
calPopup = new PopupPanel(true);
int left = imgCalendar.getAbsoluteLeft() + 16;
int top = imgCalendar.getAbsoluteTop() - 60;
calPopup.setPopupPosition(left, top);
calPopup.setWidget(fTable);
calPopup.show();
}

please help me to find root cause of the issue, and remedy for this issue.

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


<>

Re: GWT Resize of 's

2013-05-10 Thread Nihar
Hi,

Did you find any solution for this issue? Please help me out.

Appreciate your help. Thanks,

On Friday, February 12, 2010 8:29:01 AM UTC-5, Vladi S wrote:
>
> HI, I'm currently facing the following problem and hope someone can
> help me out :
>
> e.g.   ..
>   
>
> ...
>
> i insert the GWT app i create not into the body but into a  id="widget">.
> The problem is that as the "widget" gets bigger (e.g. inserting more
> labels into a vertcalpanel) the wrapping div-"content" does not.
> Although both have the css property "height:100%";
> div-"footer" contains a footer image and this is than gets overlapped
> by the widget.
>
> TIA , Vladi
>
>

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




Re: When safe at startup to get element positions/dimensions?

2013-05-10 Thread brec


On Friday, May 10, 2013 9:23:26 AM UTC-7, I wrote:
>
> protected void positionMiddle() {
>
>> int topOfSpace = topSection.getAbsoluteBottom();
>> int botOfSpace = botSection.getAbsoluteTop();
>> int middleHeight = middleSection.getClientHeight();
>> int topOfMiddle = topOfSpace + (botOfSpace - topOfSpace - 
>> middleHeight)/2;
>> DOM.setStyleAttribute(DOM.getElementById("midSection"), "top", 
>> topOfBoard + "px");
>> }
>>
> In the last line, "topOfBoard" should be "topOfMiddle".
>

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




When safe at startup to get element positions/dimensions?

2013-05-10 Thread brec
I have a canonical ("extends Composite") GWT 2.5.1/UiBinder app. There are 
three horizontal sections on the browser page, comprised of div elements; 
let's call them top, middle, and bottom. The layout is fluid/dynamic with 
respect to the browser's window size. I have Java code that vertically 
centers the middle section in the space between the top and bottom 
sections; I do this at startup, and also on a browser resize event, by 
calling this method:

protected void positionMiddle() {
> int topOfSpace = topSection.getAbsoluteBottom();
> int botOfSpace = botSection.getAbsoluteTop();
> int middleHeight = middleSection.getClientHeight();
> int topOfMiddle = topOfSpace + (botOfSpace - topOfSpace - 
> middleHeight)/2;
> DOM.setStyleAttribute(DOM.getElementById("midSection"), "top", 
> topOfBoard + "px");
> }
>

If startup call is done in my app/widget's constructor, or if it is done in 
an onLoad() method, it doesn't work correctly because getAbsoluteBottom, 
getAbsoluteTop, and getClientHeight all return 0. What I have done is wait 
until the first user interaction, which must be a button click to dismiss a 
splash screen, to call the above method; that works fine. I reason that the 
method call must be delayed until the browser has finished its rendering, 
i.e., finished its layout computations. I am wondering whether there is 
some way, such as an event I could detect via a handler, to know when that 
is. While having the first call to positionMiddle() in a button click 
handler works OK, it seems inelegant. Also, I'd like to better understand 
the relation between GWT and browser rendering at startup.

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




Re: Serialization help

2013-05-10 Thread Robert J. Carr
Thanks Jens.  I was thinking the answer is "not possible" but I was just
hoping to get confirmation in case I was missing something silly.  Thanks
for the link ... I'll check it out!


On Fri, May 10, 2013 at 2:06 AM, Jens  wrote:

> At some point during the serialization process GWT is calling getClass()
> on your method return value which always resolves to the runtime class.
> Thats just how getClass() in Java works. I don't think you can change that
> behavior of GWT-RPC.
> If I give you an instance of type Object how would you know that you only
> have to serialize a specific super class of the runtime type of that
> instance? Thats probably only possible by searching for specific
> annotations that contain that information. GWT-RPC does not have such
> annotations.
>
> A somewhat similar question is:
> https://groups.google.com/d/msg/google-web-toolkit/OxuDRkJGFDE/jQd_V0aYzaYJ
>
> You can probably do the same here. Make Subtype a shared class with a
> super-source version for GWT. The super-source version would be empty and
> just extend Type. The CustomFieldSerializer for Subtype would now only
> read/write the Type variables during de-/serialization.
>
> -- J.
>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Web Toolkit" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-web-toolkit/OGsdfcalDpw/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, send an email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: instance or class?

2013-05-10 Thread Blake McBride
The way I define the connecting code is as is given in the examples.  I
have no thread safety code there.  Nevertheless, I am having multi-user
interference issues.  Actually, I am using Sencha grid control in the place
where I am having the trouble.  I thought this was a generic GWT issue.
 Perhaps I am wrong.  I'll bring this up with them.

Thanks.

Blake



On Fri, May 10, 2013 at 9:37 AM, Jens  wrote:

>
>> Something I am unclear about is the code that connects the frontend to
>> the backend.  It seems like GWT duplicates some of the intermediary code
>> that connects the two ends.  One in Java that runs on the backend, and
>> another copy that runs on the frontend in JavaScript.  For example, the
>> code that defines the data structure that is transmitted between the ends
>> must be available on both ends.  This may be where my problem is. I do have
>> instance variables there.  Off the cuff, I'm not sure how to protect that.
>>
>
> Using instance variables in objects transferred with GWT-RPC is totally
> thread safe. I would bet its your code that is wrong and not GWT-RPC code,
> otherwise GWT-RPC would be pretty unusable ;-)
>
> You dont have to fear instance variables. Immutable instance variables are
> thread safe by definition and access to mutable instance variables needs to
> be synchronized/atomic to be thread safe.
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: instance or class?

2013-05-10 Thread Jens

>
>
> Something I am unclear about is the code that connects the frontend to the 
> backend.  It seems like GWT duplicates some of the intermediary code that 
> connects the two ends.  One in Java that runs on the backend, and another 
> copy that runs on the frontend in JavaScript.  For example, the code that 
> defines the data structure that is transmitted between the ends must be 
> available on both ends.  This may be where my problem is. I do have 
> instance variables there.  Off the cuff, I'm not sure how to protect that.
>

Using instance variables in objects transferred with GWT-RPC is totally 
thread safe. I would bet its your code that is wrong and not GWT-RPC code, 
otherwise GWT-RPC would be pretty unusable ;-)

You dont have to fear instance variables. Immutable instance variables are 
thread safe by definition and access to mutable instance variables needs to 
be synchronized/atomic to be thread safe.

-- J.

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




Re: instance or class?

2013-05-10 Thread Blake McBride
Interesting.  I am familiar with thread issues, and the backend code does
not have any static variables either.  However, this exchange may have
uncovered the problem.

Something I am unclear about is the code that connects the frontend to the
backend.  It seems like GWT duplicates some of the intermediary code that
connects the two ends.  One in Java that runs on the backend, and another
copy that runs on the frontend in JavaScript.  For example, the code that
defines the data structure that is transmitted between the ends must be
available on both ends.  This may be where my problem is. I do have
instance variables there.  Off the cuff, I'm not sure how to protect that.

Thanks for the help!

Blake



On Fri, May 10, 2013 at 7:45 AM, Jens  wrote:

> If I run it from a single browser (as I do during development) it runs
>> fine.  It becomes flaky when I try to use it from different browsers and/or
>> different machines at the same time.  I know about tomcat reusing the same
>> backend instances so I am sensitive about that.  (I don't know if GlassFish
>> does that too.)  The backend code for the flaky part has no instance
>> variables so reuse should not be a problem.
>>
>> Due to the responses on this mailing list and my tests, I now think the
>> problem is on the backend.  One instance runs fine.  If I introduce a
>> second instance, the second instance runs fine but then the first instance
>> messes up randomly.  I'll keep looking.
>>
>
> Sounds like a typical thread safety issue. As you said you dont have
> instance variables, do you have non final static class variables? If so,
> your code probably does not do what you think it should do. Lets assume you
> have static int intVariable = 0; somewhere and Thread A sets value to 5 and
> later on expects to read a value of 5. Between write and read a second
> Thread B could modify the value. This can even happen between two lines of
> code.
>
> Depending on the concrete code you want to use synchronized blocks,
> ThreadLocal variables, classes from
> http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/atomic/package-summary.html
>
> In case of ThreadLocal variables, make sure to clean them up once the
> request is done. Otherwise you probably run into a ThreadLocal memory leaks
> and PermGen space issues on redeployment.
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




right-to-left

2013-05-10 Thread Dawn Borg Costanzi
Hi everyone,

I've created a number of widgets to make an online questionnaire. Can 
anyone tell me whether there is an easy way to have a mirror-image of the 
widget, for right-to-left language support?

Thanks,
Dawn

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




Re: instance or class?

2013-05-10 Thread Jens

>
> If I run it from a single browser (as I do during development) it runs 
> fine.  It becomes flaky when I try to use it from different browsers and/or 
> different machines at the same time.  I know about tomcat reusing the same 
> backend instances so I am sensitive about that.  (I don't know if GlassFish 
> does that too.)  The backend code for the flaky part has no instance 
> variables so reuse should not be a problem.  
>
> Due to the responses on this mailing list and my tests, I now think the 
> problem is on the backend.  One instance runs fine.  If I introduce a 
> second instance, the second instance runs fine but then the first instance 
> messes up randomly.  I'll keep looking.  
>

Sounds like a typical thread safety issue. As you said you dont have 
instance variables, do you have non final static class variables? If so, 
your code probably does not do what you think it should do. Lets assume you 
have static int intVariable = 0; somewhere and Thread A sets value to 5 and 
later on expects to read a value of 5. Between write and read a second 
Thread B could modify the value. This can even happen between two lines of 
code.

Depending on the concrete code you want to use synchronized blocks, 
ThreadLocal variables, classes from 
http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/atomic/package-summary.html

In case of ThreadLocal variables, make sure to clean them up once the 
request is done. Otherwise you probably run into a ThreadLocal memory leaks 
and PermGen space issues on redeployment.

-- J.

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




Re: GWT Scrollpanel (Scrolling)is not woking in Chrome but works in Firefox and IE

2013-05-10 Thread Sashi Kumar

Hi Jen,

Thanks for Ur Reply. :)

I should not change the GWT Version.  It may affect other Functionalities 
of the Project.

I am using GWT Version 2.2.0. 

That 'Text ' which i am not able to Scroll is a HTML File.

I think i need to look on the CSS style or setfocus() on that HTML file.

Still i am looking on that issue .

Thanks 


On Thursday, 9 May 2013 19:17:34 UTC+5:30, Jens wrote:
>
> Sounds similar to 
> https://code.google.com/p/google-web-toolkit/issues/detail?id=6704 where 
> you could not scroll inside a Dialog on iOS devices because PopupPanel had 
> canceled events when targeting a text node instead of an element node.
>
> Do you use GWT 2.5 / 2.5.1? If not, try to upgrade.
>
> -- J.
>

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




Re: instance or class?

2013-05-10 Thread Blake McBride
Greetings,

Thanks for the input.  Yes, the flakiness is what I am concerned about.
 The whole project is a no-go until I can figure out the flakiness.  First,
the backend is running on Linux & GlassFish.  The frontend is running on
various browsers from various laptops.  There is no iOS.  I did discover
the following however.

If I run it from a single browser (as I do during development) it runs
fine.  It becomes flaky when I try to use it from different browsers and/or
different machines at the same time.  I know about tomcat reusing the same
backend instances so I am sensitive about that.  (I don't know if GlassFish
does that too.)  The backend code for the flaky part has no instance
variables so reuse should not be a problem.

Due to the responses on this mailing list and my tests, I now think the
problem is on the backend.  One instance runs fine.  If I introduce a
second instance, the second instance runs fine but then the first instance
messes up randomly.  I'll keep looking.

Your input is very helpful.  Thank you.

Blake



On Fri, May 10, 2013 at 3:46 AM, Jens  wrote:

> It shouldn't make a difference if you make everything static or not as
> long as your are sure that your app state is the one you want. You would
> need to reset your state instead of just throw away an old instance and
> create a new one.
>
> The flakiness you describe sound like iOS issues. Have you tested your app
> on iOS 6? If so, iOS 6 caches POST requests if they dont have a no-cache
> header and Safari on iOS 6 has some JIT compiler issues which can result in
> unexpected JavaScript failures.
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




GWT Calender Panel does not show march 31st in GMT + 1:00 timezone

2013-05-10 Thread Bheemanagouda Patil

GWT Calender Panel is not showing March 31st  for year - 2013, when 
TimeZone is GMT + 1:00 on system where web application is accessed. 

Please refer to screen shot attached. 

GWT CODE: 

 private void showDateCalendar() {
Date dt = new Date();
FlexTable fTable = new FlexTable();
fTable.setBorderWidth(1);
final CalendarPanel cal = new CalendarPanel(dt);
Label nextMonth = new Label(">");
nextMonth.setStyleName("gwt-Label-link");
Label nextYear = new Label(">>");
nextYear.setStyleName("gwt-Label-link");
cal.setMonthNames(monthNamesArr);
cal.setWeekDayNames(dayNamesArr);
cal.redraw();
final Label lblMonth = new Label(cal.getCurrentMonthName() + " "
+ cal.getCurrentYear());
Label prevMonth = new Label("<");
prevMonth.setStyleName("gwt-Label-link");
Label prevYear = new Label("<<");
prevYear.setStyleName("gwt-Label-link");
Grid header = new Grid(1, 5);
header.setWidth("100%");
header.setWidget(0, 0, prevYear);
header.setWidget(0, 1, prevMonth);
header.setWidget(0, 2, lblMonth);
header.setWidget(0, 3, nextMonth);
header.setWidget(0, 4, nextYear);
header.getCellFormatter().setWidth(0, 0, "15%");
header.getCellFormatter().setWidth(0, 1, "5%");
header.getCellFormatter().setWidth(0, 2, "55%");
header.getCellFormatter().setWidth(0, 3, "5%");
header.getCellFormatter().setWidth(0, 4, "15%");
header.setStyleName("calendar-header");

fTable.setWidget(0, 0, header);
fTable.getFlexCellFormatter().setHorizontalAlignment(0, 0,
HasHorizontalAlignment.ALIGN_CENTER);
fTable.setWidget(1, 0, cal);
cal.setWidth("100%");
cal.addNextMonthActivator(nextMonth);
cal.addPrevMonthActivator(prevMonth);
cal.addNextYearActivator(nextYear);
cal.addPrevYearActivator(prevYear);
cal.addCalendarListener(new CalendarListener() {
public void onDateClick(CalendarDate date) {

txtForecastDate.setText(Constants.getDateText(date.getDate()));
forecastEndTime = date.getDate().getTime();
 if (dynamicUpdate) {
doCommit();
 }
calPopup.hide();
}

public boolean onEventDateClick(CalendarDate date) {
return false;
}

public void onMonthChange(CalendarMonth month) {
lblMonth.setText(cal.getCurrentMonthName() + " "
+ cal.getCurrentYear());
}
});
/* code for calendar panel from GWT-Widgets ends here */
calPopup = new PopupPanel(true);
int left = imgCalendar.getAbsoluteLeft() + 16;
int top = imgCalendar.getAbsoluteTop() - 60;
calPopup.setPopupPosition(left, top);
calPopup.setWidget(fTable);
calPopup.show();
}

Can someone please help me to understand why this issue and what is the 
remedy?

Thanks in advance..

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


<>

UiBinder in GWT for extended widgets - Grid and pager

2013-05-10 Thread LPD


I am trying to build a grid which has pagination controls. I understand 
that DataGrid of GWT provides the Grid and SimplePager provides pagination.

I have taken the approach shown in the example
http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwCellTable

But this is just a composition where my wrapped component is neither a Grid 
not a Pager, but a composition of both.

If I want to extends the DataGrid of GWT to provide pagination how can I 
achieve that usingUiBinder?

Please ask me any number of questions if something is not clear. Thanks.

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




Re: Serialization help

2013-05-10 Thread Jens
At some point during the serialization process GWT is calling getClass() on 
your method return value which always resolves to the runtime class. Thats 
just how getClass() in Java works. I don't think you can change that 
behavior of GWT-RPC.
If I give you an instance of type Object how would you know that you only 
have to serialize a specific super class of the runtime type of that 
instance? Thats probably only possible by searching for specific 
annotations that contain that information. GWT-RPC does not have such 
annotations.

A somewhat similar question 
is: https://groups.google.com/d/msg/google-web-toolkit/OxuDRkJGFDE/jQd_V0aYzaYJ

You can probably do the same here. Make Subtype a shared class with a 
super-source version for GWT. The super-source version would be empty and 
just extend Type. The CustomFieldSerializer for Subtype would now only 
read/write the Type variables during de-/serialization.

-- J.


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




GWT and MongoDB

2013-05-10 Thread zampedri . federico84
Hi, i'm new programming and using GWT in Eclipse, i followed the 
StockWatcher tutorial just to understand the basics of GWT.

Now i need to understand how to create a new application that read data 
from MongoDB, where i have my database, and show them in a table where i 
can do some basics operations (sorting/filtering columns..). Eventually i 
can just load my .json file that contains all the data of my database.

Does exists some tutorial that explain me?

Thank you for the answers.

Federico

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




Re: instance or class?

2013-05-10 Thread Jens
It shouldn't make a difference if you make everything static or not as long 
as your are sure that your app state is the one you want. You would need to 
reset your state instead of just throw away an old instance and create a 
new one.

The flakiness you describe sound like iOS issues. Have you tested your app 
on iOS 6? If so, iOS 6 caches POST requests if they dont have a no-cache 
header and Safari on iOS 6 has some JIT compiler issues which can result in 
unexpected JavaScript failures.

-- J.

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