Re: Windows not showing/hiding as expected

2009-04-08 Thread Gary1975

Thanks for the advice - I thought it was something like that but
didn't know what to do about it. I'll give it a go today

The Window and MessageBox come from GWT-Ext

On Apr 7, 4:00 pm, Thomas Broyer t.bro...@gmail.com wrote:
 On 7 avr, 16:13, Gary1975 gary.ev...@gmail.com wrote:

  Hi,

  I am relatively new to GWT devlopment and was wondering of someone
  could please help to explain why the progress dialog is not displaying
  in the following function. Also, the timeperiod window is not hiding
  itself until after the line has been drawn. Any ideas would be
  gratefully received as I have been struggling with this all day.

 JavaScript in the browser is single-threaded, and moreover runs in the
 UI thread. This means that changes to the page are only reflected when
 your script yields, i.e. in your case at the end of your onClick
 method.

 The simplest way to make it work as you're expecting is to use a
 DeferredCommand: wrap everything that follows timepedior.hide() and
 MessageBox.show(...) within a DeferredCommand; this would yield so
 the browser can effectively hide the timeperiod and show the
 MessageBox and then (something like 10ms later) do the drawing and
 close the MessageBox.

 (btw: which library are those Window and MessageBox coming from?)
--~--~-~--~~~---~--~~
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: Windows not showing/hiding as expected

2009-04-08 Thread Gary1975

I have now implemented the suggested solution and it works a treat.

Many thanks for the advice.

On Apr 8, 7:31 am, Gary1975 gary.ev...@gmail.com wrote:
 Thanks for the advice - I thought it was something like that but
 didn't know what to do about it. I'll give it a go today

 The Window and MessageBox come from GWT-Ext

 On Apr 7, 4:00 pm, Thomas Broyer t.bro...@gmail.com wrote:

  On 7 avr, 16:13, Gary1975 gary.ev...@gmail.com wrote:

   Hi,

   I am relatively new to GWT devlopment and was wondering of someone
   could please help to explain why the progress dialog is not displaying
   in the following function. Also, the timeperiod window is not hiding
   itself until after the line has been drawn. Any ideas would be
   gratefully received as I have been struggling with this all day.

  JavaScript in the browser is single-threaded, and moreover runs in the
  UI thread. This means that changes to the page are only reflected when
  your script yields, i.e. in your case at the end of your onClick
  method.

  The simplest way to make it work as you're expecting is to use a
  DeferredCommand: wrap everything that follows timepedior.hide() and
  MessageBox.show(...) within a DeferredCommand; this would yield so
  the browser can effectively hide the timeperiod and show the
  MessageBox and then (something like 10ms later) do the drawing and
  close the MessageBox.

  (btw: which library are those Window and MessageBox coming from?)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Windows not showing/hiding as expected

2009-04-07 Thread Gary1975
 = 
item.getChildNodes();

((Button)sender).setEnabled(false);
pBar.enable();
pBar.updateText(Processing Data...);
pBar.reset();

timePeriod.hide();

MessageBox.show(new MessageBoxConfig() {
{
setTitle(Please wait...);
setMsg(Processing Data...);
setWidth(240);
setProgress(true);
setClosable(true);

WaitConfig waitConfig = new 
WaitConfig();
waitConfig.setInterval(2000);

waitConfig.setIncrement(historyItems.getLength());
setWaitConfig(waitConfig);
setModal(true);
}
});

LatLng[] pointList = new 
LatLng[historyItems.getLength()];
for (int i = 0; i  historyItems.getLength(); 
i++) {
Node point = historyItems.item(i);
final String id = ((Element) 
point).getAttribute(ID).toString
();
final double lat = 
Float.valueOf(((Element) point).getAttribute
(LAT)).floatValue();
final double longit = 
Float.valueOf(((Element) point).getAttribute
(LONGIT)).floatValue();
final int hdop = 
Integer.valueOf(((Element) point).getAttribute
(HDOP)).intValue();
final Date nodeUpdateTime = new 
Date(Long.valueOf(((Element)
point).getAttribute(TOF)).longValue() * 1000);
if ((nodeUpdateTime.getTime() = 
historyStartTime) 
(nodeUpdateTime.getTime() = historyEndTime)) {
final LatLng historyPoint = 
LatLng.newInstance(lat, longit);
pointList[i] = historyPoint;
}
float pBarValue = 
Integer.valueOf(i).floatValue() /
Integer.valueOf(historyItems.getLength()).floatValue();
pBar.setValue(pBarValue);
MessageBox.updateProgress(i, Loading 
item   + i +  of  +
historyItems.getLength() + ... );

}

PolylineOptions options = 
PolylineOptions.newInstance(true,
false);
Polyline polyline = new Polyline(pointList, 
#FF, 3, 0.7,
options);

polyline.addPolylineClickHandler(new 
PolylineClickHandler () {
public void onClick(PolylineClickEvent 
event) {
LatLng clickPos = 
event.getLatLng();
InfoWindow infoWindow = 
map.getInfoWindow();
InfoWindowContent content = new 
InfoWindowContent(br/ +
trackName);
infoWindow.open(clickPos, 
content);
}
});

map.addOverlay(polyline);

map.setZoomLevel(map.getBoundsZoomLevel(polyline.getBounds()));
map.panTo(polyline.getBounds().getCenter());

MessageBox.hide();
}

});
timePeriod.show();

}

Regards
Gary1975
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Display not updating

2009-04-02 Thread Gary1975

Hi,

I have a function that is used to process a set of data that is
returned from a server. This routine gets the date range for the data
returned and pops up a window for the used to enter the range that
they are interested in. The code will then go through the data and
draw a polyline on a map for the relevant set of data. This is a long
process and I wanted to display a progress bar on teh dialog to show
that the processing is happening. I am unable to get the progress bar
to update whilst the code is looping through the data.

Can anyone suggest a solution.

protected static void showTrackHistory(final Node item) {

//Ask the User to specify a range of data to view for the 
specified
track
Panel timePanel = new Panel();
timePanel.setBorder(false);
timePanel.setPaddings(15);

VerticalPanel startTimePanel = new VerticalPanel();
startTimePanel.setSpacing(15);

Date startDate = new Date(Long.valueOf(((Element)
firstReport).getAttribute(TOF)).longValue() * 1000);
final TextField startTextField = new TextField(Date);
startTextField.setWidth(180);
startTextField.setHideLabel(true);
startTextField.setValue(startDate.toString());

DatePicker datePicker = new DatePicker();
datePicker.setValue(startDate);
datePicker.setTodayText(Now);
datePicker.addListener(new DatePickerListenerAdapter() {
public void onSelect(DatePicker dataPicker, Date date) {
startTextField.setValue(date.toString());
}
});

FieldSet startFS = new FieldSet();
startFS.setPaddings(5);
startFS.setCheckboxToggle(false);
startFS.setFrame(true);
startFS.setTitle(Start);
startFS.setCollapsed(false);
startFS.add(datePicker);
startFS.add(startTextField);
startTimePanel.add(startFS);

VerticalPanel endTimePanel = new VerticalPanel();
endTimePanel.setSpacing(15);

Date endDate = new Date(Long.valueOf(((Element)
lastReport).getAttribute(TOF)).longValue() * 1000);
final TextField endTextField = new TextField(Date);
endTextField.setWidth(180);
endTextField.setHideLabel(true);
endTextField.setValue(endDate.toString());

DatePicker endDatePicker = new DatePicker();
endDatePicker.setValue(endDate);
endDatePicker.setTodayText(Now);
endDatePicker.addListener(new DatePickerListenerAdapter() {
public void onSelect(DatePicker dataPicker, Date date) {
endTextField.setValue(date.toString());
}
});

FieldSet endFS = new FieldSet();
endFS.setPaddings(5);
endFS.setCheckboxToggle(false);
endFS.setFrame(true);
endFS.setTitle(End);
endFS.setCollapsed(false);
endFS.add(endDatePicker);
endFS.add(endTextField);
endTimePanel.add(endFS);

HorizontalPanel startEndPanel = new HorizontalPanel();
startEndPanel.add(startTimePanel);
startEndPanel.add(endTimePanel);

Button btnOK = new Button(OK);
btnOK.setWidth(200px);

pBar = new ProgressBar();
pBar.setWidth(250);
pBar.setText(Ready);
pBar.enable();
pBar.setAutoShow(true);
//pBar.reset();
//pBar.disable();

HorizontalPanel btnPanel = new HorizontalPanel();
btnPanel.setSpacing(5);
btnPanel.add(btnOK);
btnPanel.add(pBar);

timePanel.add(startEndPanel);
timePanel.add(btnPanel);

timePeriod = new Window();
timePeriod.setTitle(History Period Selection for Track :  +
trackName);
timePeriod.setClosable(true);
timePeriod.setWidth(520);
timePeriod.setHeight(400);
timePeriod.setPlain(true);
timePeriod.setCloseAction(Window.HIDE);
timePeriod.add(timePanel);
timePeriod.setModal(false);
timePeriod.setButtonAlign(Position.CENTER);

btnOK.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
((Button)sender).setEnabled(false);
pBar.enable();

Re: GWT + Google Maps [ERROR] Unable to load module entry point class

2009-03-25 Thread Gary1975

I am also sufferring from this problem. My code was working perfectly
well yesterday morning but then at around lunchtime it just stopped
and the crash isn't anywhere in the code that I was modifying. Today I
have tried going back to a backup of my source that was working on
monday night and this now displays the same symptoms even though it
worked perfectly when I did the backup.

I have tried numerous things this morning, including creating a new
project following the tutorial and not even this will work.

Can someone please help.

Thanks
Gary

On Mar 25, 10:15 am, nmadzharov nmadzha...@gmail.com wrote:
 Thanks for your reply.

 Firebug does not fire any errors.

 I have moved the script .. tag as suggested but with no effect.

 The hosted mode browser fires this error as well:

 [ERROR] Failure to load module
 'com.example.google.gwt.mapstutorial.SimpleMaps'

 And in this folder: com/example/google/gwt/mapstutorial/ I have the
 following content:
 SimpleMaps.gwt.xml
 client/
 public/

 It is very confusing to me.
 Do you have any suggestion about it ?

 Cheers, Nick

--~--~-~--~~~---~--~~
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: GWT + Google Maps [ERROR] Unable to load module entry point class

2009-03-25 Thread Gary1975

Hi,

I have just discovered what the problem is after wasting about 8 hours
looking into it. The API version in your script tag that contains the
key will refer to v2 of the API. Until yesterday at about 12:30pm this
mapped to v2.148 of the api. But it was then changed to map to v2.150
of the api and this is what appears to have caused the failures. The
simple fix is to change v2 in the script tag to be v2.148.

This should solve the problem.

Cheers
Gary

On Mar 25, 10:15 am, nmadzharov nmadzha...@gmail.com wrote:
 Thanks for your reply.

 Firebug does not fire any errors.

 I have moved the script .. tag as suggested but with no effect.

 The hosted mode browser fires this error as well:

 [ERROR] Failure to load module
 'com.example.google.gwt.mapstutorial.SimpleMaps'

 And in this folder: com/example/google/gwt/mapstutorial/ I have the
 following content:
 SimpleMaps.gwt.xml
 client/
 public/

 It is very confusing to me.
 Do you have any suggestion about it ?

 Cheers, Nick

--~--~-~--~~~---~--~~
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: GWT + Google Maps [ERROR] Unable to load module entry point class

2009-03-25 Thread Gary1975

That is the exact error that I was seeing and the changing the script
tag to script src=http://maps.google.com/maps?
gwt=1amp;file=apiamp;v=2.148 / in the *.gwt.xml file solved the
problem. It fixed both the sample code and my existing project that
had stopped working yesterday

Gary

On Mar 25, 3:52 pm, nmadzharov nmadzha...@gmail.com wrote:
 i dont understand how it does cimpile the project successgully, i.e.
 it finds that module and validates it and then it says it can't load
 it.

 My code and everything has been built according to the tutorial

 1.
 [ERROR] Unable to load module entry point class
 com.example.google.gwt.mapstutorial.client.SimpleMaps (see associated
 exception for details)
 java.lang.RuntimeException: The Maps API has not been loaded.
 Is a script tag missing from your host HTML or module file?  Is the
 Maps key missing or invalid?
         at com.google.gwt.maps.client.Maps.assertLoaded(Maps.java:29)
         at com.google.gwt.maps.client.geom.LatLng$.newInstance(Native Method)
         at com.example.google.gwt.mapstutorial.client.SimpleMaps.onModuleLoad
 (SimpleMaps.java:23)

 2.
 [ERROR] Failure to load module
 'com.example.google.gwt.mapstutorial.SimpleMaps'
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---