Re: Google Plugin for Eclipse 1.4 M2
Could you please publish the corresponding sources and javadoc as per maven convention in the maven repository? [ http://google-web-toolkit.googlecode.com/svn/2.1.0.M2/gwt/maven/com/google/gwt/gwt-user/2.1.0.M2/] thanks! moorsu On Sat, Jul 3, 2010 at 2:51 AM, Jason Parekh jasonpar...@gmail.com wrote: Excited about Google Web Toolkit 2.1 M2http://googlewebtoolkit.blogspot.com/2010/07/gwt-21-milestone-2-is-now-available.html? There's also a new Google Plugin for Eclipse 1.4 M2 to go along with it. Check out the new Speed Tracerhttp://code.google.com/webtoolkit/speedtracer/integration -- a simple toolbar button will launch Chrome and Speed Tracer to help you identify and fix performance problems in your web apps. Once you find an issue, you can click on a link in Speed Tracer to jump directly to that line of code in Eclipse. There are also many bug fixes, and smaller features like the ability to double-click URLs in the Development Mode view or the ability to halt an in-progress Deploy to App Engine or GWT compile. We recommend you install this on a clean Eclipse installation. Here are the update sites: - Eclipse Helios (3.6): http://google-web-toolkit.googlecode.com/svn/2.1.0.M2/eclipse/plugin/3.6 - Eclipse Galileo (3.5): http://google-web-toolkit.googlecode.com/svn/2.1.0.M2/eclipse/plugin/3.5 - Eclipse Ganymede (3.4): http://google-web-toolkit.googlecode.com/svn/2.1.0.M2/eclipse/plugin/3.4 - Eclipse Europa (3.3): http://google-web-toolkit.googlecode.com/svn/2.1.0.M2/eclipse/plugin/3.6 Enjoy! -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@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 Code works only in local env and does not work after uploading to App engine
Hie I have a code to launch a gwt popup using a gwt button. This code only works in local eclipse env and does not work after uploading to GAE (i mean popup doesnt show up on GAE). Please advise whats wrong here. I dont see any stack trace or error message anywhere. Here is the code: T*his code actually passes the data to renders a flex table in which one of the column is a button.* @Override public void onSuccess(ListFindBloodDonorResultBean result) { if(result.size() == 0){ CommonUi.showServerMsgPopup(Sorry no blood donor available as per your search criteria.); }else{ FindDonorPublicTable table = new FindDonorPublicTable(); ListString header = Arrays.asList(City,Area, Donors Available, POC Details); FlexTable data = table.setInput(header, result, countryName.getText().toLowerCase(), stateList.getValue(stateList.getSelectedIndex()).toLowerCase(), disttList.getValue(disttList.getSelectedIndex()).toLowerCase()); resultPanel.clear(); resultPanel.add(data); } }}); This code actually renders the flex table having a column with a button. On clicking it the popup should invoke: package vik.sakshum.sakshumweb.client.common.ui; public class FindDonorPublicTable extends FlexTable{ private String country; private String state; private String district; public FindDonorPublicTable() { super(); } PocInfoTable pocInfoTable; private class PocInfoTable extends FlexTable{ public PocInfoTable() { super(); } public void setHeader(ListString header){ int row = 0; if (header != null) { int i = 0; for (String string : header) { this.setText(row, i, string); i++; } row++; } } public void setInput(ListString header, ListPocProfileBean rows) { setHeader(header); int i = 1; for (PocProfileBean row : rows) { this.setText(i, 0, row.getFirstName()); this.setText(i, 1, row.getLastName()); this.setText(i, 2, row.getEmailId()); this.setText(i, 3, row.getCellNumber()); this.setText(i, 4, row.getOfficeNumber()); AddressBean addBean = row.getAddressBean(); this.setText(i, 5, addBean.getPinCode()); this.setText(i, 6, addBean.getCity()); this.setText(i, 7, addBean.getDistrict()); this.setText(i, 8, addBean.getState()); i++; } } }//end class PocInfoTable POCPopup pocPopup; private class POCPopup extends PopupPanel { private final FindBloodDonorServiceAsync findPOCService = GWT .create(FindBloodDonorService.class); public POCPopup(String city, String area) { super(true); this.setTitle(Point of Contact Details); VerticalPanel mainPanel = new VerticalPanel(); mainPanel.setSpacing(10); mainPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); Label titleText = new Label(Point of Contacts); Label infoText = new Label(Please note that below are *not* the actual blood donors. You need to call any of these people to get the information about available blood donors as per your searched criteria. We are not providing the personal information of blood donors to protect the information abuse.); mainPanel.add(titleText); mainPanel.add(infoText); mainPanel.add(pocInfoTable); setWidget(mainPanel); } } public void setHeader(ListString header){ int row = 0; if (header != null) { int i = 0; for (String string : header) { this.setText(row, i, string); i++; } row++; } // Make the table header look nicer this.getRowFormatter().addStyleName(0, sakth); } public FindDonorPublicTable setInput(ListString header, final ListFindBloodDonorResultBean rows, String country, String state, String district) { this.country = country; this.state = state; this.district = district; final FindDonorPublicTable tableHandle= this; setHeader(header); int i = 1; for (FindBloodDonorResultBean row : rows) { this.setText(i, 0, row.getCity()); this.setText(i, 1, row.getArea()); this.setText(i, 2, row.getDonorCount()); Button pocBtn = new Button(Get Point Of Contact); this.setWidget(i, 3, pocBtn); pocBtn.addClickHandler(new ClickHandler(){ @Override public void onClick(ClickEvent event) { pocPopup = new POCPopup(bhiwani,bhiwani); System.out.println(launching poc info pop); pocPopup.show(); }}); this.getCellFormatter().addStyleName(i, 0, sakbodytd); this.getCellFormatter().addStyleName(i, 1, sakbodytd); this.getCellFormatter().addStyleName(i, 2, sakbodytd); this.getCellFormatter().addStyleName(i, 3, sakbodytd); if(i%2 == 0) this.getRowFormatter().addStyleName(i, saktr-even); else this.getRowFormatter().addStyleName(i, saktr-odd); i++; } return this; } } Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com -- 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-tool...@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: JSON Problem
The easiest way by far is to use RestyGWT http://restygwt.fusesource.org/documentation/index.html With it, you just create GWT RPC style service interfaces to access restful JSON resources. For example, lets say you want to post some JSON to a URL of /blog/ comments: { author:Hiram, website:http://hiramchirino.com;, comment:This is my comment. } and you expect to get some JSON back that looks like: { comment-id:1234, moderated:true } The you would create some DTO style classes to give you type safe access to the request and response like: class CommentRequest { public String author; public String website; public String comment; } class CommentResponse { @Json(name=comment-id) public String commentId; public boolean moderated; } Notice that it can even deal with odd property names like comment-id which would be very hard to access with js overlays. Then you then create GWT RPC style service interfaces to access your URL: public interface CommentService extends RestService { @POST @Path(/blog/comments) public void comment(CommentRequest request, MethodCallbackCommentResponse callback); } You then create an instance use the service interface the same way that GWT RPC does it: CommentService service = GWT.create(CommentService.class); CommentRequest req = new CommentRequest req.author = Hiram req.website = http://hiramchirino.com; req.comment = This is my comment. service.comment(req, new MethodCallbackCommentResponse() { public void onFailure(Method method, Throwable exception) { Window.alert(Error x: + exception); } public void onSuccess(Method method, CommentResponse response) { Window.alert(posted comment: +response.commentId); } }); Hope that helped. On Jul 5, 8:01 am, Ahmed Shoeib ahmedelsayed.sho...@gmail.com wrote: Dear Friends , i face a problem when trying to send and receive json object between client and server in GWT application so i want a simple example that show me how to do this Thanks, ahmed shoeib -- 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-tool...@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 2.0 - Spring Security
Hi, if you are interested in complex integration of Spring security on client and also server side you might take a look on http://code.google.com/p/acris/wiki/Security BR On 21. Jún, 20:07 h., Tom thomas.coz...@gmail.com wrote: Hi, I have an GWT 2.0 application using Spring and Hibernate. (GWT-SL GXT) I would like to add a security layer and a profile handler. So I turn on Spring security. I don't find any samples of a GWT 2.0 Spring security 3.0. In fact, I would like a snippet of Spring security configuration. If anyone can help me to find the good way to start? Best regards Tom -- 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-tool...@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.
DockLayoutPanel MVP and events
Hi Very new to GWT and MVP. Trying to expand the contacts example with a DockLayoutPanel with a tree navigation in the west section. Using MVP and ui:bindings. Got an DockLayoutPanelView and Presenter. Inside is a tree component to the west and a content component in center. How will I get the events from the tree component? My DockViewPresenter: public class DockPresenter implements Presenter { public interface Display { Widget asWidget(); } private final ContactsServiceAsync rpcService; private final HandlerManager eventBus; private final Display display; private ContactsPresenter contactsPresenter; private TreePresenter treePresenter; public DockPresenter(ContactsServiceAsync rpcService, HandlerManager eventBus, Display view) { this.rpcService = rpcService; this.eventBus = eventBus; this.display = view; contactsPresenter = new ContactsPresenter(rpcService, eventBus, new ContactsView()); treePresenter = new TreePresenter(rpcService, eventBus, new MyTree()); } public void bind() { contactsPresenter.bind(); treePresenter.bind(); } public void go(final HasWidgets container) { bind(); container.clear(); container.add(display.asWidget()); } } As you can see I am creating the two presenters for the content and the tree, but I dont know how to get the events (clicks, selections) from them. They seem to be swallowed be the dock. I'm guessing I should register handlers in the bind() method, but how? When navigating to the tree component without the dock, events works fine. TreePresenter: public class TreePresenter implements Presenter { public interface Display { HasSelectionHandlersTreeItem getTree(); Widget asWidget(); } private final ContactsServiceAsync rpcService; private final HandlerManager eventBus; private final Display display; public TreePresenter(ContactsServiceAsync rpcService, HandlerManager eventBus, Display view) { this.rpcService = rpcService; this.eventBus = eventBus; this.display = view; } public void bind() { display.getTree().addSelectionHandler(new SelectionHandlerTreeItem() { public void onSelection(SelectionEventTreeItem event) { TreeItem item = (TreeItem) event.getSelectedItem(); GWT.log(Node selected +item.getText()); } }); } 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-tool...@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.
Serialization exception
Hi, I keep getting the serialization exception and causing the rpc failed. Can someone tell me what's going on? com.google.gwt.user.client.rpc.SerializationException: Type 'com.jobscout.frontpage.client.Category$$EnhancerByCGLIB$$424f9bbb' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = com.jobscout.frontpage.client.categ...@9cdbbc I use hibernate to extract the records, put the result in the ArrayList. To test the serialization, I dropped the hibernate part and built the ArrayList of the type in the Impl and it works. So, I am not sure how the hibernate return the arraylisttype causes the serialization exception. The following are extracted from my code that is relevent. public class Job implements Serializable { private long oid; private long acctOid; private String subject; private String description; private Category category;//Serializable private SubCat1 subcat1;//Serializable private Mesgtype mesgtype;//Serializable This part is the testing and it works. I create the Arraylist instead of using hibernate to extract records and return an Arraylist. public ArrayListJob getJobAryLstTest(){ ArrayListJob jobarylst = new ArrayListJob(); Category catparttime = new Category(0,Parttime); SubCat1 painter = new SubCat1(0, catparttime,Partime Painter); Mesgtype postjobmesgtype = new Mesgtype(0, Post Job); Job job1 = new Job(0,subject1,descruotuib1,catparttime, painter,postjobmesgtype); Job job2 = new Job(0,subject2,descruotuib2,catparttime, painter,postjobmesgtype); jobarylst.add(job1); jobarylst.add(job2); return jobarylst; This part call the hibernate dao and cause serialization exception public ArrayListJob getAllJobAryLst() { JobDAO jobdao=new JobDAO(); ArrayListJob rtnJobList; rtnJobList = jobdao.getAllJob(); return rtnJobList; } This part is the DAO public ArrayListJob getAllJob() { ArrayListJob rtnAryList=new ArrayListJob(); try { if(!session.isOpen()) { session = HibernateUtil.getSessionFactory().openSession(); } session.beginTransaction(); String hql=from Job job; rtnAryList = (ArrayListJob)session.createQuery(hql).list(); return rtnAryList; } catch(Exception e) { System.out.println(e.toString()); return null; } } Thanks Jimmy -- 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-tool...@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: Serialization exception
I had a similar problem once. You could sysou the rtnAryList.class to make sure it really is an instance of ArrayList and not a collection of hibernate. Although you instantiate an ArrayList the parsed call to list() may return something different. If it is one of hibernates collections (which it uses for lazy fetching and so on afaik) you could manually add all entries in an instance of ArrayList. The hibernate collections are not serializable by GWT by default. I think there is also at least one project out there for integrating hibernate to GWT which also avoids this problem, you might want to give it a quick search. Andreas On 8 Jul., 11:56, Ho Jimmy jimmyyl...@gmail.com wrote: Hi, I keep getting the serialization exception and causing the rpc failed. Can someone tell me what's going on? com.google.gwt.user.client.rpc.SerializationException: Type 'com.jobscout.frontpage.client.Category$$EnhancerByCGLIB$$424f9bbb' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = com.jobscout.frontpage.client.categ...@9cdbbc I use hibernate to extract the records, put the result in the ArrayList. To test the serialization, I dropped the hibernate part and built the ArrayList of the type in the Impl and it works. So, I am not sure how the hibernate return the arraylisttype causes the serialization exception. The following are extracted from my code that is relevent. public class Job implements Serializable { private long oid; private long acctOid; private String subject; private String description; private Category category; //Serializable private SubCat1 subcat1; //Serializable private Mesgtype mesgtype; //Serializable This part is the testing and it works. I create the Arraylist instead of using hibernate to extract records and return an Arraylist. public ArrayListJob getJobAryLstTest(){ ArrayListJob jobarylst = new ArrayListJob(); Category catparttime = new Category(0,Parttime); SubCat1 painter = new SubCat1(0, catparttime,Partime Painter); Mesgtype postjobmesgtype = new Mesgtype(0, Post Job); Job job1 = new Job(0,subject1,descruotuib1,catparttime, painter,postjobmesgtype); Job job2 = new Job(0,subject2,descruotuib2,catparttime, painter,postjobmesgtype); jobarylst.add(job1); jobarylst.add(job2); return jobarylst; This part call the hibernate dao and cause serialization exception public ArrayListJob getAllJobAryLst() { JobDAO jobdao=new JobDAO(); ArrayListJob rtnJobList; rtnJobList = jobdao.getAllJob(); return rtnJobList; } This part is the DAO public ArrayListJob getAllJob() { ArrayListJob rtnAryList=new ArrayListJob(); try { if(!session.isOpen()) { session = HibernateUtil.getSessionFactory().openSession(); } session.beginTransaction(); String hql=from Job job; rtnAryList = (ArrayListJob)session.createQuery(hql).list(); return rtnAryList; } catch(Exception e) { System.out.println(e.toString()); return null; } } Thanks Jimmy -- 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-tool...@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: Serialization exception
The error message means that you tried to send to the client a Category that was actually an instance of a subclass of Category - one created by Hibernate, and that subclass is not GWT-serializable (even if Category is). You have to take the hibernate results and convert them to an object that's free of the subclasses Hibernate builds. You might do this by creating DTOs (some people use Dozer to build them). Gilead is designed to do this automatically for you: http://noon.gilead.free.fr/gilead/index.php?page=gwt Paul Ho Jimmy wrote: Hi, I keep getting the serialization exception and causing the rpc failed. Can someone tell me what's going on? com.google.gwt.user.client.rpc.SerializationException: Type 'com.jobscout.frontpage.client.Category$$EnhancerByCGLIB$$424f9bbb' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = com.jobscout.frontpage.client.categ...@9cdbbc mailto:com.jobscout.frontpage.client.categ...@9cdbbc I use hibernate to extract the records, put the result in the ArrayList. To test the serialization, I dropped the hibernate part and built the ArrayList of the type in the Impl and it works. So, I am not sure how the hibernate return the arraylisttype causes the serialization exception. The following are extracted from my code that is relevent. public class Job implements Serializable { private long oid; private long acctOid; private String subject; private String description; private Category category;//Serializable private SubCat1 subcat1;//Serializable private Mesgtype mesgtype;//Serializable This part is the testing and it works. I create the Arraylist instead of using hibernate to extract records and return an Arraylist. public ArrayListJob getJobAryLstTest(){ ArrayListJob jobarylst = new ArrayListJob(); Category catparttime = new Category(0,Parttime); SubCat1 painter = new SubCat1(0, catparttime,Partime Painter); Mesgtype postjobmesgtype = new Mesgtype(0, Post Job); Job job1 = new Job(0,subject1,descruotuib1,catparttime, painter,postjobmesgtype); Job job2 = new Job(0,subject2,descruotuib2,catparttime, painter,postjobmesgtype); jobarylst.add(job1); jobarylst.add(job2); return jobarylst; This part call the hibernate dao and cause serialization exception public ArrayListJob getAllJobAryLst() { JobDAO jobdao=new JobDAO(); ArrayListJob rtnJobList; rtnJobList = jobdao.getAllJob(); return rtnJobList; } This part is the DAO public ArrayListJob getAllJob() { ArrayListJob rtnAryList=new ArrayListJob(); try { if(!session.isOpen()) { session = HibernateUtil.getSessionFactory().openSession(); } session.beginTransaction(); String hql=from Job job; rtnAryList = (ArrayListJob)session.createQuery(hql).list(); return rtnAryList; } catch(Exception e) { System.out.println(e.toString()); return null; } } Thanks Jimmy -- 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-tool...@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. -- 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-tool...@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: Serialization exception
Another idea from looking over your exception again: Since you are loading an object with references to other objects you also would want to make sure that hibernate really loads the references. I think by default it uses lazy fetching and hence initializes the references with proxy objects. These proxy objects again are not serializable by GWT (by itself). You can deactivate lazy fetching in the hibernate mapping file: hibernate-mapping package=my.package default-lazy=false This makes hibernate really load and instantiate a Category object and not a proxy. Andreas On 8 Jul., 12:13, andreas horst.andrea...@googlemail.com wrote: I had a similar problem once. You could sysou the rtnAryList.class to make sure it really is an instance of ArrayList and not a collection of hibernate. Although you instantiate an ArrayList the parsed call to list() may return something different. If it is one of hibernates collections (which it uses for lazy fetching and so on afaik) you could manually add all entries in an instance of ArrayList. The hibernate collections are not serializable by GWT by default. I think there is also at least one project out there for integrating hibernate to GWT which also avoids this problem, you might want to give it a quick search. Andreas On 8 Jul., 11:56, Ho Jimmy jimmyyl...@gmail.com wrote: Hi, I keep getting the serialization exception and causing the rpc failed. Can someone tell me what's going on? com.google.gwt.user.client.rpc.SerializationException: Type 'com.jobscout.frontpage.client.Category$$EnhancerByCGLIB$$424f9bbb' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = com.jobscout.frontpage.client.categ...@9cdbbc I use hibernate to extract the records, put the result in the ArrayList. To test the serialization, I dropped the hibernate part and built the ArrayList of the type in the Impl and it works. So, I am not sure how the hibernate return the arraylisttype causes the serialization exception. The following are extracted from my code that is relevent. public class Job implements Serializable { private long oid; private long acctOid; private String subject; private String description; private Category category; //Serializable private SubCat1 subcat1; //Serializable private Mesgtype mesgtype; //Serializable This part is the testing and it works. I create the Arraylist instead of using hibernate to extract records and return an Arraylist. public ArrayListJob getJobAryLstTest(){ ArrayListJob jobarylst = new ArrayListJob(); Category catparttime = new Category(0,Parttime); SubCat1 painter = new SubCat1(0, catparttime,Partime Painter); Mesgtype postjobmesgtype = new Mesgtype(0, Post Job); Job job1 = new Job(0,subject1,descruotuib1,catparttime, painter,postjobmesgtype); Job job2 = new Job(0,subject2,descruotuib2,catparttime, painter,postjobmesgtype); jobarylst.add(job1); jobarylst.add(job2); return jobarylst; This part call the hibernate dao and cause serialization exception public ArrayListJob getAllJobAryLst() { JobDAO jobdao=new JobDAO(); ArrayListJob rtnJobList; rtnJobList = jobdao.getAllJob(); return rtnJobList; } This part is the DAO public ArrayListJob getAllJob() { ArrayListJob rtnAryList=new ArrayListJob(); try { if(!session.isOpen()) { session = HibernateUtil.getSessionFactory().openSession(); } session.beginTransaction(); String hql=from Job job; rtnAryList = (ArrayListJob)session.createQuery(hql).list(); return rtnAryList; } catch(Exception e) { System.out.println(e.toString()); return null; } } Thanks Jimmy -- 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-tool...@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: Problems with jasperreports integration
I had this problem. I am able to resolve this by excluding jdtcore from the compile classpath in Maven's pom.xml dependency groupIdar.com.fdvs/groupId artifactIdDynamicJasper/artifactId version${dynamic-jasper.version}/version exclusions exclusion groupIdeclipse/groupId artifactIdjdtcore/artifactId /exclusion /exclusions /dependency Hope this helps. moorsu On Jun 20, 12:06 am, Vinicius Rabelo vinicius1...@gmail.com wrote: I created one new project with gwt-maven-plugin and the unique thing that i did in the project went to add the jasperreports dependency... The project stopped in exactly moment that i add the dependency do jasper... But if I create one project out maven I dont have this problem... Somebody can help me? -- 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-tool...@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.
Is there a GWT Developer Plugin for Firefox 4 Beta 1
Hello ! Everything is in the subject, I would like to know if there is a testing version of the GWT Developer Plugin for Firefox that could be compatible with the new Firefox 4.0 Beta 1. I use Windows Seven x32. Did anyone build a recent xpi from the trunk where this support has been activated ? 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-tool...@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: Is there a GWT Developer Plugin for Firefox 4 Beta 1
See https://groups.google.com/group/google-web-toolkit/browse_thread/thread/6cd0bfee74691aa3/05e091ae577948af?pli=1 On Jul 8, 2:18 pm, Tulkas jerome.mil...@gmail.com wrote: Hello ! Everything is in the subject, I would like to know if there is a testing version of the GWT Developer Plugin for Firefox that could be compatible with the new Firefox 4.0 Beta 1. I use Windows Seven x32. Did anyone build a recent xpi from the trunk where this support has been activated ? 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-tool...@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: remove old javascript file
I see in repeated cases, where someone's browser displays old app design, and clearing browser cache brings up the latest. How can that be? A few things can go wrong - 1. Browser is caching module.nocache.js. If this happens, the browser will also download the stale *.cache.html files. And, you if you have made changes to RPC services, this will manifest itself as IncompatibleRemoteServiceException. 2. Browser is caching css/html/images, so even if your code is new, the look-and-feel will be old. As I mentioned earlier, the problem is best mitigated by getting rid of the third Cache for Sometime bucket by making aggressive use of ClientBundle. --Sri On 8 July 2010 07:39, bhomass bhom...@gmail.com wrote: I don't understand something. according to you, none of the generated js would fall under cache for sometimes. That means all the js files except nocache.js would be cached forever. and GWT takes care that new file names will be generated when this type filed change. By this logic, there could never be any stale js problem. yet, I see in repeated cases, where someone's browser displays old app design, and clearing browser cache brings up the latest. How can that be? On Jun 26, 6:44 pm, André Severo Meira andrex1...@gmail.com wrote: Nice! 2010/6/26 bhomass bhom...@gmail.com do you mean to set a limited cache lifetime or to not cache at all? I do normally want the javascript files to be cached for performance purposes. On Jun 17, 10:02 pm, Sripathi Krishnan sripathi.krish...@gmail.com wrote: No, you can't do that. But if you set appropriate cache headers, there is never a need to delete old files. --Sri On 18 June 2010 06:10, bhomass bhom...@gmail.com wrote: is there any way to programmatically get user browser to delete all its cached javascript files in order to push down new ones? -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com google-web-toolkit%2bunsubscr...@googlegroups.comgoogle-web-toolkit%252bunsubscr...@googlegroups.com google-web-toolkit%2bunsubscr...@googlegroups.comgoogle-web-toolkit%252bunsubscr...@googlegroups.com google-web-toolkit%252bunsubscr...@googlegroups.comgoogle-web-toolkit%25252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com google-web-toolkit%2bunsubscr...@googlegroups.comgoogle-web-toolkit%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@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: align the widgets in DocLayoutPanel
Hello Stefani Thanks It works for html. But I can not add a style for widgets so I still have a problem. VerticalPanel vPanel = new VerticalPanel(); p.addEast(vPanel,40); I still didnt find a way to align the widgets in DockLayoutPanel's Edges. In my project actually everything is ok If I add more than one East Edge. But I am sure there would be a way to do this. Anyway, everthing is ok in my project now :) Thanks all.. -- 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-tool...@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.
Callback working but variable not initialized??
Heres my code.. I'm using GWT 2.0.3 with smartGWT 2.2. I think this is a GWT related question.. [CODE] /** * */ package org.gwt.venus.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.RootPanel; /** * @author npradeeptha * */ import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.DateRange; import com.smartgwt.client.data.RelativeDate; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.ComboBoxItem; import com.smartgwt.client.widgets.form.fields.DateRangeItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; public class VenusData implements EntryPoint { /* (non-Javadoc) * @see com.google.gwt.core.client.EntryPoint#onModuleLoad() */ VenusDataSource vds = new VenusDataSource(); private RpcCallServiceAsync rpc = RpcInit.initRpc(); String[] designstrings = null; @Override public void onModuleLoad() { // TODO Auto-generated method stub initializeDesignsArray(); DataSource ds = vds.getDs(); VLayout layout = new VLayout(8); HLayout searchFields = new HLayout(); searchFields.setBackgroundColor(Cyan); DynamicForm searchForm = new DynamicForm(); ComboBoxItem cmbDesigns = new ComboBoxItem(cmbDesigns, Design); ComboBoxItem cmbCriteria = new ComboBoxItem(cmbCriteria, Criteria); cmbDesigns.setWidth(*); cmbCriteria.setWidth(*); cmbDesigns.setType(comboBox); //cmbDesigns.setValueMap(designstrings); cmbCriteria.setValueMap(FAST,HARSHA_FAST,NIJ_1); // Inline FilterEditor Example (MiniDateRangeItem) final DateRangeItem rangeItem = new DateRangeItem(Date); rangeItem.setWidth(*); rangeItem.setShowTitle(false); rangeItem.setAllowRelativeDates(true); DateRange dateRange = new DateRange(); dateRange.setRelativeStartDate(new RelativeDate(m)); dateRange.setRelativeEndDate(new RelativeDate(m)); rangeItem.setValue(dateRange); searchForm.setNumCols(6); searchForm.setFields(cmbDesigns,cmbCriteria, rangeItem); searchFields.addMember(searchForm); // Create a ListGrid displaying data from the worldDS and also displaying a FilterEditor final ListGrid dataGrid = new ListGrid(); dataGrid.setWidth(655); dataGrid.setHeight(240); searchFields.setWidth(650); ListGridField builds = new ListGridField(build, Build); builds.setWidth(130); ListGridField criteria = new ListGridField(criteria, Criteria); ListGridField design = new ListGridField(design, Design); ListGridField lut = new ListGridField(lut, LUT); ListGridField date = new ListGridField(date, Date); ListGridField lut4 = new ListGridField(lut4, Eq LUT4); ListGridField ble = new ListGridField(ble, BLE FFs); ListGridField slack = new ListGridField(slack, Slack); dataGrid.setFields(builds,criteria,design,date,slack,lut,lut4,ble); dataGrid.setDataSource(ds); dataGrid.setAutoFetchData(true); System.out.println(designstrings.length); //*** Gives a null pointer error. cmbDesigns.setValueMap(designstrings); //does not set any values since designstrings is null. layout.addMember(searchFields); layout.addMember(dataGrid); layout.draw(); RootPanel.get(content).add(layout); } public void initializeDesignsArray(){ rpc.getDesign(new AsyncCallbackDesign[]() { @Override public void onFailure(Throwable caught) { System.out.println(Design callback failed); } @Override public void onSuccess(Design[] result) { //System.out.println(result.length); String[] designs = new String[result.length]; for(int i=0; idesigns.length; i++){ designs[i] = result[i].design; System.out.println(designs[i]); // Prints the items so the callback works and gets data.. } loadDesigns(designs); } }); } public void loadDesigns(String[] result) { designstrings = result; System.out.println(designstrings.length); //works too } } [/CODE] I have commented on the code where it works and goes wrong.. The CallBack works perfectly but the variable is always null. Please explain whats going on. Thanks!! -- You received this message because you are subscribed to the
Does these books still compatible with the new GWT ?
I have a plan to buy these books: 1. GWT in Practice [Manning, 2008] 2. Pro Web 2.0 Application Development with GWT (Pro) [Apress. 2008] 3. Beginning Google Web Toolkit [Apress, 2008] But, does those books still compatible with the new GWT ? Thx before! :) -- 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-tool...@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.
FK Arrays not supported error on deletePersistent
I have a class I am successfully able to persist to the datastore: package com.appointments; import java.util.Date; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; import com.google.appengine.api.datastore.Key; @PersistenceCapable public class Client { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; @Persistent private int clientId; @Persistent private String clientName; @Persistent private Date dateAdded; @Persistent private Customer[] customers; @Persistent private Resource[] resources; public Key getKey() { return key; } public void setKey(Key key) { this.key = key; } public String getClientName() { return clientName; } public void setClientName(String clientName) { this.clientName = clientName; } public Date getDateAdded() { return dateAdded; } public void setDateAdded(Date dateAdded) { this.dateAdded = dateAdded; } public Customer[] getCustomers() { return customers; } public void setCustomers(Customer[] customers) { this.customers = customers; } public Resource[] getResources() { return resources; } public void setResources(Resource[] resources) { this.resources = resources; } public void setClientId(int clientId) { this.clientId = clientId; } public int getClientId() { return clientId; } } And I can delete it from the datastore viewer, but when I try to delete it via RPC call I get: SEVERE: [1278546531467000] javax.servlet.ServletContext log: Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract void com.appointments.clientactions.client.ClientService.deleteClient(com.appointments.client.dto.client.ClientDTO)' threw an unexpected exception: java.lang.UnsupportedOperationException: FK Arrays not supported. My delete method looks like this: public void deleteClient(ClientDTO pClientDTO) { System.out.println(ClientServiceImpl::deleteClient called with key + pClientDTO.getKey()); PersistenceManager pm = PMF.get().getPersistenceManager(); Key k = KeyFactory.stringToKey(pClientDTO.getKey()); Client lClient = pm.getObjectById(com.appointments.Client.class, k); if (lClient != null) { System.out.println(Trying to delete + lClient.getClientName()); pm.deletePersistent(lClient); } pm.close(); } Thanks for any 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-tool...@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.
adding packages to gwt app
Hi Everyone, I am new to GWT. I am trying to convert a java client side application to client-server web application. I have created a gwt project, and now I need an access to my old java project. How do I access packages from another project? I mean how do I add my own packages to gwt app? Thanks in advance. GWT Learner -- 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-tool...@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: Dev plugin for firefox 3.7
Doesn't work with Firefox 4.0 beta1 and Firefox 4.0 beta2pre (nightlybuild). Tested with gecko1.9.3 plugin-sdk from google and with self build gecko2.0b2pre sdk. I still get the Development Mode requires the Google Web Toolkit Developer Plugin page. Any hints? -- 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-tool...@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: Does these books still compatible with the new GWT ?
Yes the concepts explained are compatible with GWT 2.0 I know the 2 first books and IMHO Pro Web 2.0 Application Development with GWT (Pro) [Apress. 2008] is a really good one, supported by a good source code project: http://code.google.com/p/tocollege-net On Jul 8, 10:33 am, Rachmat Kukuh R. rku...@gmail.com wrote: I have a plan to buy these books: 1. GWT in Practice [Manning, 2008] 2. Pro Web 2.0 Application Development with GWT (Pro) [Apress. 2008] 3. Beginning Google Web Toolkit [Apress, 2008] But, does those books still compatible with the new GWT ? Thx before! :) -- 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-tool...@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: Does these books still compatible with the new GWT ?
Hi, Books about GWT are outdated when they are coming out. GWT 2.0 was a major release in dec 2009, so any book from 2008 will not cover topics like ClientBundle, UiBinder, Codesplitting and Development Mode. 2.1 will come up with new widgets. So with printed books you always live in the past. My personal approach, just buy one and then use this forum and the original docu. Stefan Bachert http://gwtworld.de On 8 Jul., 10:33, Rachmat Kukuh R. rku...@gmail.com wrote: I have a plan to buy these books: 1. GWT in Practice [Manning, 2008] 2. Pro Web 2.0 Application Development with GWT (Pro) [Apress. 2008] 3. Beginning Google Web Toolkit [Apress, 2008] But, does those books still compatible with the new GWT ? Thx before! :) -- 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-tool...@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: create web service inside GWT project
Hi Jeff, Just to explain my plan a little further: I'm building an application where the user normally interacts with the system using GWT in a browser (the most normal way of using GWT). But I'd also like to generate some documents (in MS-Word) using data and objects that are available in the GWT-server. There would probably be only a small number of methods that need to be available on the outside, so a very heavyweight library would be overkill. It all boils down to: I want to execute a function in a word-macro: String GetTheTextForThisWordDocument(documentId); :-) :-) XHR sounds good, but how can I get that to work? The way I think about it I would probably need to perform the following steps: - Create an object / methods that perform the function(s) that I want to be available (the GetTheText... method mentioned above); - Use some kind of library / construction that can make that object available to the outside world (just like GWT does in its own way). Is there some kind of standard XHR library? - Somehow configure the application server (in web.xml?) to respond to a certain URL using that library (example: http://localhost:8001/WordDocumentXHR) Those last two points I've never dealt with before (and I haven't found anything googling), so any advise would be appreciated. Arian. On 8 jul, 02:26, Jeff Chimene jchim...@gmail.com wrote: On 07/05/2010 02:28 PM, Arian Prins wrote: Hello people, I have a hard time figuring out what would be the best approach for my problem. I'd like to communicate some info from the server (side logic) to an MS-Office macro. I could always use ODBC to let the office macro query the database directly but that just feels like a kludge. I've got a lot of objects in my application in which a lot of processing is already implemented. So, I figure, the best way would be to create a web service (SOAP?) inside the gwt server-side implementation that can be queried by outside applications. I've done a lot of searching, but haven't really found any definitive way that would be best. Should I use an existing RPC/SOAP/JSON library and try to integrate it into GWT's structure (how to configure web.xml? etc. etc.)? Is there something already provided by google or in de code projects? Any thoughts and tips would be greatly appreciated. Arian Prins. Hi Arian, I've written some fairly complex Office macros. I'm not sure where GWT fits into your application. In your case, the client side is MS Office macros, not a browser JavaScript instance. The server side can be whatever you wish. You will probably want to use XMLHTTPRequests (XHR) to communicate with the server; I think SOAP is a bit heavy-handed to implement in an Office macro. I doubt RPC will work for you, as the serialization logic is also a bit much for an Office macro. This leaves JSON, application-specific XML (as opposed to the generalized SOAP DTD), CSV. If you are planning to use the Google App Engine, I'm not sure how to get Office macros to use Java RPC. I'm leaning towards the XHR solution: it's lightweight, can be tested independently of the macro environment, and straightforward to mock inside the macro environment. -- 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-tool...@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 2.1 M1 Data Presentation Widgets tutorial?
Can some one please send examples/documentation/tutorial for GWT 2.1 M1 Data Presentation Widgets. -- 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-tool...@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.
Managing DB Sessions/connection with GWT + Hibernate
Hi, What is the best practice to manage Hibernate sessions in a GWT servlet ? The following article on Google code shows some basic code to use Hibernate with GWT. http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html However I don't see any calls that close the Session (session.close()) !!. Does Hibernate call close somehow internally ? Once you get a Hibernate Session, should I hold on to this (like putting this in HttpSession) or should I close before I leave my RPC method ? 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-tool...@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: FlexTables - store invisible database key in row?
Hm, this doesn't work for me. All the cells are shifted in their horizontal positions... With your method the table does not behave as if the column width were 0px. I wonder how to deal with this stuff... Magnus On Jul 7, 7:47 pm, Thad thad.humphr...@gmail.com wrote: I do this in a number of places in my application. Use your style sheet: DoubleClickTable rootTable = new DoubleClickTable(); // my class that extends FlexTable HTMLTable.CellFormatter cellFormatter = rootTable.getCellFormatter(); ... rootTable.setText(row, ROWID_COL, record.getAttribute(rowid)); // Set other fields. rootTable.getRowFormatter().setStyleName(row, unselectedRow); // style the row cellFormatter.setStyleName(row, ROWID_COL, hidden-Column); // hide the cell In the CSS, .hidden-Column { display: none; } On Jul 7, 12:54 pm, Magnus alpineblas...@googlemail.com wrote: Hi, I would like to use a FlexTable as a list of users and I need to attach a user id to each row somehow, in order to identify the user when a row is selected. I tried to use a column of width 0px, but this column is visible... How would you do that? Thanks Magnus -- 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-tool...@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: create web service inside GWT project
On 07/08/2010 07:34 AM, Arian Prins wrote: Hi Jeff, Just to explain my plan a little further: I'm building an application where the user normally interacts with the system using GWT in a browser (the most normal way of using GWT). But I'd also like to generate some documents (in MS-Word) using data and objects that are available in the GWT-server. There would probably be only a small number of methods that need to be available on the outside, so a very heavyweight library would be overkill. Please drop the concept of GWT server, as it doesn't exist. GWT is a client-side solution that can interact with a variety of server-side solutions. Perhaps I'm misinterpreting the term GWT server? It all boils down to: I want to execute a function in a word-macro: String GetTheTextForThisWordDocument(documentId); :-) :-) That's fine. As I recall, you can access XHR technology from an Office macro. XHR sounds good, but how can I get that to work? You'll want to use .NET objects The way I think about it I would probably need to perform the following steps: - Create an object / methods that perform the function(s) that I want to be available (the GetTheText... method mentioned above); Yes. - Use some kind of library / construction that can make that object available to the outside world (just like GWT does in its own way). I think the answer to this is no. But there is still some fuzziness in terminology here that should be clarified before a definitive answer. Is there some kind of standard XHR library? Yes, there are several GWT classes: JsonpRequestBuilder, RpcRequestBuilder, RequestBuilder. Of these, I think the first and third are what you'll want, since it sounds like you won't be using Java to handle the request (although there may be Java/Office interoperability classes available) Since the documents are on the server, you can construct a .NET service that listens for HTTP requests, evaluates the request, loads the document, executes the macro, retrieves the response, formats it, then sends it to the client. Using this solution, I think you'll be limited to UTF-8 scalars (i.e. no images, no structured document fragments). If you want more than that, you'll probably want to have the server send the document fragment using one of the MS MIME types. - Somehow configure the application server (in web.xml?) to respond to a certain URL using that library (example: http://localhost:8001/WordDocumentXHR) Unless you're using server-side Java, there's no use for the web.xml file. web.xml is for those using Java RPC services. The URL you provide above is defined in your application as a string constant, and used by one of the classes I mentioned above. Those last two points I've never dealt with before (and I haven't found anything googling), so any advise would be appreciated. Arian. On 8 jul, 02:26, Jeff Chimene jchim...@gmail.com wrote: On 07/05/2010 02:28 PM, Arian Prins wrote: Hello people, I have a hard time figuring out what would be the best approach for my problem. I'd like to communicate some info from the server (side logic) to an MS-Office macro. I could always use ODBC to let the office macro query the database directly but that just feels like a kludge. I've got a lot of objects in my application in which a lot of processing is already implemented. So, I figure, the best way would be to create a web service (SOAP?) inside the gwt server-side implementation that can be queried by outside applications. I've done a lot of searching, but haven't really found any definitive way that would be best. Should I use an existing RPC/SOAP/JSON library and try to integrate it into GWT's structure (how to configure web.xml? etc. etc.)? Is there something already provided by google or in de code projects? Any thoughts and tips would be greatly appreciated. Arian Prins. Hi Arian, I've written some fairly complex Office macros. I'm not sure where GWT fits into your application. In your case, the client side is MS Office macros, not a browser JavaScript instance. The server side can be whatever you wish. You will probably want to use XMLHTTPRequests (XHR) to communicate with the server; I think SOAP is a bit heavy-handed to implement in an Office macro. I doubt RPC will work for you, as the serialization logic is also a bit much for an Office macro. This leaves JSON, application-specific XML (as opposed to the generalized SOAP DTD), CSV. If you are planning to use the Google App Engine, I'm not sure how to get Office macros to use Java RPC. I'm leaning towards the XHR solution: it's lightweight, can be tested independently of the macro environment, and straightforward to mock inside the macro environment. -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to
difference in alignment on different browsers
Hie Check out please http://1.latest.sakshumweb20.appspot.com/ui/page/DonorRegister.jsp and notice the alignment of fields in IE Vs chrome/firefox The one coming in chrome or firefox is the desired one. So how to fix it for IE? And I thought i dont need to take care cross browser stuff using gwt Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com -- 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-tool...@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 2.1 M1 Data Presentation Widgets tutorial?
Yes, me too. But I wish to have examples WITHOUT spring roo involved please!!! -- 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-tool...@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.
Different paging behaviour for CellTable and SimplePager
Hi guys, I'm playing around with the CellTable and SimplePager from GWT 2.1 M2 and all is fine and dandy... besides one thing. The paging works great but it doesn't work like me and my colleagues would like to. The current setup behaves as follows, imagine I have a dataset of five rows and a page size of two. The first page shows rows one and two, the second page shows rows three and four (all great!), the third page, however, show row four and five (it repeats row four). I would like the above last page to only show the fifth row and also fill up the rest of the table to keep the pager element below the table in its place. I thought of sub-classing the SimplePager's and change its paging behavior. I did this by overriding the setPageStart() and make sure the starting index is always correct. This works fine but when using this the CellTable gets and ArrayIndexOutOfBoundsException as it adds up the startIndex and the pageSize. I would think this is a bug but decided to post it here first. What do you guys think? A bug? Or do you have any tips of how to get the behavior I want? Maybe I'm overlooking something. PS I'm looking into overriding some of the methods in CellTable as well to enable my desired behavior but expect this to be non-trivial. -- 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-tool...@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: difference in alignment on different browsers
IE seems to be inheriting the align=center from the parent td. the simple way is to add align=left on the form table, but you could add it to each cell individually using the cell formatter. Depending on the GWT panels you are using there are multiple different ways to solve this. Essentially the difference is inheritance in IE vs Gecko/ Webkit. On Jul 8, 9:43 am, Vik vik@gmail.com wrote: Hie Check out pleasehttp://1.latest.sakshumweb20.appspot.com/ui/page/DonorRegister.jsp and notice the alignment of fields in IE Vs chrome/firefox The one coming in chrome or firefox is the desired one. So how to fix it for IE? And I thought i dont need to take care cross browser stuff using gwt Thankx and Regards Vik Founderwww.sakshum.comwww.sakshum.blogspot.com -- 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-tool...@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.
Multiple pagers for CellTable?
It would be good if CellTable allowed linking more pagers, so you could have pager above and below table. Do you think it's worth enhancement request, or is it already in the plans? Regards JZ -- 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-tool...@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 2.1 M1 Data Presentation Widgets tutorial?
Check out the Cookbook sample: http://google-web-toolkit.googlecode.com/svn/branches/2.1M2/bikeshed/src/com/google/gwt/sample/bikeshed/cookbook I also posted a small example earlier http://groups.google.com/group/google-web-toolkit/browse_thread/thread/357ab22364b0bcea/f6dd50e6c66a20eb?hl=en#f6dd50e6c66a20eb On Jul 8, 11:52 am, Blessed Geek blessedg...@gmail.com wrote: Yes, me too. But I wish to have examples WITHOUT spring roo involved please!!! -- 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-tool...@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.
Using FormPanel to get XML data - workaround?
Based on the docs for FormPanel the server has to reply with the content-type of text/html, otherwise there may be issues with some browsers. But if you do that, and send XML content it seems it has browser issues. For example, in FF/DevMode the SubmitCompleteEventHandler returns null for the result. In Chrome is returns the XML content, but it is malformed. Some elements like link / were in the results as link, causing XML parsing issues. One solution I found was to return the XML as an HTML comment, prefixed by some fake content. For example, instead of this: ?xml version='1.0' encoding='UTF-8'?feed.../feed I returned this: content!--?xml version='1.0' encoding='UTF-8'?feed.../feed-- I can then remove the prefix content!-- and postfix -- text, and parse what remains as XML. Other than the fact that I don't handle the possibility of comments within the XML content, is there any other potential issues? Or maybe there is a better way? The only requirement for what I am working on is that it must use a FormPanel submission, and parse the XML returned from the server. Thanks. Rob -- 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-tool...@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: FlexTables - store invisible database key in row?
Odd. I use this trick in number of different places, and had done so since GWT 1.3 (in fact, I learned the style trick from this list and, in part, from the old Mail sample). It's been tested with Firefox, IE, and Safari. When my cells have been shifted it's because I did not count or order my columns correctly. You might try posting a bit of your code. On Jul 8, 11:38 am, Magnus alpineblas...@googlemail.com wrote: Hm, this doesn't work for me. All the cells are shifted in their horizontal positions... With your method the table does not behave as if the column width were 0px. I wonder how to deal with this stuff... Magnus On Jul 7, 7:47 pm, Thad thad.humphr...@gmail.com wrote: I do this in a number of places in my application. Use your style sheet: DoubleClickTable rootTable = new DoubleClickTable(); // my class that extends FlexTable HTMLTable.CellFormatter cellFormatter = rootTable.getCellFormatter(); ... rootTable.setText(row, ROWID_COL, record.getAttribute(rowid)); // Set other fields. rootTable.getRowFormatter().setStyleName(row, unselectedRow); // style the row cellFormatter.setStyleName(row, ROWID_COL, hidden-Column); // hide the cell In the CSS, .hidden-Column { display: none; } On Jul 7, 12:54 pm, Magnus alpineblas...@googlemail.com wrote: Hi, I would like to use a FlexTable as a list of users and I need to attach a user id to each row somehow, in order to identify the user when a row is selected. I tried to use a column of width 0px, but this column is visible... How would you do that? Thanks Magnus -- 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-tool...@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: FlexTables - store invisible database key in row?
Look at this simplified example. If you run this, you should see a table with no column or data D. public class HiddenColumnTest implements EntryPoint { public void onModuleLoad() { FlexTable table = new FlexTable(); HTMLTable.CellFormatter cellFormatter = table.getCellFormatter(); String alphas = ABCDEFG; for (int col=0; col alphas.length(); col++) table.setText(0, col, Column +alphas.charAt(col)); table.getRowFormatter().setStyleName(0, columnHeader); cellFormatter.setStyleName(0, 3, hidden-Column); // No D for (int row=1; row = 6; row++) { for (int col=0; col alphas.length(); col++) table.setText(row, col, Data +row+-+alphas.charAt(col)); cellFormatter.setStyleName(row, 3, hidden-Column); // No D } RootPanel.get().add(table); } } In the CSS: .columnHeader { font-weight: bold; } .hidden-Column { display: none; } On Jul 8, 11:38 am, Magnus alpineblas...@googlemail.com wrote: Hm, this doesn't work for me. All the cells are shifted in their horizontal positions... With your method the table does not behave as if the column width were 0px. I wonder how to deal with this stuff... Magnus On Jul 7, 7:47 pm, Thad thad.humphr...@gmail.com wrote: I do this in a number of places in my application. Use your style sheet: DoubleClickTable rootTable = new DoubleClickTable(); // my class that extends FlexTable HTMLTable.CellFormatter cellFormatter = rootTable.getCellFormatter(); ... rootTable.setText(row, ROWID_COL, record.getAttribute(rowid)); // Set other fields. rootTable.getRowFormatter().setStyleName(row, unselectedRow); // style the row cellFormatter.setStyleName(row, ROWID_COL, hidden-Column); // hide the cell In the CSS, .hidden-Column { display: none; } On Jul 7, 12:54 pm, Magnus alpineblas...@googlemail.com wrote: Hi, I would like to use a FlexTable as a list of users and I need to attach a user id to each row somehow, in order to identify the user when a row is selected. I tried to use a column of width 0px, but this column is visible... How would you do that? Thanks Magnus -- 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-tool...@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: Callback working but variable not initialized??
You're running into an async problem. The call back happens asynchronusly, meaning, just because you kick off the RPC service does not mean that designStrings will have a value in it before you execute the code after you kick off the RPC. Get rid of anything that uses designStrings outside of the callback or loadDesigns. Looking over your code quickly, what you want to do is in loadDesign, iterate through result and put it into your Combo Box. On Jul 8, 3:31 am, npradeeptha nipuna.ro...@gmail.com wrote: Heres my code.. I'm using GWT 2.0.3 with smartGWT 2.2. I think this is a GWT related question.. [CODE] /** * */ package org.gwt.venus.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.RootPanel; /** * @author npradeeptha * */ import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.DateRange; import com.smartgwt.client.data.RelativeDate; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.ComboBoxItem; import com.smartgwt.client.widgets.form.fields.DateRangeItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; public class VenusData implements EntryPoint { /* (non-Javadoc) * @see com.google.gwt.core.client.EntryPoint#onModuleLoad() */ VenusDataSource vds = new VenusDataSource(); private RpcCallServiceAsync rpc = RpcInit.initRpc(); String[] designstrings = null; @Override public void onModuleLoad() { // TODO Auto-generated method stub initializeDesignsArray(); DataSource ds = vds.getDs(); VLayout layout = new VLayout(8); HLayout searchFields = new HLayout(); searchFields.setBackgroundColor(Cyan); DynamicForm searchForm = new DynamicForm(); ComboBoxItem cmbDesigns = new ComboBoxItem(cmbDesigns, Design); ComboBoxItem cmbCriteria = new ComboBoxItem(cmbCriteria, Criteria); cmbDesigns.setWidth(*); cmbCriteria.setWidth(*); cmbDesigns.setType(comboBox); //cmbDesigns.setValueMap(designstrings); cmbCriteria.setValueMap(FAST,HARSHA_FAST,NIJ_1); // Inline FilterEditor Example (MiniDateRangeItem) final DateRangeItem rangeItem = new DateRangeItem(Date); rangeItem.setWidth(*); rangeItem.setShowTitle(false); rangeItem.setAllowRelativeDates(true); DateRange dateRange = new DateRange(); dateRange.setRelativeStartDate(new RelativeDate(m)); dateRange.setRelativeEndDate(new RelativeDate(m)); rangeItem.setValue(dateRange); searchForm.setNumCols(6); searchForm.setFields(cmbDesigns,cmbCriteria, rangeItem); searchFields.addMember(searchForm); // Create a ListGrid displaying data from the worldDS and also displaying a FilterEditor final ListGrid dataGrid = new ListGrid(); dataGrid.setWidth(655); dataGrid.setHeight(240); searchFields.setWidth(650); ListGridField builds = new ListGridField(build, Build); builds.setWidth(130); ListGridField criteria = new ListGridField(criteria, Criteria); ListGridField design = new ListGridField(design, Design); ListGridField lut = new ListGridField(lut, LUT); ListGridField date = new ListGridField(date, Date); ListGridField lut4 = new ListGridField(lut4, Eq LUT4); ListGridField ble = new ListGridField(ble, BLE FFs); ListGridField slack = new ListGridField(slack, Slack); dataGrid.setFields(builds,criteria,design,date,slack,lut,lut4,ble); dataGrid.setDataSource(ds); dataGrid.setAutoFetchData(true); System.out.println(designstrings.length); //*** Gives a null pointer error. cmbDesigns.setValueMap(designstrings); //does not set any values since designstrings is null. layout.addMember(searchFields); layout.addMember(dataGrid); layout.draw(); RootPanel.get(content).add(layout); } public void initializeDesignsArray(){ rpc.getDesign(new AsyncCallbackDesign[]() { @Override public void onFailure(Throwable caught) { System.out.println(Design callback failed); } @Override public void onSuccess(Design[] result) { //System.out.println(result.length); String[] designs = new String[result.length]; for(int i=0; idesigns.length; i++){ designs[i] = result[i].design; System.out.println(designs[i]); // Prints the
Re: GWT Code works only in local env and does not work after uploading to App engine
hie anyone on this plz Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com On Thu, Jul 8, 2010 at 1:13 PM, Vik vik@gmail.com wrote: Hie I have a code to launch a gwt popup using a gwt button. This code only works in local eclipse env and does not work after uploading to GAE (i mean popup doesnt show up on GAE). Please advise whats wrong here. I dont see any stack trace or error message anywhere. Here is the code: T*his code actually passes the data to renders a flex table in which one of the column is a button.* @Override public void onSuccess(ListFindBloodDonorResultBean result) { if(result.size() == 0){ CommonUi.showServerMsgPopup(Sorry no blood donor available as per your search criteria.); }else{ FindDonorPublicTable table = new FindDonorPublicTable(); ListString header = Arrays.asList(City,Area, Donors Available, POC Details); FlexTable data = table.setInput(header, result, countryName.getText().toLowerCase(), stateList.getValue(stateList.getSelectedIndex()).toLowerCase(), disttList.getValue(disttList.getSelectedIndex()).toLowerCase()); resultPanel.clear(); resultPanel.add(data); } }}); This code actually renders the flex table having a column with a button. On clicking it the popup should invoke: package vik.sakshum.sakshumweb.client.common.ui; public class FindDonorPublicTable extends FlexTable{ private String country; private String state; private String district; public FindDonorPublicTable() { super(); } PocInfoTable pocInfoTable; private class PocInfoTable extends FlexTable{ public PocInfoTable() { super(); } public void setHeader(ListString header){ int row = 0; if (header != null) { int i = 0; for (String string : header) { this.setText(row, i, string); i++; } row++; } } public void setInput(ListString header, ListPocProfileBean rows) { setHeader(header); int i = 1; for (PocProfileBean row : rows) { this.setText(i, 0, row.getFirstName()); this.setText(i, 1, row.getLastName()); this.setText(i, 2, row.getEmailId()); this.setText(i, 3, row.getCellNumber()); this.setText(i, 4, row.getOfficeNumber()); AddressBean addBean = row.getAddressBean(); this.setText(i, 5, addBean.getPinCode()); this.setText(i, 6, addBean.getCity()); this.setText(i, 7, addBean.getDistrict()); this.setText(i, 8, addBean.getState()); i++; } } }//end class PocInfoTable POCPopup pocPopup; private class POCPopup extends PopupPanel { private final FindBloodDonorServiceAsync findPOCService = GWT .create(FindBloodDonorService.class); public POCPopup(String city, String area) { super(true); this.setTitle(Point of Contact Details); VerticalPanel mainPanel = new VerticalPanel(); mainPanel.setSpacing(10); mainPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); Label titleText = new Label(Point of Contacts); Label infoText = new Label(Please note that below are *not* the actual blood donors. You need to call any of these people to get the information about available blood donors as per your searched criteria. We are not providing the personal information of blood donors to protect the information abuse.); mainPanel.add(titleText); mainPanel.add(infoText); mainPanel.add(pocInfoTable); setWidget(mainPanel); } } public void setHeader(ListString header){ int row = 0; if (header != null) { int i = 0; for (String string : header) { this.setText(row, i, string); i++; } row++; } // Make the table header look nicer this.getRowFormatter().addStyleName(0, sakth); } public FindDonorPublicTable setInput(ListString header, final ListFindBloodDonorResultBean rows, String country, String state, String district) { this.country = country; this.state = state; this.district = district; final FindDonorPublicTable tableHandle= this; setHeader(header); int i = 1; for (FindBloodDonorResultBean row : rows) { this.setText(i, 0, row.getCity()); this.setText(i, 1, row.getArea()); this.setText(i, 2, row.getDonorCount()); Button pocBtn = new Button(Get Point Of Contact); this.setWidget(i, 3, pocBtn); pocBtn.addClickHandler(new ClickHandler(){ @Override public void onClick(ClickEvent event) { pocPopup = new POCPopup(bhiwani,bhiwani); System.out.println(launching poc info pop); pocPopup.show(); }}); this.getCellFormatter().addStyleName(i, 0, sakbodytd); this.getCellFormatter().addStyleName(i, 1, sakbodytd); this.getCellFormatter().addStyleName(i, 2, sakbodytd); this.getCellFormatter().addStyleName(i, 3, sakbodytd); if(i%2 == 0) this.getRowFormatter().addStyleName(i, saktr-even); else this.getRowFormatter().addStyleName(i, saktr-odd); i++; } return this; } } Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this
Re: Does these books still compatible with the new GWT ?
I purchased a GWT book early on, and don't feel I got my money's worth. Using the simple stuff--widget, layouts, making an RPC call-- was already clear on Google's site. The more complex topics, like custom widgets, packaging custom widgets in jars, etc., were either not explained or quickly rendered obsolete by changes to GWT. What I've learned, I've learned by digging through the source, the samples, 3rd party widgets, and asking lots of questions here. On Jul 8, 4:33 am, Rachmat Kukuh R. rku...@gmail.com wrote: I have a plan to buy these books: 1. GWT in Practice [Manning, 2008] 2. Pro Web 2.0 Application Development with GWT (Pro) [Apress. 2008] 3. Beginning Google Web Toolkit [Apress, 2008] But, does those books still compatible with the new GWT ? Thx before! :) -- 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-tool...@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: Using FormPanel to get XML data - workaround?
I think the best you can do is use FormPanel for multipart posts only(file upload) and make all the other request with ajax. 2010/7/8 Robert Hanson iamroberthan...@gmail.com Based on the docs for FormPanel the server has to reply with the content-type of text/html, otherwise there may be issues with some browsers. But if you do that, and send XML content it seems it has browser issues. For example, in FF/DevMode the SubmitCompleteEventHandler returns null for the result. In Chrome is returns the XML content, but it is malformed. Some elements like link / were in the results as link, causing XML parsing issues. One solution I found was to return the XML as an HTML comment, prefixed by some fake content. For example, instead of this: ?xml version='1.0' encoding='UTF-8'?feed.../feed I returned this: content!--?xml version='1.0' encoding='UTF-8'?feed.../feed-- I can then remove the prefix content!-- and postfix -- text, and parse what remains as XML. Other than the fact that I don't handle the possibility of comments within the XML content, is there any other potential issues? Or maybe there is a better way? The only requirement for what I am working on is that it must use a FormPanel submission, and parse the XML returned from the server. Thanks. Rob -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- http://gwtupdates.blogspot.com/ -- 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-tool...@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.
Trigger FileUpload
Hi. I have a FileUpload widget and I was wondering if I can fire it's click event ( showing the browser select file dialog box ) trough the click of another widget like a Anchor or Button. Can I do that? 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-tool...@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: Trigger FileUpload
There are some hacks for input custom style, I am not sure if there's a simple way to do it in gwt. Checkout this one http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom 2010/7/8 Thiago Miranda de Oliveira thiago...@gmail.com Hi. I have a FileUpload widget and I was wondering if I can fire it's click event ( showing the browser select file dialog box ) trough the click of another widget like a Anchor or Button. Can I do that? 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- http://gwtupdates.blogspot.com/ -- 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-tool...@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 2.0.4 caused Class Not Found, TransformerFactoryImpl
I've traced through the Restlet 2.0rc4 code for both the success case (no GWT) and the failure case (gwt-dev.jar in on classpath). The issue is how DomRepresentation.createTransformer() creates the necessary javax.xml.transform.TransformerFactory instance. In the success case, we end up in FractoryFinder.findJarService() at the line 255, is = ss.getResourceAsStream(cl, serviceId); and the result is null. Therefore, the code returns and uses the fallback class (com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl), which works. In the failure case (when gwt-dev.jar in on the classpath), line 255 DOES return a class, the code that immediately follows is then able to read the factoryClassName from the class, which ends up being, org.apache.xalan.processor.TransformerFactoryImpl. Later, the attempt to instantiate this class fails with a ClassNotFoundException. So it seems that the gwt-dev.jar file contains some configuration that tricks Restlet into attempting to instantiate the wrong TransformerFactory implementation. How would I go about making Restlet ignore this Jar. Note that this is only an issue in the development environment, because gwt-dev.jar is not copied to the production server. However, it's still a show stopper bug for me, because I can't debug my client application with my rest services. Does anyone on the GWT team know that this may be about? Any help would be welcome. I will pass it on to the Restlet team. Thanks. On Jul 7, 10:01 am, emurmur emur...@conceptuamath.com wrote: I have an Java App Engine project using SDK 1.3.5 and the latest Restlet GAE 2.0rc4 to implement some restful services. Everything worked well (this has been in production for 6 months) until I added GWT 2.0.4 to the project. As soon as I check use GWT on in the control panel in Eclipse (without even adding a module) my services start to fail in the development server with the following class not found exception: Couldn't write the XML representation: Provider org.apache.xalan.processor.TransformerFactoryImpl not found This exception happens on the way out of my Restlet, after a GET of a lists of entities, as it tries to turn my DomRepresentation into the response payload. I've found that if I remove the gwt-dev.jar, the exception does not happen. Of course, I can't use the development server if I do that. Again, this all works fine without GWT. Here is the relevant parts of the trace: SEVERE: An exception occured writing the response entity java.io.IOException: Couldn't write the XML representation: Provider org.apache.xalan.processor.TransformerFactoryImpl not found at org.restlet.ext.xml.DomRepresentation.write(DomRepresentation.java: 287) at org.restlet.representation.WriterRepresentation.write(WriterRepresentation. java: 104) at org.restlet.engine.http.ServerCall.writeResponseBody(ServerCall.java: 502) at org.restlet.engine.http.ServerCall.sendResponse(ServerCall.java: 439) at org.restlet.ext.servlet.internal.ServletCall.sendResponse(ServletCall.java: 451) at org.restlet.engine.http.adapter.ServerAdapter.commit(ServerAdapter.java: 198) at org.restlet.engine.http.HttpServerHelper.handle(HttpServerHelper.java: 151) at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1037) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.jav a:1166) at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFi lter. java:51) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.jav a:1157) at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans actio nCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.jav a:1157) at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFile Filte r.java:122) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.jav a:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 418) at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEn gineW ebAppContext.java:70) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 152) at
Re: Shared CSS
Assuming the GUI library you mentioned is a GWT module, the easiest thing to do is to reference the CSS file from the module definition file: stylesheet src=Library.css/ Then make sure that Library.css is in a package named public next to the module definition file. The CSS will then be automatically loaded when the module is loaded on the host page. Just be careful with your selectors, since they will be global to the page. This method is best for .gwt-* styles. If you don't need the styles on the host page outside of where the application lives, you should consider using ClientBundle and CssResource instead: http://code.google.com/webtoolkit/doc/latest/DevGuideUiBinder.html#Using_an_external_resource That will obfuscate (and optimize) your class selectors so they don't collide with anything on the host page. You also get programmatic access to the obfuscated class names so you can dynamically apply the styles. Based on your description, this would probably be the best approach in your case. -Brian On Jul 7, 12:27 pm, Hethcox heth...@gmail.com wrote: Hello, I have a GUI library that is used by several GWT apps. I would like the widgets in the library to use a standard sets of CSS classes from the library so that they don't have to be copied and maintained in the apps that use the library. The library is deployed as a jar currently, but that can change. I've read a lot of posts on this topic, but none of them seems to do the trick. My target platform is JBoss and the closest solution I've found so far is to put the library CSS file in ROOT.war/css at deploy- time. Is there a build-time trick to get the GWT apps to deploy the CSS file when it cross-compiles the library widgets? Cheers, John -- 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-tool...@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: Trigger FileUpload
Thanks Gal but I've used a old solution ( I didn't want to use it but it was the only way). I get the Button/Anchor absolute Top and Left and use this on the input type file that has a opacity:0. That way the Button/Anchor is on top of the input and them every click on it will trigger the click on the input file. On Jul 8, 3:34 pm, Gal Dolber gal.dol...@gmail.com wrote: There are some hacks for input custom style, I am not sure if there's a simple way to do it in gwt. Checkout this onehttp://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with... 2010/7/8 Thiago Miranda de Oliveira thiago...@gmail.com Hi. I have a FileUpload widget and I was wondering if I can fire it's click event ( showing the browser select file dialog box ) trough the click of another widget like a Anchor or Button. Can I do that? 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs cr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. --http://gwtupdates.blogspot.com/ -- 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-tool...@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: Image setUrl and setResources IE8 JavaScriptException
Dear group, if nobody has encountered this problem before, could you point me to resources how to start debugging in this case best? The exception is thrown somewhere in the JavaScript code and I am not familiar with JavaScript debugging. Thank you, Sven On 4 Jul., 17:41, Sven sven.ti...@googlemail.com wrote: Dear group, I created a small GWT test project with just one component on the start page. This component contains an image. Into this image, I load two different GIF images, both 600x340 pixels large, no alpha channel. To load one specific gif to the image, I can click on four buttons: Button 1 loads image A by setUrl() into the image. Button 2 loads image B by setUrl() into the image. Button 3 loads image A by setResource() into the image. Button 4 loads image B by setResource() into the image. The two images served by URL are in a subfolder of the war folder, the two copies loaded as ImageResource are served as ClientBundle. In Firefox 3.6 and Safari 5, both methods work fine. In IE 8, aJavaScriptException(Invalid Argument, number: -2147024809) is thrown when loading image B by hitting button 4. Also, no image is shown (image switches to white/blank). After switching IE 8 to compatibility mode, the page works fine again and button 4 operates like in other browsers. It seems that while using setResource() in IE 8 works in principle (image A is loaded by button 3), it fails with my specific GIF. Also, IE 8 is able to render the image (image B is loaded by button 2). Image B, which fails loading, can be accessed throughhttp://www.dotvoting.org/images/DotVoteResult.gif For image A, I used a GIF of same dimension drawn from scratch. Does anybody has an idea what is wrong with image A and what is causing the exception? Thanks Sven -- 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-tool...@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: Using FormPanel to get XML data - workaround?
A technique I've used--though it requires two trips to the server--is for the form processing servlet to create a temporary file of the XML and store it in a session attribute. Let the servlet return ok or some such short notice (write the exception if the servlet errors; this gives you something to test). In the form's addSubmitCompleteHandler, check the getResult() from the FormPanel.SubmitCompleteEvent. If it's ok (or starts with ok), make an RPC service call that recovers the temporary file, reads its contents to a string, deletes the temporary file, and returns the string. On Jul 8, 12:53 pm, Robert Hanson iamroberthan...@gmail.com wrote: Based on the docs for FormPanel the server has to reply with the content-type of text/html, otherwise there may be issues with some browsers. But if you do that, and send XML content it seems it has browser issues. For example, in FF/DevMode the SubmitCompleteEventHandler returns null for the result. In Chrome is returns the XML content, but it is malformed. Some elements like link / were in the results as link, causing XML parsing issues. One solution I found was to return the XML as an HTML comment, prefixed by some fake content. For example, instead of this: ?xml version='1.0' encoding='UTF-8'?feed.../feed I returned this: content!--?xml version='1.0' encoding='UTF-8'?feed.../feed-- I can then remove the prefix content!-- and postfix -- text, and parse what remains as XML. Other than the fact that I don't handle the possibility of comments within the XML content, is there any other potential issues? Or maybe there is a better way? The only requirement for what I am working on is that it must use a FormPanel submission, and parse the XML returned from the server. Thanks. Rob -- 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-tool...@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: Using FormPanel to get XML data - workaround?
On 8 juil, 18:53, Robert Hanson iamroberthan...@gmail.com wrote: Based on the docs for FormPanel the server has to reply with the content-type of text/html, otherwise there may be issues with some browsers. But if you do that, and send XML content it seems it has browser issues. For example, in FF/DevMode the SubmitCompleteEventHandler returns null for the result. In Chrome is returns the XML content, but it is malformed. Some elements like link / were in the results as link, causing XML parsing issues. One solution I found was to return the XML as an HTML comment, prefixed by some fake content. For example, instead of this: ?xml version='1.0' encoding='UTF-8'?feed.../feed I returned this: content!--?xml version='1.0' encoding='UTF-8'?feed.../feed-- I can then remove the prefix content!-- and postfix -- text, and parse what remains as XML. Other than the fact that I don't handle the possibility of comments within the XML content, is there any other potential issues? Or maybe there is a better way? The only requirement for what I am working on is that it must use a FormPanel submission, and parse the XML returned from the server. I would HTML-escape the XML (lt;feed...lt;/feed, you don't actually want the ?xml? decl) on the server-side, and use a setInnerHTML/getInnerText on an element to unescape it on the client- side. public void onSubmitComplete(SubmitCompleteEvent event) { String escapedXML = event.getResult(); DivElement div = Document.get().createDivElement(); div.setInnerHTML(escapedXML); String xml = div.getInnerText(); // now you can use XMLParser } The other option of course is to send enough information so you can get the XML from another request (RequestBuilder or GWT-RPC). -- 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-tool...@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 2.1 M1 Data Presentation Widgets tutorial?
There is also the Expenses example which in GWT 2.1M2 has been separated from the rest (Places, Activities, Presentation Widgets). http://code.google.com/p/google-web-toolkit/source/browse/#svn/trunk/bikeshed/src/com/google/gwt/sample/expenses I just started putting together some tutorial myself (see http://groups.google.com/group/google-web-toolkit/browse_thread/thread/1198611b35a7d074). I hope I'll be able to get to Presentation Widgets soon. They're not going to be Roo-centric. On Jul 8, 6:49 pm, Paul Stockley pstockl...@gmail.com wrote: Check out the Cookbook sample: http://google-web-toolkit.googlecode.com/svn/branches/2.1M2/bikeshed/... I also posted a small example earlier http://groups.google.com/group/google-web-toolkit/browse_thread/threa... On Jul 8, 11:52 am, Blessed Geek blessedg...@gmail.com wrote: Yes, me too. But I wish to have examples WITHOUT spring roo involved please!!! -- 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-tool...@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: Shared CSS
There are many possible solutions for the generic problem you face. You will need to be more specific about your final deployment architecture if you would like a more specific answer of which is best. Are these GWT apps all going to be deployed within the same WAR? EAR? Separate EARs? Is the only thing referencing these classes GWT objects, or do the class names need to remain unobfuscated? If you are willing to go through using a CssResource and obfuscating the class names I would suggest creating a common module and inherit the module whenever you need to use the classes. In the entry point for the common module you would inject the style. If the css must remain unobfuscated, it depends on your final deployment. If they are in different WARs, then I would again create a common module, but add a public path to the module so that if you inherit the module it will write the script to it: module inherits name=com.google.gwt.user.User / source path=client/ public path=www/ stylesheet src=Library.css/ entry-point class=com.ams.common.client.gwt.client.CommonEntryPoint/ /module Put the file Library.css into com/ams/common/client/gwt/www If they are all in 1 WAR, the best method would be to manually copy the file to the WAR root and add the link to your html files. On Jul 7, 10:27 am, Hethcox heth...@gmail.com wrote: Hello, I have a GUI library that is used by several GWT apps. I would like the widgets in the library to use a standard sets of CSS classes from the library so that they don't have to be copied and maintained in the apps that use the library. The library is deployed as a jar currently, but that can change. I've read a lot of posts on this topic, but none of them seems to do the trick. My target platform is JBoss and the closest solution I've found so far is to put the library CSS file in ROOT.war/css at deploy- time. Is there a build-time trick to get the GWT apps to deploy the CSS file when it cross-compiles the library widgets? Cheers, John -- 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-tool...@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.
Timer triggered every second instead of every second
Why does the timer below get triggered every second, popping up the alert and crashing the browser? I expect it to be triggered every 10 seconds: public class AlertEntryPoint implements EntryPoint { MapInteger, ListAlertDTO alertGroupByTypeDTOs = new TreeMapInteger, ListAlertDTO(); List locationsInfoDTOList = new ArrayListLocationsInfoDTO(); static class AlertTimer extends Timer { AlertEntryPoint entryPoint = null; public AlertTimer(AlertEntryPoint alertEntryPoint) { entryPoint = alertEntryPoint; } boolean stop; @Override public void run() { while (!stop) { schedule(1000 * 10); entryPoint.refreshData(); Window.alert(Somebody started me); } } } @Override public void onModuleLoad() { //refreshData(); AlertEntryPoint.AlertTimer timer = new AlertTimer(this); timer.run(); } . . . -- 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-tool...@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: adding packages to gwt app
I don't quite understand your question, by client-side application i understand either a Javascript only app or a J2SE app, but as i understand it, i think you need to inherit in the gwt module. Only client side code get's compiled into javascript, so look at your code and see what goes in the client (which code you want converted to Javascript). Which are gonna be traveling back and forth? mark Serializable. What do your existing packages contain? server-side or client-side code? I'm sorry i can't be of more help. On Jul 7, 7:19 pm, gwtNewBee chintalnde...@gmail.com wrote: Hi Everyone, I am new to GWT. I am trying to convert a java client side application to client-server web application. I have created a gwt project, and now I need an access to my old java project. How do I access packages from another project? I mean how do I add my own packages to gwt app? Thanks in advance. GWT Learner -- 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-tool...@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: Timer triggered every second instead of every second
Are you sure this is what you want? while(!stop) { // without the alert all this stuff happens bazillion times each second schedule(1000*10); entryPoint.refreshData(); } I'm not sure whether Timer likes to get scheduled again before it reached its first timeout. Also it looks like you might be interested in Timer.scheduleRepeating() and Timer.cancel(); On Fri, Jul 9, 2010 at 12:52 AM, ccg123 tks...@gmail.com wrote: Why does the timer below get triggered every second, popping up the alert and crashing the browser? I expect it to be triggered every 10 seconds: public class AlertEntryPoint implements EntryPoint { MapInteger, ListAlertDTO alertGroupByTypeDTOs = new TreeMapInteger, ListAlertDTO(); List locationsInfoDTOList = new ArrayListLocationsInfoDTO(); static class AlertTimer extends Timer { AlertEntryPoint entryPoint = null; public AlertTimer(AlertEntryPoint alertEntryPoint) { entryPoint = alertEntryPoint; } boolean stop; @Override public void run() { while (!stop) { schedule(1000 * 10); entryPoint.refreshData(); Window.alert(Somebody started me); } } } @Override public void onModuleLoad() { //refreshData(); AlertEntryPoint.AlertTimer timer = new AlertTimer(this); timer.run(); } . . . -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@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: Timer triggered every second instead of every second
Thank you. I changed it and now it occurs every 5 secs as expected. I have a question concerning calling this inner class from another component. So now the inner class looks like this: . . . static class AlertTimer extends Timer { AlertEntryPoint entryPoint = null; public AlertTimer(AlertEntryPoint alertEntryPoint) { entryPoint = alertEntryPoint; } @Override public void run() { scheduleRepeating(1000 * 5); entryPoint.refreshData(); } } @Override public void onModuleLoad() { AlertEntryPoint.AlertTimer timer = new AlertTimer(this); timer.run(); } . . . And from another component I want to cancel the scheduler. How do I get a handle on the instance of AlertTimer in the code below? public class ImageButton extends PushButton { . . . public ImageButton(Image image) { super(image); } void addDialogBox(Map data, int groupType){ listener = new ClickListener() { public void onClick(Widget sender) { dialogbox.hide(); //start the timer again - how do i get the instance of AlertTimer? ?? } }; On Jul 8, 4:24 pm, Jaroslav Záruba jaroslav.zar...@gmail.com wrote: Are you sure this is what you want? while(!stop) { // without the alert all this stuff happens bazillion times each second schedule(1000*10); entryPoint.refreshData(); } I'm not sure whether Timer likes to get scheduled again before it reached its first timeout. Also it looks like you might be interested in Timer.scheduleRepeating() and Timer.cancel(); On Fri, Jul 9, 2010 at 12:52 AM, ccg123 tks...@gmail.com wrote: Why does the timer below get triggered every second, popping up the alert and crashing the browser? I expect it to be triggered every 10 seconds: public class AlertEntryPoint implements EntryPoint { MapInteger, ListAlertDTO alertGroupByTypeDTOs = new TreeMapInteger, ListAlertDTO(); List locationsInfoDTOList = new ArrayListLocationsInfoDTO(); static class AlertTimer extends Timer { AlertEntryPoint entryPoint = null; public AlertTimer(AlertEntryPoint alertEntryPoint) { entryPoint = alertEntryPoint; } boolean stop; �...@override public void run() { while (!stop) { schedule(1000 * 10); entryPoint.refreshData(); Window.alert(Somebody started me); } } } �...@override public void onModuleLoad() { //refreshData(); AlertEntryPoint.AlertTimer timer = new AlertTimer(this); timer.run(); } . . . -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@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: Timer triggered every second instead of every second
The method run() is what gets called when your timer elapses/fires. For repeating timers this means that it gets fired repeatedly, and your timer gets scheduled repeatedly repeatedly. (Yes I wrote it twice.) This is what it should look like: new Timer() { @Override public void run() { // this gets fired once per 5000ms // you can make static method to access instance of your module, // this way you don't need to write another class for your timer MyEntryPoint.getInstance().refreshData(); // maybe there is some more elegant way to access this module, // I'm still in the learning process too :) } }.scheduleRepeating(5000); On Fri, Jul 9, 2010 at 2:30 AM, ccg123 tks...@gmail.com wrote: Thank you. I changed it and now it occurs every 5 secs as expected. I have a question concerning calling this inner class from another component. So now the inner class looks like this: . . . static class AlertTimer extends Timer { AlertEntryPoint entryPoint = null; public AlertTimer(AlertEntryPoint alertEntryPoint) { entryPoint = alertEntryPoint; } @Override public void run() { scheduleRepeating(1000 * 5); entryPoint.refreshData(); } } @Override public void onModuleLoad() { AlertEntryPoint.AlertTimer timer = new AlertTimer(this); timer.run(); } . . . And from another component I want to cancel the scheduler. How do I get a handle on the instance of AlertTimer in the code below? Just like in regular Java - by passing stuff in parameters, or by making the timer static member of some class. public class ImageButton extends PushButton { . . . public ImageButton(Image image) { super(image); } void addDialogBox(Map data, int groupType){ listener = new ClickListener() { public void onClick(Widget sender) { dialogbox.hide(); //start the timer again - how do i get the instance of AlertTimer? ?? } }; On Jul 8, 4:24 pm, Jaroslav Záruba jaroslav.zar...@gmail.com wrote: Are you sure this is what you want? while(!stop) { // without the alert all this stuff happens bazillion times each second schedule(1000*10); entryPoint.refreshData(); } I'm not sure whether Timer likes to get scheduled again before it reached its first timeout. Also it looks like you might be interested in Timer.scheduleRepeating() and Timer.cancel(); On Fri, Jul 9, 2010 at 12:52 AM, ccg123 tks...@gmail.com wrote: Why does the timer below get triggered every second, popping up the alert and crashing the browser? I expect it to be triggered every 10 seconds: public class AlertEntryPoint implements EntryPoint { MapInteger, ListAlertDTO alertGroupByTypeDTOs = new TreeMapInteger, ListAlertDTO(); List locationsInfoDTOList = new ArrayListLocationsInfoDTO(); static class AlertTimer extends Timer { AlertEntryPoint entryPoint = null; public AlertTimer(AlertEntryPoint alertEntryPoint) { entryPoint = alertEntryPoint; } boolean stop; @Override public void run() { while (!stop) { schedule(1000 * 10); entryPoint.refreshData(); Window.alert(Somebody started me); } } } @Override public void onModuleLoad() { //refreshData(); AlertEntryPoint.AlertTimer timer = new AlertTimer(this); timer.run(); } . . . -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com google-web-toolkit%2bunsubscr...@googlegroups.comgoogle-web-toolkit%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to
Re: Using FormPanel to get XML data - workaround?
Awesome, thanks everyone for the ideas. Rob On Thu, Jul 8, 2010 at 5:22 PM, Thomas Broyer t.bro...@gmail.com wrote: On 8 juil, 18:53, Robert Hanson iamroberthan...@gmail.com wrote: Based on the docs for FormPanel the server has to reply with the content-type of text/html, otherwise there may be issues with some browsers. But if you do that, and send XML content it seems it has browser issues. For example, in FF/DevMode the SubmitCompleteEventHandler returns null for the result. In Chrome is returns the XML content, but it is malformed. Some elements like link / were in the results as link, causing XML parsing issues. One solution I found was to return the XML as an HTML comment, prefixed by some fake content. For example, instead of this: ?xml version='1.0' encoding='UTF-8'?feed.../feed I returned this: content!--?xml version='1.0' encoding='UTF-8'?feed.../feed-- I can then remove the prefix content!-- and postfix -- text, and parse what remains as XML. Other than the fact that I don't handle the possibility of comments within the XML content, is there any other potential issues? Or maybe there is a better way? The only requirement for what I am working on is that it must use a FormPanel submission, and parse the XML returned from the server. I would HTML-escape the XML (lt;feed...lt;/feed, you don't actually want the ?xml? decl) on the server-side, and use a setInnerHTML/getInnerText on an element to unescape it on the client- side. public void onSubmitComplete(SubmitCompleteEvent event) { String escapedXML = event.getResult(); DivElement div = Document.get().createDivElement(); div.setInnerHTML(escapedXML); String xml = div.getInnerText(); // now you can use XMLParser } The other option of course is to send enough information so you can get the XML from another request (RequestBuilder or GWT-RPC). -- 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-tool...@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: adding packages to gwt app
There are two ways: GWT RPC GWT FormPanel JSONP Did I say two ways? So, it's actually three ways. Or more. If your content server is the same as your web app server, you should consider converting to using GWT RPC. if your current app's client-server communications is mostly with html forms, you should consider converting the forms to GWT FormPanel, and then gradually evolve your application towards GWT RPC. If your content needs to communicate with another server (other than its own), you need to consider using JSONP. I am presuming you are using Eclipse with the google plugin. If you are not using Eclipse ... I don't see why any programmer would want to unnecessarily torture himself/herself by taking up the challenge of not using Ecipse with google plugin. The structure of a GWT module directory is normally: module-dir/ - client folder - server folder - public folder - module's gwt.xml file The public folder is for placing all your static files which the GWT compiler would copy to the module folder in the war directory - put your current JSP files here. Modify all your url references to conform to the new url of these JSPs. Use the module rename-to attribute to shorten the module's public url. The client folder is where your GWT source files should be. The server folder is where you place your server-side Java source - normally used to place RPC servlets. For your other servlets, you could simply create the same package namespace your current servlets and classes uses and place those package hierarchy next to your GWT source tree. What you could do is create a non-Google (non-GWT non-GAE) project in Eclipse to house your current project. Then at project properties- Google in Ecipse, turn on GWT and your project would automagically be converted into a GWT project. Make sure. again, that google plugin is installed first. If you are not using GAE, ensure GAE option is turned off. GAE and GWT options sit next to each other in the Google menu item in project properties in Eclipse. You should try out a GWT RPC example first. For JSONP - read http://code.google.com/webtoolkit/articles/using_gwt_for_json_mashups.html. And, of course, you need to do some reading. -- 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-tool...@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: adding packages to gwt app
You might also wish to consider if vaadin fits your strategy. vaadin.com. You should certainly try out vaadin. -- 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-tool...@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: FlexTables - store invisible database key in row?
Hi Thad, maybe it's because you does not set the width of your table. I do so, and I also set the widths of my columns. However, I found a cool solution that fits perfectly for me and that does not use an extra column for the index at all! I simply store the index as an attribute in the DOM: tbl.getFlexCellFormatter ().getElement (y,0).setAttribute (idx,+idx); // y is the current row, idx is the database index (BTW: is there a better way to convert an int to String than +idx?) Magnus -- 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-tool...@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: Shared CSS
Thanks for all the great suggestions. The shared library has a gwt.xml file but is not an EntryPoint. Can I just pick a class in the library and have it implement EntryPoint to get the shared CSS loaded? To answer the other follow-up questions, I am deploying each app as a separate war file. All of the styles are set through code, so the class names can be obfuscated. John On Jul 8, 6:25 pm, lineman78 linema...@gmail.com wrote: There are many possible solutions for the generic problem you face. You will need to be more specific about your final deployment architecture if you would like a more specific answer of which is best. Are these GWT apps all going to be deployed within the same WAR? EAR? Separate EARs? Is the only thing referencing these classes GWT objects, or do the class names need to remain unobfuscated? If you are willing to go through using a CssResource and obfuscating the class names I would suggest creating a common module and inherit the module whenever you need to use the classes. In the entry point for the common module you would inject the style. If the css must remain unobfuscated, it depends on your final deployment. If they are in different WARs, then I would again create a common module, but add a public path to the module so that if you inherit the module it will write the script to it: module inherits name=com.google.gwt.user.User / source path=client/ public path=www/ stylesheet src=Library.css/ entry-point class=com.ams.common.client.gwt.client.CommonEntryPoint/ /module Put the file Library.css into com/ams/common/client/gwt/www If they are all in 1 WAR, the best method would be to manually copy the file to the WAR root and add the link to your html files. On Jul 7, 10:27 am, Hethcox heth...@gmail.com wrote: Hello, I have a GUI library that is used by several GWT apps. I would like the widgets in the library to use a standard sets of CSS classes from the library so that they don't have to be copied and maintained in the apps that use the library. The library is deployed as a jar currently, but that can change. I've read a lot of posts on this topic, but none of them seems to do the trick. My target platform is JBoss and the closest solution I've found so far is to put the library CSS file in ROOT.war/css at deploy- time. Is there a build-time trick to get the GWT apps to deploy the CSS file when it cross-compiles the library widgets? Cheers, John -- 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-tool...@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: Make a Banner rotator whit ClientBundle or Java Script Nativ, what do you recomended?
Hello Stefan, really I do not like having to recompile the entire project every time I upload an image. So you who would you recommend? Currently being tested, http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.2.72.js but not the behavior I'm looking it up a bunch of images and rotate infinitely fiala left to right. If anyone knows anything would be very grateful. Jero. -- 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-tool...@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.
Is
I need this because i have the presenter widget that contains icons and text html. I need to modify the contents of the icons and text but everything is a hyperlink. That is, clicking on any part of my widget is a hyperlink presenter. The only solution we found so far is make the whole widget image and the image is a hyperlink (http://blog.js- development.com/2010/02/gwt-hyperlink-widget-with-image.html) . But it is very hard every time you need to change an icon or text to modify the image. Thanks Very muyh! Greetins! Jero. -- 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-tool...@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: The all content the panel as the same hyperlink, is it possible?
I need this because i have the panel container that contains icons and text html. I need to modify the contents of the icons and text but everything is a hyperlink. That is, clicking on any part of my panel is a hyperlink. But it is very hard every time you need to change an icon or text to modify the image. Thanks Very muyh! Greetins! Jero. -- 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-tool...@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 Code works only in local env and does not work after uploading to App engine
hie please advise on this... its blocking us... Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com On Thu, Jul 8, 2010 at 1:13 PM, Vik vik@gmail.com wrote: Hie I have a code to launch a gwt popup using a gwt button. This code only works in local eclipse env and does not work after uploading to GAE (i mean popup doesnt show up on GAE). Please advise whats wrong here. I dont see any stack trace or error message anywhere. Here is the code: T*his code actually passes the data to renders a flex table in which one of the column is a button.* @Override public void onSuccess(ListFindBloodDonorResultBean result) { if(result.size() == 0){ CommonUi.showServerMsgPopup(Sorry no blood donor available as per your search criteria.); }else{ FindDonorPublicTable table = new FindDonorPublicTable(); ListString header = Arrays.asList(City,Area, Donors Available, POC Details); FlexTable data = table.setInput(header, result, countryName.getText().toLowerCase(), stateList.getValue(stateList.getSelectedIndex()).toLowerCase(), disttList.getValue(disttList.getSelectedIndex()).toLowerCase()); resultPanel.clear(); resultPanel.add(data); } }}); This code actually renders the flex table having a column with a button. On clicking it the popup should invoke: package vik.sakshum.sakshumweb.client.common.ui; public class FindDonorPublicTable extends FlexTable{ private String country; private String state; private String district; public FindDonorPublicTable() { super(); } PocInfoTable pocInfoTable; private class PocInfoTable extends FlexTable{ public PocInfoTable() { super(); } public void setHeader(ListString header){ int row = 0; if (header != null) { int i = 0; for (String string : header) { this.setText(row, i, string); i++; } row++; } } public void setInput(ListString header, ListPocProfileBean rows) { setHeader(header); int i = 1; for (PocProfileBean row : rows) { this.setText(i, 0, row.getFirstName()); this.setText(i, 1, row.getLastName()); this.setText(i, 2, row.getEmailId()); this.setText(i, 3, row.getCellNumber()); this.setText(i, 4, row.getOfficeNumber()); AddressBean addBean = row.getAddressBean(); this.setText(i, 5, addBean.getPinCode()); this.setText(i, 6, addBean.getCity()); this.setText(i, 7, addBean.getDistrict()); this.setText(i, 8, addBean.getState()); i++; } } }//end class PocInfoTable POCPopup pocPopup; private class POCPopup extends PopupPanel { private final FindBloodDonorServiceAsync findPOCService = GWT .create(FindBloodDonorService.class); public POCPopup(String city, String area) { super(true); this.setTitle(Point of Contact Details); VerticalPanel mainPanel = new VerticalPanel(); mainPanel.setSpacing(10); mainPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); Label titleText = new Label(Point of Contacts); Label infoText = new Label(Please note that below are *not* the actual blood donors. You need to call any of these people to get the information about available blood donors as per your searched criteria. We are not providing the personal information of blood donors to protect the information abuse.); mainPanel.add(titleText); mainPanel.add(infoText); mainPanel.add(pocInfoTable); setWidget(mainPanel); } } public void setHeader(ListString header){ int row = 0; if (header != null) { int i = 0; for (String string : header) { this.setText(row, i, string); i++; } row++; } // Make the table header look nicer this.getRowFormatter().addStyleName(0, sakth); } public FindDonorPublicTable setInput(ListString header, final ListFindBloodDonorResultBean rows, String country, String state, String district) { this.country = country; this.state = state; this.district = district; final FindDonorPublicTable tableHandle= this; setHeader(header); int i = 1; for (FindBloodDonorResultBean row : rows) { this.setText(i, 0, row.getCity()); this.setText(i, 1, row.getArea()); this.setText(i, 2, row.getDonorCount()); Button pocBtn = new Button(Get Point Of Contact); this.setWidget(i, 3, pocBtn); pocBtn.addClickHandler(new ClickHandler(){ @Override public void onClick(ClickEvent event) { pocPopup = new POCPopup(bhiwani,bhiwani); System.out.println(launching poc info pop); pocPopup.show(); }}); this.getCellFormatter().addStyleName(i, 0, sakbodytd); this.getCellFormatter().addStyleName(i, 1, sakbodytd); this.getCellFormatter().addStyleName(i, 2, sakbodytd); this.getCellFormatter().addStyleName(i, 3, sakbodytd); if(i%2 == 0) this.getRowFormatter().addStyleName(i, saktr-even); else this.getRowFormatter().addStyleName(i, saktr-odd); i++; } return this; } } Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com -- You received this message because you are subscribed to the Google Groups Google Web Toolkit
Re: Callback working but variable not initialized??
Thank you very much!! I got it working. What I'm not understanding though is, why the DataSource ds doesn't have any problem with being handled outside of the callback. I would greatly appreciate it if you could explain this to me.. Thanks!! P.S I used to have do the exact same with the dataString using another class to call the RPC and assigning it to a class variable similar to here and then instantiating the class in the EntryPoint class exactly as i have done for the DataSource. DataSource works but not designStrings. Thank you in advance :) On Jul 8, 10:34 pm, Sean slough...@gmail.com wrote: You're running into an async problem. The call back happens asynchronusly, meaning, just because you kick off the RPC service does not mean that designStrings will have a value in it before you execute the code after you kick off the RPC. Get rid of anything that uses designStrings outside of the callback or loadDesigns. Looking over your code quickly, what you want to do is in loadDesign, iterate through result and put it into your Combo Box. On Jul 8, 3:31 am, npradeeptha nipuna.ro...@gmail.com wrote: Heres my code.. I'm using GWT 2.0.3 with smartGWT 2.2. I think this is a GWT related question.. [CODE] /** * */ package org.gwt.venus.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.RootPanel; /** * @author npradeeptha * */ import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.DateRange; import com.smartgwt.client.data.RelativeDate; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.ComboBoxItem; import com.smartgwt.client.widgets.form.fields.DateRangeItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; public class VenusData implements EntryPoint { /* (non-Javadoc) * @see com.google.gwt.core.client.EntryPoint#onModuleLoad() */ VenusDataSource vds = new VenusDataSource(); private RpcCallServiceAsync rpc = RpcInit.initRpc(); String[] designstrings = null; @Override public void onModuleLoad() { // TODO Auto-generated method stub initializeDesignsArray(); DataSource ds = vds.getDs(); VLayout layout = new VLayout(8); HLayout searchFields = new HLayout(); searchFields.setBackgroundColor(Cyan); DynamicForm searchForm = new DynamicForm(); ComboBoxItem cmbDesigns = new ComboBoxItem(cmbDesigns, Design); ComboBoxItem cmbCriteria = new ComboBoxItem(cmbCriteria, Criteria); cmbDesigns.setWidth(*); cmbCriteria.setWidth(*); cmbDesigns.setType(comboBox); //cmbDesigns.setValueMap(designstrings); cmbCriteria.setValueMap(FAST,HARSHA_FAST,NIJ_1); // Inline FilterEditor Example (MiniDateRangeItem) final DateRangeItem rangeItem = new DateRangeItem(Date); rangeItem.setWidth(*); rangeItem.setShowTitle(false); rangeItem.setAllowRelativeDates(true); DateRange dateRange = new DateRange(); dateRange.setRelativeStartDate(new RelativeDate(m)); dateRange.setRelativeEndDate(new RelativeDate(m)); rangeItem.setValue(dateRange); searchForm.setNumCols(6); searchForm.setFields(cmbDesigns,cmbCriteria, rangeItem); searchFields.addMember(searchForm); // Create a ListGrid displaying data from the worldDS and also displaying a FilterEditor final ListGrid dataGrid = new ListGrid(); dataGrid.setWidth(655); dataGrid.setHeight(240); searchFields.setWidth(650); ListGridField builds = new ListGridField(build, Build); builds.setWidth(130); ListGridField criteria = new ListGridField(criteria, Criteria); ListGridField design = new ListGridField(design, Design); ListGridField lut = new ListGridField(lut, LUT); ListGridField date = new ListGridField(date, Date); ListGridField lut4 = new ListGridField(lut4, Eq LUT4); ListGridField ble = new ListGridField(ble, BLE FFs); ListGridField slack = new ListGridField(slack, Slack); dataGrid.setFields(builds,criteria,design,date,slack,lut,lut4,ble); dataGrid.setDataSource(ds); dataGrid.setAutoFetchData(true); System.out.println(designstrings.length); //*** Gives a null pointer error. cmbDesigns.setValueMap(designstrings); //does not set any values since designstrings is null. layout.addMember(searchFields); layout.addMember(dataGrid); layout.draw(); RootPanel.get(content).add(layout); } public void initializeDesignsArray(){ rpc.getDesign(new
Re: difference in alignment on different browsers
hie thanks looks helpful... The firebug shows following layout td align=center fieldset table clogroup/colgroup tbody . . . and so on /tbody in firebug i add align=left to tbody then it fixes the issue. However, in css if add following it doesn't work: fieldset table tbody { align: left; } any advise plz Thankx and Regards Vik Founder www.sakshum.com www.sakshum.blogspot.com On Thu, Jul 8, 2010 at 9:40 PM, lineman78 linema...@gmail.com wrote: IE seems to be inheriting the align=center from the parent td. the simple way is to add align=left on the form table, but you could add it to each cell individually using the cell formatter. Depending on the GWT panels you are using there are multiple different ways to solve this. Essentially the difference is inheritance in IE vs Gecko/ Webkit. On Jul 8, 9:43 am, Vik vik@gmail.com wrote: Hie Check out pleasehttp:// 1.latest.sakshumweb20.appspot.com/ui/page/DonorRegister.jsp and notice the alignment of fields in IE Vs chrome/firefox The one coming in chrome or firefox is the desired one. So how to fix it for IE? And I thought i dont need to take care cross browser stuff using gwt Thankx and Regards Vik Founderwww.sakshum.comwww.sakshum.blogspot.com -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@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-contrib] Re: Allow RPC for unmodificable collections (issue620805)
http://gwt-code-reviews.appspot.com/620805/diff/1/2 File user/src/com/google/gwt/user/client/rpc/core/java/util/Collections.java (right): http://gwt-code-reviews.appspot.com/620805/diff/1/2#newcode135 user/src/com/google/gwt/user/client/rpc/core/java/util/Collections.java:135: /** In practice it works fine with Sun's JDK and I expect it would work with a Harmony-based classlib as well -- they and GWT are all using compatible type definitions for singleton and unmodifiable collections. I would be somewhat surprised if GWT RPC actually worked with a truly exotic JDK that was neither Sun nor Apache based -- and I don't think we should avoid implementing a useful feature just because it might break on some future JDK. Right now users can't RPC these types of collections at all, so if they have to use an incompatible JDK the worst case is that they will try to use this feature, fail, file a bug, and we will add a case to support them in the server-side code. This feature by itself isn't worth a major revamping of RPC semantics IMHO. On 2010/07/07 20:37:27, jat wrote: So how does this work with server-side implementation classes? Aren't they going to need custom serializers for whatever internal classes the particular JVM uses? Previously we said the solution was RPC-by-interface, which would allow you to say that the default implementation for any unknown List subtype is ArrayList, for example, though obviously that breaks a List view onto some larger data structure. http://gwt-code-reviews.appspot.com/620805/diff/1/4 File user/super/com/google/gwt/emul/java/util/Collections.java (right): http://gwt-code-reviews.appspot.com/620805/diff/1/4#newcode141 user/super/com/google/gwt/emul/java/util/Collections.java:141: private static final class SingletonMapK, V extends AbstractMapK, V implements Serializable { O.K. On 2010/07/07 20:37:27, jat wrote: Javadoc explaining when this is used. http://gwt-code-reviews.appspot.com/620805/diff/1/6 File user/test/com/google/gwt/user/client/rpc/CollectionsTest.java (right): http://gwt-code-reviews.appspot.com/620805/diff/1/6#newcode590 user/test/com/google/gwt/user/client/rpc/CollectionsTest.java:590: service.echoSingletonMap(TestSetFactory.createSingletonMap(), I'll add createXXX methods to the test service. On 2010/07/07 20:37:27, jat wrote: Shouldn't these have a method where the various internal collection types are created on the server? http://gwt-code-reviews.appspot.com/620805/diff/1/11 File user/test/com/google/gwt/user/server/rpc/CollectionsTestServiceImpl.java (right): http://gwt-code-reviews.appspot.com/620805/diff/1/11#newcode450 user/test/com/google/gwt/user/server/rpc/CollectionsTestServiceImpl.java:450: return value; O.K. On 2010/07/07 20:37:27, jat wrote: Instead of returning the same value, what about creating a new one on the server from the one supplied, so we can test freshly-created instances? http://gwt-code-reviews.appspot.com/620805/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Reorder outer 'this' constructor arguments to come before user arguments. (issue675801)
LGTM, with some nits. http://gwt-code-reviews.appspot.com/675801/diff/1/3 File dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java (right): http://gwt-code-reviews.appspot.com/675801/diff/1/3#newcode701 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java:701: paramIt = getSyntheticLocalsIterator(); Prefer declaring a new var here. syntheticParamIt? http://gwt-code-reviews.appspot.com/675801/diff/1/3#newcode1258 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java:1258: // Synthetic locals for local classes Move this comment up to replace the one right above it? http://gwt-code-reviews.appspot.com/675801/diff/1/3#newcode1952 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java:1952: for (SyntheticArgumentBinding unused : nestedBinding.outerLocalVariables) { This formulation of the for loop seems akward to me. I prefer the older version of this where it's more obvious that i is just a counting variable. As evidence of akwardness, Intellij warns that unused is actually unused in contrast to i. Of course, it'd be even better if we had a doTimes loop variant. http://gwt-code-reviews.appspot.com/675801/diff/1/3#newcode2323 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java:2323: private ListIteratorJParameter getSyntheticLocalsIterator() { You ever only assign this to an Iterator. Why choose a ListIterator? http://gwt-code-reviews.appspot.com/675801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: JSNI ::new() now targets constructors directly (issue676801)
LGTM http://gwt-code-reviews.appspot.com/676801/diff/1/4 File dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java (right): http://gwt-code-reviews.appspot.com/676801/diff/1/4#newcode424 dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java:424: // JsniMethodRef rescues as JMethodCall or JNewInstance s/as/a http://gwt-code-reviews.appspot.com/676801/diff/1/4#newcode427 dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java:427: rescue(x.getTarget().getEnclosingType(), true, true); What do you think about refactoring this and visit(JNewInstance) to delegate to the same method - maybe rescueType or rescueTypeOnInstantiation? I know it's only a single line of code and a comment, but it would make me feel better from a maintenance standpoint - encouraging the two not to diverge. http://gwt-code-reviews.appspot.com/676801/diff/1/6 File dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java (right): http://gwt-code-reviews.appspot.com/676801/diff/1/6#newcode1343 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java:1343: if (ident.charAt(0) == '@') { Realize you didn't introduce this, but replace magic char comparison with a function? Ditto below. http://gwt-code-reviews.appspot.com/676801/diff/1/6#newcode1379 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java:1379: // Replace with a tear-off function. I'm not familiar with the term, tear-off function. Is there something special going on here that's being denoted beyond a normal closure creation? http://gwt-code-reviews.appspot.com/676801/diff/1/7 File dev/core/src/com/google/gwt/dev/jjs/impl/JsniRefLookup.java (right): http://gwt-code-reviews.appspot.com/676801/diff/1/7#newcode207 dev/core/src/com/google/gwt/dev/jjs/impl/JsniRefLookup.java:207: if (method instanceof JConstructor new.equals(memberName)) { JsniRef.NEW (and below)? http://gwt-code-reviews.appspot.com/676801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Fixes a bug where temp local declarations can sometimes end up in a for statement's increments list. (issue677801)
Reviewers: bowdidge, Lex, http://gwt-code-reviews.appspot.com/677801/diff/1/2 File dev/core/src/com/google/gwt/dev/jjs/ast/Context.java (right): http://gwt-code-reviews.appspot.com/677801/diff/1/2#newcode33 dev/core/src/com/google/gwt/dev/jjs/ast/Context.java:33: boolean isLvalue(); All the changes related to implementing isLvalue() follow the same pattern used in the JS AST. See JsContext. Implementation is basically identical, too. Hopefully, this can be useful for simplifying some optimization visitors as well. http://gwt-code-reviews.appspot.com/677801/diff/1/9 File dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java (right): http://gwt-code-reviews.appspot.com/677801/diff/1/9#newcode36 dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java:36: private static final class AlwaysReplacer extends TempLocalVisitor { These are two unrelated changes. 1) Reimplement the existing logic using Context.isLvalue() because it's much simpler and more fool proof than calling out all the cases. I was running into an error would I would try to replace a binary assignment twice... once during visit and once during endVisit, which isn't allowed. 2) Added the 'dontBother' part to prevent stupid replacements like replacing an entire assignment statement with a temp that represents the result of the assignment. http://gwt-code-reviews.appspot.com/677801/diff/1/9#newcode98 dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java:98: expected.append(for (int $t0 = 0, i = $t0; $t1; i += $t2);); This test fails without the change to TempLocalVisitor, because the 'int $t2 = 1' becomes the first statement of the increments clause. Description: Also adds Context.isLvalue() to the Java AST, mirroring the JsContext from the JS AST. Please review this at http://gwt-code-reviews.appspot.com/677801/show Affected files: M dev/core/src/com/google/gwt/dev/jjs/ast/Context.java M dev/core/src/com/google/gwt/dev/jjs/ast/JBinaryOperation.java M dev/core/src/com/google/gwt/dev/jjs/ast/JDeclarationStatement.java M dev/core/src/com/google/gwt/dev/jjs/ast/JModVisitor.java M dev/core/src/com/google/gwt/dev/jjs/ast/JUnaryOperation.java M dev/core/src/com/google/gwt/dev/jjs/ast/JVisitor.java M dev/core/src/com/google/gwt/dev/jjs/impl/TempLocalVisitor.java M dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixes a bug where temp local declarations can sometimes end up in a for statement's increments list. (issue677801)
http://gwt-code-reviews.appspot.com/677801/diff/1/9 File dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java (right): http://gwt-code-reviews.appspot.com/677801/diff/1/9#newcode87 dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java:87: public void testForStatement() throws Exception { Should you add a test with a loop over longs because of all the extra manipulation that goes on there? Think it's likely that anyone's going to try to increment a long in the test clause of a for statement? http://gwt-code-reviews.appspot.com/677801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Reorder outer 'this' constructor arguments to come before user arguments. (issue675801)
http://gwt-code-reviews.appspot.com/675801/diff/1/3 File dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java (right): http://gwt-code-reviews.appspot.com/675801/diff/1/3#newcode701 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java:701: paramIt = getSyntheticLocalsIterator(); Meh, I went for less delta. http://gwt-code-reviews.appspot.com/675801/diff/1/3#newcode1258 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java:1258: // Synthetic locals for local classes On 2010/07/08 15:30:48, tobyr wrote: Move this comment up to replace the one right above it? Done. http://gwt-code-reviews.appspot.com/675801/diff/1/3#newcode1952 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java:1952: for (SyntheticArgumentBinding unused : nestedBinding.outerLocalVariables) { On 2010/07/08 15:30:48, tobyr wrote: This formulation of the for loop seems akward to me. I prefer the older version of this where it's more obvious that i is just a counting variable. As evidence of akwardness, Intellij warns that unused is actually unused in contrast to i. Of course, it'd be even better if we had a doTimes loop variant. Done. http://gwt-code-reviews.appspot.com/675801/diff/1/3#newcode2323 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java:2323: private ListIteratorJParameter getSyntheticLocalsIterator() { Oversight, fixed. http://gwt-code-reviews.appspot.com/675801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: JSNI ::new() now targets constructors directly (issue676801)
http://gwt-code-reviews.appspot.com/676801/diff/1/4 File dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java (right): http://gwt-code-reviews.appspot.com/676801/diff/1/4#newcode424 dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java:424: // JsniMethodRef rescues as JMethodCall or JNewInstance On 2010/07/08 16:25:58, tobyr wrote: s/as/a I actually did mean 'as', but I could probably make the comment a little clearer. http://gwt-code-reviews.appspot.com/676801/diff/1/4#newcode427 dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java:427: rescue(x.getTarget().getEnclosingType(), true, true); Sure, I can add a rescueAndInstantiate. http://gwt-code-reviews.appspot.com/676801/diff/1/6 File dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java (right): http://gwt-code-reviews.appspot.com/676801/diff/1/6#newcode1343 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java:1343: if (ident.charAt(0) == '@') { On 2010/07/08 16:25:58, tobyr wrote: Realize you didn't introduce this, but replace magic char comparison with a function? Ditto below. Done. http://gwt-code-reviews.appspot.com/676801/diff/1/6#newcode1379 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java:1379: // Replace with a tear-off function. Changed to 'closureFunc'. http://gwt-code-reviews.appspot.com/676801/diff/1/7 File dev/core/src/com/google/gwt/dev/jjs/impl/JsniRefLookup.java (right): http://gwt-code-reviews.appspot.com/676801/diff/1/7#newcode207 dev/core/src/com/google/gwt/dev/jjs/impl/JsniRefLookup.java:207: if (method instanceof JConstructor new.equals(memberName)) { On 2010/07/08 16:25:58, tobyr wrote: JsniRef.NEW (and below)? Done. http://gwt-code-reviews.appspot.com/676801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixes a bug where temp local declarations can sometimes end up in a for statement's increments list. (issue677801)
http://gwt-code-reviews.appspot.com/677801/diff/1/9 File dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java (right): http://gwt-code-reviews.appspot.com/677801/diff/1/9#newcode87 dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java:87: public void testForStatement() throws Exception { This simple unit test doesn't run the whole compiler, including any of the long craziness, it's just a direct test of TempLocalVisitor. The thing is, simply compiling a for loop with a long incrementor does not trigger the bug, because we never actually try to pull any items out of the ListJExpressionStatement as such; those increments statements only ever get accessed via JVisitor, which never does a cast check. http://gwt-code-reviews.appspot.com/677801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixes a bug where temp local declarations can sometimes end up in a for statement's increments list. (issue677801)
LGTM. http://gwt-code-reviews.appspot.com/677801/diff/1/9 File dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java (right): http://gwt-code-reviews.appspot.com/677801/diff/1/9#newcode87 dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java:87: public void testForStatement() throws Exception { Sounds ok. http://gwt-code-reviews.appspot.com/677801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixes a bug where temp local declarations can sometimes end up in a for statement's increments list. (issue677801)
Good find. Just one nit. http://gwt-code-reviews.appspot.com/677801/diff/1/2 File dev/core/src/com/google/gwt/dev/jjs/ast/Context.java (right): http://gwt-code-reviews.appspot.com/677801/diff/1/2#newcode33 dev/core/src/com/google/gwt/dev/jjs/ast/Context.java:33: boolean isLvalue(); Cool, that should simplify many visitors. http://gwt-code-reviews.appspot.com/677801/diff/1/9 File dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java (right): http://gwt-code-reviews.appspot.com/677801/diff/1/9#newcode54 dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java:54: local.getDeclarationStatement().initializer = x; It's a legacy problem in this test case, but the above replacement is actually not sound. Instead of overwriting the declaration statement's initializer, it would be better to replace x by (t=x,t). Or even just (t=x). See below for an example. http://gwt-code-reviews.appspot.com/677801/diff/1/9#newcode98 dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java:98: expected.append(for (int $t0 = 0, i = $t0; $t1; i += $t2);); Imagine that instead of i += 1 it was i += foo(). In that case, it's vital to reevaluate the foo() each time through the loop. http://gwt-code-reviews.appspot.com/677801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r8359 committed - Did 'svn merge -r8311:8310 .'...
Revision: 8359 Author: amitman...@google.com Date: Thu Jul 8 11:49:11 2010 Log: Did 'svn merge -r8311:8310 .' and updated branch-info.txt Patch by: amitmanjhi Review by: mmendez http://code.google.com/p/google-web-toolkit/source/detail?r=8359 Added: /branches/2.1M2/dev/core/src/com/google/gwt/dev/shell/jetty/JettyNullLogger.java Deleted: /branches/2.1M2/user/test/com/google/gwt/user/BadServlets.gwt.xml /branches/2.1M2/user/test/com/google/gwt/user/ServletsSuite.java /branches/2.1M2/user/test/com/google/gwt/user/client/BadServletsTest.java /branches/2.1M2/user/test/com/google/gwt/user/server/BadServlets.java Modified: /branches/2.1M2/branch-info.txt /branches/2.1M2/dev/build.xml /branches/2.1M2/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java /branches/2.1M2/eclipse/dev/.classpath /branches/2.1M2/eclipse/user/.classpath /branches/2.1M2/user/src/com/google/gwt/i18n/client/impl/CurrencyDataImpl.java /branches/2.1M2/user/src/com/google/gwt/junit/JUnitShell.java /branches/2.1M2/user/test/com/google/gwt/i18n/client/CurrencyTest.java === --- /dev/null +++ /branches/2.1M2/dev/core/src/com/google/gwt/dev/shell/jetty/JettyNullLogger.java Thu Jul 8 11:49:11 2010 @@ -0,0 +1,50 @@ +/* + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.dev.shell.jetty; + +import org.mortbay.log.Logger; + +/** + * A Jetty {...@link Logger} that suppresses all output. + */ +public class JettyNullLogger implements Logger { + + public void debug(String msg, Throwable th) { + } + + public void debug(String msg, Object arg0, Object arg1) { + } + + public Logger getLogger(String name) { +return this; + } + + public void info(String msg, Object arg0, Object arg1) { + } + + public boolean isDebugEnabled() { +return false; + } + + public void setDebugEnabled(boolean enabled) { + } + + public void warn(String msg, Throwable th) { + } + + public void warn(String msg, Object arg0, Object arg1) { + } +} === --- /branches/2.1M2/user/test/com/google/gwt/user/BadServlets.gwt.xml Thu Jun 24 08:11:49 2010 +++ /dev/null @@ -1,31 +0,0 @@ -!-- -- -!-- Copyright 2007 Google Inc. -- -!-- Licensed under the Apache License, Version 2.0 (the License); you-- -!-- may not use this file except in compliance with the License. You may -- -!-- may obtain a copy of the License at-- -!-- -- -!-- http://www.apache.org/licenses/LICENSE-2.0 -- -!-- -- -!-- Unless required by applicable law or agreed to in writing, software-- -!-- distributed under the License is distributed on an AS IS BASIS, -- -!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or-- -!-- implied. License for the specific language governing permissions and -- -!-- limitations under the License. -- - -module - inherits name='com.google.gwt.user.User' / - - servlet path='/notfound' class='org.example.NotFound' / - servlet path='/ctor' - class='com.google.gwt.user.server.BadServlets$CtorException' / - servlet path='/intf' - class='com.google.gwt.user.server.BadServlets$Interface' / - servlet path='/nodef' - class='com.google.gwt.user.server.BadServlets$NoDefaultCtor' / - servlet path='/nothttp' - class='com.google.gwt.user.server.BadServlets$NotHttpServlet' / - servlet path='/static' - class='com.google.gwt.user.server.BadServlets$StaticException' / - servlet path='/ok' - class='com.google.gwt.user.server.BadServlets$Ok' / -/module === --- /branches/2.1M2/user/test/com/google/gwt/user/ServletsSuite.java Thu Jun 24 08:11:49 2010 +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the License); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing,
[gwt-contrib] Re: Fixes a bug where temp local declarations can sometimes end up in a for statement's increments list. (issue677801)
http://gwt-code-reviews.appspot.com/677801/diff/1/9 File dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java (right): http://gwt-code-reviews.appspot.com/677801/diff/1/9#newcode54 dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java:54: local.getDeclarationStatement().initializer = x; That would make a lot more intuitive sense for someone looking at what this test does! But... I don't want to obscure this patch by adding in that change, because I'll have to rewrite the expected results for every test in this file. How about I do that change in a follow-up, and for this change I'll add a note to AlwaysReplacer to the effect that it doesn't even try to preserve semantics. It literally just blows through and replaces expressions with temps with no regard for evaluation order, so this is the intended behavior for this test. http://gwt-code-reviews.appspot.com/677801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixes a bug where temp local declarations can sometimes end up in a for statement's increments list. (issue677801)
Sure, LGTM. http://gwt-code-reviews.appspot.com/677801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] TempLocalVisitorTest now uses non-destructive code transforms (improves clarity) (issue679801)
Reviewers: Lex, Message: Follow-up to http://gwt-code-reviews.appspot.com/677801/show Description: Suggested by: spoon Please review this at http://gwt-code-reviews.appspot.com/679801/show Affected files: M dev/core/test/com/google/gwt/dev/jjs/impl/TempLocalVisitorTest.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fixes a bug where temp local declarations can sometimes end up in a for statement's increments list. (issue677801)
See http://gwt-code-reviews.appspot.com/679801/show http://gwt-code-reviews.appspot.com/677801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: TempLocalVisitorTest now uses non-destructive code transforms (improves clarity) (issue679801)
LGTM. It makes the test case a better example of how to use the facility. http://gwt-code-reviews.appspot.com/679801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r8360 committed - Adding NoSelectionModel, which allows selection without saving the sel...
Revision: 8360 Author: jlaba...@google.com Date: Fri Jul 2 10:23:18 2010 Log: Adding NoSelectionModel, which allows selection without saving the selection state. Review at http://gwt-code-reviews.appspot.com/667801 Review by: j...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=8360 Added: /trunk/user/src/com/google/gwt/view/client/NoSelectionModel.java /trunk/user/test/com/google/gwt/view/client/NoSelectionModelTest.java Modified: /trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpenseList.java /trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseList.java /trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileReportList.java /trunk/user/test/com/google/gwt/view/ViewSuite.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/view/client/NoSelectionModel.java Fri Jul 2 10:23:18 2010 @@ -0,0 +1,60 @@ +/* + * Copyright 2010 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.view.client; + +import com.google.gwt.view.client.SelectionModel.AbstractSelectionModel; + +/** + * A selection model that does not allow selection, but fires selection change + * events. Use this model if you want to know when a user selects an item, but + * do not want the view to update based on the selection. + * + * p + * Note: This class is new and its interface subject to change. + * /p + * + * @param T the record data type + */ +public class NoSelectionModelT extends AbstractSelectionModelT { + + private Object lastKey; + private T lastSelection; + + /** + * Gets the object that was last selected. + * + * @return the last selected object + */ + public T getLastSelectedObject() { +return lastSelection; + } + + public boolean isSelected(T object) { +return false; + } + + public void setSelected(T object, boolean selected) { +Object key = getKey(object); +if (selected) { + lastSelection = object; + lastKey = key; +} else if (lastKey != null lastKey.equals(key)) { + lastSelection = null; + lastKey = null; +} +scheduleSelectionChangeEvent(); + } +} === --- /dev/null +++ /trunk/user/test/com/google/gwt/view/client/NoSelectionModelTest.java Fri Jul 2 10:23:18 2010 @@ -0,0 +1,87 @@ +/* + * Copyright 2010 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.view.client; + +import com.google.gwt.view.client.SelectionModel.SelectionChangeEvent; +import com.google.gwt.view.client.SelectionModel.SelectionChangeHandler; + +/** + * Tests for {...@link NoSelectionModel}. + */ +public class NoSelectionModelTest extends AbstractSelectionModelTest { + + public void testGetLastSelectedObject() { +NoSelectionModelString model = createSelectionModel(); +assertNull(model.getLastSelectedObject()); + +model.setSelected(test, true); +assertEquals(test, model.getLastSelectedObject()); + +model.setSelected(test, false); +assertNull(model.getLastSelectedObject()); + } + + public void testSelectedChangeEvent() { +NoSelectionModelString model = createSelectionModel(); +SelectionChangeHandler handler = new SelectionChangeHandler() { + public void onSelectionChange(SelectionChangeEvent event) { +finishTest(); + } +}; +model.addSelectionChangeHandler(handler); + +delayTestFinish(2000); +model.setSelected(test, true); + } + + public void testSetSelected() { +NoSelectionModelString model = createSelectionModel(); +assertFalse(model.isSelected(test0)); + +model.setSelected(test0, true); +assertFalse(model.isSelected(test0)); + +model.setSelected(test1, true); +assertFalse(model.isSelected(test1)); + } + + public void testSetSelectedWithKeyProvider() { +NoSelectionModelString model = createSelectionModel(); +
[gwt-contrib] [google-web-toolkit] r8361 committed - Fix for http://code.google.com/p/google-web-toolkit/issues/detail?id=4...
Revision: 8361 Author: t...@google.com Date: Mon Jul 5 09:18:17 2010 Log: Fix for http://code.google.com/p/google-web-toolkit/issues/detail?id=4814 Fixes a bug with deRPC serialization of boolean values. When a boolean value is read by the client, it's currently interpreted as a number. When it's serialized again to the server, it becomes a Double object. This change adds a test to isolate the issue, and a proposed fix. Instead of requiring the argument to be written as 'false' to the client, it relaxes what the server accepts as potential boolean values, allowing 0 or 1 as well. Review by: robertvaw...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=8361 Modified: /trunk/user/src/com/google/gwt/rpc/server/CommandSerializationUtil.java /trunk/user/test/com/google/gwt/user/client/rpc/InheritanceTest.java /trunk/user/test/com/google/gwt/user/client/rpc/InheritanceTestSetFactory.java === --- /trunk/user/src/com/google/gwt/rpc/server/CommandSerializationUtil.java Wed Oct 28 09:10:53 2009 +++ /trunk/user/src/com/google/gwt/rpc/server/CommandSerializationUtil.java Mon Jul 5 09:18:17 2010 @@ -103,8 +103,20 @@ @Override public void set(Object instance, long offset, Object value) { -theUnsafe.putBoolean(instance, offset, ((Boolean) value)); - } +theUnsafe.putBoolean(instance, offset, toBoolean(value)); + } + + private boolean toBoolean(Object value) { +if (value instanceof Number) { + return ((Number) value).intValue() != 0; +} else if (value instanceof String) { + return Boolean.valueOf((String) value); +} else { + // returns false if the value is null. + return Boolean.TRUE.equals(value); +} + } + }, BYTE { @Override === --- /trunk/user/test/com/google/gwt/user/client/rpc/InheritanceTest.java Wed Nov 4 13:03:23 2009 +++ /trunk/user/test/com/google/gwt/user/client/rpc/InheritanceTest.java Mon Jul 5 09:18:17 2010 @@ -93,6 +93,33 @@ } }); } + + /** + * Tests that a serialized type can be sent again on the wire. + */ + public void testResendJavaSerializableClass() { +final InheritanceTestServiceAsync service = getServiceAsync(); +final InheritanceTestSetFactory.JavaSerializableClass first = +new InheritanceTestSetFactory.JavaSerializableClass(3); +AsyncCallbackObject resendCallback = new AsyncCallbackObject() { +private boolean resend = true; +public void onFailure(Throwable caught) { + TestSetValidator.rethrowException(caught); +} + +public void onSuccess(Object result) { + assertEquals(first, result); + if (resend) { +resend = false; +service.echo((InheritanceTestSetFactory.JavaSerializableClass) result, this); + } else { +finishTest(); + } +} +}; +delayTestFinishForRpc(); +service.echo(first, resendCallback); + } /** * Test that non-static inner classes are not serializable. === --- /trunk/user/test/com/google/gwt/user/client/rpc/InheritanceTestSetFactory.java Wed Aug 15 15:15:17 2007 +++ /trunk/user/test/com/google/gwt/user/client/rpc/InheritanceTestSetFactory.java Mon Jul 5 09:18:17 2010 @@ -72,6 +72,23 @@ public JavaSerializableBaseClass(int field1) { this.field1 = field1; } + +@Override +public int hashCode() { + return field1; +} + +@Override +public boolean equals(Object obj) { + if (obj == this) { +return true; + } + if (obj == null || obj.getClass() != this.getClass()) { +return false; + } + JavaSerializableBaseClass other = (JavaSerializableBaseClass) obj; + return field1 == other.field1; +} } /** @@ -79,6 +96,7 @@ */ public static class JavaSerializableClass extends JavaSerializableBaseClass { private int field2 = -2; +private boolean field3 = true; public JavaSerializableClass() { } @@ -86,6 +104,23 @@ public JavaSerializableClass(int field2) { this.field2 = field2; } + +@Override +public int hashCode() { + return super.hashCode() 19 + field2; +} + +@Override +public boolean equals(Object obj) { + if (obj == this) { +return true; + } + if (obj == null || obj.getClass() != this.getClass()) { +return false; + } + JavaSerializableClass other = (JavaSerializableClass) obj; + return super.equals(other) field2 == other.field2 field3 == other.field3; +} } /** -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r8362 committed - Fix external issue 4711 - java.sql.Timestamp#compareTo(java.util.Date)...
Revision: 8362 Author: r...@google.com Date: Wed Jul 7 04:47:08 2010 Log: Fix external issue 4711 - java.sql.Timestamp#compareTo(java.util.Date) silently crashes in Firefox and Chrome Review at http://gwt-code-reviews.appspot.com/634802 Review by: j...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=8362 Modified: /trunk/user/super/com/google/gwt/emul/java/sql/Timestamp.java /trunk/user/test/com/google/gwt/emultest/java/sql/SqlTimestampTest.java === --- /trunk/user/super/com/google/gwt/emul/java/sql/Timestamp.java Mon Jan 4 19:21:08 2010 +++ /trunk/user/super/com/google/gwt/emul/java/sql/Timestamp.java Wed Jul 7 04:47:08 2010 @@ -108,8 +108,11 @@ @Override public int compareTo(java.util.Date o) { -// JavaDoc says a ClassCastException is correct behavior -return compareTo((Timestamp) o); +if (o instanceof Timestamp) { + return compareTo((Timestamp) o); +} else { + return compareTo(new Timestamp(o.getTime())); +} } public int compareTo(Timestamp o) { === --- /trunk/user/test/com/google/gwt/emultest/java/sql/SqlTimestampTest.java Mon Jan 4 11:06:23 2010 +++ /trunk/user/test/com/google/gwt/emultest/java/sql/SqlTimestampTest.java Wed Jul 7 04:47:08 2010 @@ -15,7 +15,6 @@ */ package com.google.gwt.emultest.java.sql; -import com.google.gwt.core.client.GWT; import com.google.gwt.junit.client.GWTTestCase; import java.sql.Timestamp; @@ -59,16 +58,9 @@ assertEquals(d2, t, d2, t); assertEquals(hashcode, d2.hashCode(), t.hashCode()); assertFalse(t.equals(d2), t.equals(d2)); - -if (GWT.isScript()) { - // It looks like not all JVMs will throw the CCE, just check web mode. - try { -t.compareTo(d2); -fail(Should throw ClassCastException); - } catch (ClassCastException e) { -// Correct - } -} + +// t is later then d2 by some number of nanoseconds +assertEquals(1, t.compareTo(d2)); Timestamp t2 = new Timestamp(d.getTime()); t2.setNanos(t.getNanos() + 1); -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r8363 committed - Restore rolled-back change r8329, now with a much faster test case tha...
Revision: 8363 Author: r...@google.com Date: Wed Jul 7 05:39:12 2010 Log: Restore rolled-back change r8329, now with a much faster test case that runs in IE Review at http://gwt-code-reviews.appspot.com/654802 Review by: j...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=8363 Modified: /trunk/user/src/com/google/gwt/core/client/JsonUtils.java /trunk/user/src/com/google/gwt/json/client/JSONParser.java /trunk/user/test/com/google/gwt/json/client/JSONTest.java === --- /trunk/user/src/com/google/gwt/core/client/JsonUtils.java Tue Jun 29 11:59:07 2010 +++ /trunk/user/src/com/google/gwt/core/client/JsonUtils.java Wed Jul 7 05:39:12 2010 @@ -22,38 +22,117 @@ @SuppressWarnings(unused) private static JavaScriptObject escapeTable = initEscapeTable(); + @SuppressWarnings(unused) + private static final boolean hasJsonParse = hasJsonParse(); + + /** + * Escapes characters within a JSON string than cannot be passed directly to + * eval(). Control characters, quotes and backslashes are not affected. + */ + public static native String escapeJsonForEval(String toEscape) /*-{ +var s = toEscape.replace(/[\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202e\u2060-\u2063\u206a-\u206f\ufeff\ufff9-\ufffb]/g, function(x) { + return @com.google.gwt.core.client.JsonUtils::escapeChar(Ljava/lang/String;)(x); +}); +return s; + }-*/; + /** * Returns a quoted, escaped JSON String. */ public static native String escapeValue(String toEscape) /*-{ -var s = toEscape.replace(/[\x00-\x1F\u2028\u2029\\]/g, function(x) { +var s = toEscape.replace(/[\x00-\x1f\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202e\u2060-\u2063\u206a-\u206f\ufeff\ufff9-\ufffb\\]/g, function(x) { return @com.google.gwt.core.client.JsonUtils::escapeChar(Ljava/lang/String;)(x); }); return \ + s + \; }-*/; - /* - * TODO: Implement safeEval using a proper parser. + /** + * Evaluates a JSON expression safely. The payload must evaluate to an Object + * or an Array (not a primitive or a String). + * + * @param T The type of JavaScriptObject that should be returned + * @param json The source JSON text + * @return The evaluated object + * + * @throws IllegalArgumentException if the input is not valid JSON */ - + public static native T extends JavaScriptObject T safeEval(String json) /*-{ +var v; +if (@com.google.gwt.core.client.JsonUtils::hasJsonParse) { + try { +return JSON.parse(json); + } catch (e) { +return @com.google.gwt.core.client.JsonUtils::throwIllegalArgumentException(Ljava/lang/String;)(Error parsing JSON: + e); + } +} else { + if (!...@com.google.gwt.core.client.jsonutils::safeToEval(Ljava/lang/String;)(json)) { +return @com.google.gwt.core.client.JsonUtils::throwIllegalArgumentException(Ljava/lang/String;)(Illegal character in JSON string); + } + json = @com.google.gwt.core.client.JsonUtils::escapeJsonForEval(Ljava/lang/String;)(json); + try { +return eval('(' + json + ')'); + } catch (e) { +return @com.google.gwt.core.client.JsonUtils::throwIllegalArgumentException(Ljava/lang/String;)(Error parsing JSON: + e); + } +} + }-*/; + /** - * Evaluates a JSON expression. This method does not validate the JSON text - * and should only be used on JSON from trusted sources. + * Returns true if the given JSON string may be safely evaluated by {...@code + * eval()} without undersired side effects or security risks. Note that a true + * result from this method does not guarantee that the input string is valid + * JSON. This method does not consider the contents of quoted strings; it + * may still be necessary to perform escaping prior to evaluation for correct + * results. + * + * p The technique used is taken from a href=http://www.ietf.org/rfc/rfc4627.txt;RFC 4627/a. + */ + public static native boolean safeToEval(String text) /*-{ +// Remove quoted strings and disallow anything except: +// +// 1) symbols and brackets ,:{}[] +// 2) numbers: digits 0-9, ., -, +, e, and E +// 3) literal values: 'null', 'true' and 'false' = [aeflnr-u] +// 4) whitespace: ' ', '\n', '\r', and '\t' +return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/(\\.| [^\\])*/g, ''))); + }-*/; + + /** + * Evaluates a JSON expression using {...@code eval()}. This method does not + * validate the JSON text and should only be used on JSON from trusted + * sources. The payload must evaluate to an Object or an Array (not a + * primitive or a String). * * @param T The type of JavaScriptObject that should be returned * @param json The source JSON text * @return The evaluated object */ public static native T extends JavaScriptObject T
[gwt-contrib] [google-web-toolkit] r8364 committed - Add numeric wrappers to JavaResourceBase....
Revision: 8364 Author: to...@google.com Date: Thu Jul 8 06:50:03 2010 Log: Add numeric wrappers to JavaResourceBase. Review at http://gwt-code-reviews.appspot.com/673801 Review by: sco...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=8364 Modified: /trunk/dev/core/test/com/google/gwt/dev/javac/impl/JavaResourceBase.java === --- /trunk/dev/core/test/com/google/gwt/dev/javac/impl/JavaResourceBase.java Fri Jun 4 12:47:18 2010 +++ /trunk/dev/core/test/com/google/gwt/dev/javac/impl/JavaResourceBase.java Thu Jul 8 06:50:03 2010 @@ -41,6 +41,40 @@ code.append(}\n); return code; } + }; + public static final MockJavaResource BYTE = new MockJavaResource( + java.lang.Byte) { +@Override +protected CharSequence getContent() { + StringBuffer code = new StringBuffer(); + code.append(package java.lang;\n); + code.append(public class Byte extends Number {\n); + code.append( private byte value;\n); + code.append( public Byte(byte value) {\n); + code.append(this.value = value;\n); + code.append( }\n); + code.append( public static Byte valueOf(byte b) { return new Byte(b); }\n); + code.append( public byte byteValue() { return value; }\n); + code.append(}\n); + return code; +} + }; + public static final MockJavaResource CHARACTER = new MockJavaResource( + java.lang.Character) { +@Override +protected CharSequence getContent() { + StringBuffer code = new StringBuffer(); + code.append(package java.lang;\n); + code.append(public class Character {\n); + code.append( private char value;\n); + code.append( public Character(char value) {\n); + code.append(this.value = value;\n); + code.append( }\n); + code.append( public static Character valueOf(char c) { return new Character(c); }\n); + code.append( public char charValue() { return value; }\n); + code.append(}\n); + return code; +} }; public static final MockJavaResource CLASS = new MockJavaResource( java.lang.Class) { @@ -88,7 +122,7 @@ protected CharSequence getContent() { StringBuffer code = new StringBuffer(); code.append(package java.lang;\n); - code.append(public class Double {\n); + code.append(public class Double extends Number {\n); code.append( private double value;\n); code.append( public Double(double value) {\n); code.append(this.value = value;\n); @@ -141,7 +175,7 @@ protected CharSequence getContent() { StringBuffer code = new StringBuffer(); code.append(package java.lang;\n); - code.append(public class Float {\n); + code.append(public class Float extends Number {\n); code.append( private float value;\n); code.append( public Float(float value) {\n); code.append(this.value = value;\n); @@ -169,7 +203,7 @@ protected CharSequence getContent() { StringBuffer code = new StringBuffer(); code.append(package java.lang;\n); - code.append(public class Integer {\n); + code.append(public class Integer extends Number {\n); code.append( private int value;\n); code.append( public Integer(int value) {\n); code.append(this.value = value;\n); @@ -226,6 +260,18 @@ return code; } }; + public static final MockJavaResource NUMBER = new MockJavaResource( + java.lang.Number) { +@Override +protected CharSequence getContent() { + StringBuffer code = new StringBuffer(); + code.append(package java.lang;\n); + code.append(public class Number implements java.io.Serializable {\n); + code.append(}\n); + return code; +} + }; + public static final MockJavaResource OBJECT = new MockJavaResource( java.lang.Object) { @Override @@ -249,6 +295,23 @@ code.append(public interface Serializable { }\n); return code; } + }; + public static final MockJavaResource SHORT = new MockJavaResource( + java.lang.Short) { +@Override +protected CharSequence getContent() { + StringBuffer code = new StringBuffer(); + code.append(package java.lang;\n); + code.append(public class Short extends Number {\n); + code.append( private short value;\n); + code.append( public Short(short value) {\n); + code.append(this.value = value;\n); + code.append( }\n); + code.append( public static Short valueOf(short s) { return new Short(s); }\n); + code.append( public short shortValue() { return value; }\n); + code.append(}\n); + return code; +} }; public static final MockJavaResource STRING = new MockJavaResource( java.lang.String) { @@ -317,9 +380,10 @@ public static MockJavaResource[] getStandardResources() { return new MockJavaResource[] { -ANNOTATION, CLASS, CLASS_NOT_FOUND_EXCEPTION,
[gwt-contrib] [google-web-toolkit] r8366 committed - JSNI ::new() now targets constructors directly....
Revision: 8366 Author: sco...@google.com Date: Thu Jul 8 08:08:57 2010 Log: JSNI ::new() now targets constructors directly. This patch removes the extra hop through a synthetic static 'new' function that is currently used for implementing JSNI ::new() invocations. In the 99% case, the JsInvocation is replaced with a JsNew operation on the target constructor. In rare cases where the constructor is not immediately invoked, a tear off function is creation which performs the new op internally. Review by: to...@google.com http://code.google.com/p/google-web-toolkit/source/detail?r=8366 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JVisitor.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JsniRefLookup.java /trunk/dev/core/test/com/google/gwt/dev/jjs/impl/JsniRefLookupTest.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JVisitor.java Fri Apr 2 14:35:01 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JVisitor.java Thu Jul 8 08:08:57 2010 @@ -698,7 +698,7 @@ } public boolean visit(JsniMethodRef x, Context ctx) { -/* NOTE: Skip JMethodRef */ +/* NOTE: Skip JMethodCall */ return visit((JExpression) x, ctx); } === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java Thu Jul 8 08:05:07 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java Thu Jul 8 08:08:57 2010 @@ -28,13 +28,10 @@ import com.google.gwt.dev.jjs.ast.JLocal; import com.google.gwt.dev.jjs.ast.JMethod; import com.google.gwt.dev.jjs.ast.JMethodBody; -import com.google.gwt.dev.jjs.ast.JNewInstance; import com.google.gwt.dev.jjs.ast.JParameter; -import com.google.gwt.dev.jjs.ast.JParameterRef; import com.google.gwt.dev.jjs.ast.JPrimitiveType; import com.google.gwt.dev.jjs.ast.JProgram; import com.google.gwt.dev.jjs.ast.JReferenceType; -import com.google.gwt.dev.jjs.ast.JReturnStatement; import com.google.gwt.dev.jjs.ast.JType; import com.google.gwt.dev.jjs.ast.JField.Disposition; import com.google.gwt.dev.jjs.ast.js.JsniMethodBody; @@ -219,13 +216,6 @@ } typeMap.put(b, newCtor); - -// Now let's implicitly create a static function called 'new' that will -// allow construction from JSNI methods -if (!enclosingType.isAbstract()) { - createSyntheticConstructor(newCtor); -} - return true; } catch (Throwable e) { throw translateException(ctorDecl, e); @@ -387,63 +377,6 @@ enclosingMethod); return param; } - -/** - * Create a method that invokes the specified constructor. This is done as - * an aid to JSNI users to be able to invoke a Java constructor via a method - * named ::new. - * - * @param constructor the constructor to invoke - * @param staticClass indicates if the class being constructed is static - * @param enclosingType the type that encloses the type that is to be - * constructed. This may be codenull/code if the class is a - * top-level type. - */ -private JMethod createSyntheticConstructor(JConstructor constructor) { - JClassType type = constructor.getEnclosingType(); - - // Define the method - JMethod synthetic = program.createMethod(type.getSourceInfo().makeChild( - BuildDeclMapVisitor.class, Synthetic constructor), new, type, - program.getNonNullType(type), false, true, true, false, false); - synthetic.setSynthetic(); - - synthetic.addThrownExceptions(constructor.getThrownExceptions()); - - // new Foo() : Create the instance - JNewInstance newInstance = new JNewInstance( - type.getSourceInfo().makeChild(BuildDeclMapVisitor.class, - new instance), constructor, type); - - /* - * In one pass, add the parameters to the synthetic constructor and - * arguments to the method call. - */ - for (JParameter param : constructor.getParams()) { -JParameter syntheticParam = JProgram.createParameter( -synthetic.getSourceInfo().makeChild(BuildDeclMapVisitor.class, -Argument + param.getName()), param.getName(), -param.getType(), true, false, synthetic); -newInstance.addArg(new JParameterRef( - syntheticParam.getSourceInfo().makeChild(BuildDeclMapVisitor.class, -reference), syntheticParam)); - } - - // Lock the method. - synthetic.freezeParamTypes(); - - // return new Foo() : The only statement in the function - JReturnStatement ret = new JReturnStatement( -
[gwt-contrib] [google-web-toolkit] r8369 committed - Update 2.1 M2 Maven repo with updated M2 artifacts.
Revision: 8369 Author: jasonpar...@google.com Date: Thu Jul 8 13:56:20 2010 Log: Update 2.1 M2 Maven repo with updated M2 artifacts. http://code.google.com/p/google-web-toolkit/source/detail?r=8369 Modified: /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/2.1.0.M2/gwt-servlet-2.1.0.M2.jar /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/2.1.0.M2/gwt-servlet-2.1.0.M2.jar.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/2.1.0.M2/gwt-servlet-2.1.0.M2.jar.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/maven-metadata.xml /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/maven-metadata.xml.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/maven-metadata.xml.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-soyc-vis/2.1.0.M2/gwt-soyc-vis-2.1.0.M2.jar /2.1.0.M2/gwt/maven/com/google/gwt/gwt-soyc-vis/2.1.0.M2/gwt-soyc-vis-2.1.0.M2.jar.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-soyc-vis/2.1.0.M2/gwt-soyc-vis-2.1.0.M2.jar.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-soyc-vis/maven-metadata.xml /2.1.0.M2/gwt/maven/com/google/gwt/gwt-soyc-vis/maven-metadata.xml.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-soyc-vis/maven-metadata.xml.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-user/2.1.0.M2/gwt-user-2.1.0.M2.jar /2.1.0.M2/gwt/maven/com/google/gwt/gwt-user/2.1.0.M2/gwt-user-2.1.0.M2.jar.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-user/2.1.0.M2/gwt-user-2.1.0.M2.jar.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-user/maven-metadata.xml /2.1.0.M2/gwt/maven/com/google/gwt/gwt-user/maven-metadata.xml.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-user/maven-metadata.xml.sha1 === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar Thu Jul 8 13:56:20 2010 File is too large to display a diff. === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar.md5 Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar.md5 Thu Jul 8 13:56:20 2010 @@ -1,1 +1,1 @@ -e6e946bb45e8d20b98cf374e969c417b +34d17a1d650e7bc7982d6f7dd2d96152 === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar.sha1 Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar.sha1 Thu Jul 8 13:56:20 2010 @@ -1,1 +1,1 @@ -683b8e4f09a34262f399ad6963a4941df7388a83 +8d7b35b70f1309f790bda19f131445bfb20fd66a === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml Thu Jul 8 13:56:20 2010 @@ -7,6 +7,6 @@ versions version2.1.0.M2/version /versions -lastUpdated20100701144018/lastUpdated +lastUpdated20100708204159/lastUpdated /versioning /metadata === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml.md5 Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml.md5 Thu Jul 8 13:56:20 2010 @@ -1,1 +1,1 @@ -83c996c9a5333cc1f5547fb88a3db0a7 +87a38fb30b2744cd3554a86d496c6357 === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml.sha1 Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml.sha1 Thu Jul 8 13:56:20 2010 @@ -1,1 +1,1 @@ -e500018ffabacf49c5825bc66dee0e26ffc68f74 +807356d40925bda386a79cd5da37bee7647d243e === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/2.1.0.M2/gwt-servlet-2.1.0.M2.jar Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/2.1.0.M2/gwt-servlet-2.1.0.M2.jar Thu Jul 8 13:56:20 2010 File is too large to display a diff. === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/2.1.0.M2/gwt-servlet-2.1.0.M2.jar.md5 Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/2.1.0.M2/gwt-servlet-2.1.0.M2.jar.md5 Thu Jul 8 13:56:20 2010 @@ -1,1 +1,1 @@ -47ac05333b23bd169653b8ab9f932845 +c2e79bd9c491d1f97d279917420514f8 === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/2.1.0.M2/gwt-servlet-2.1.0.M2.jar.sha1 Fri Jul 2 10:29:54 2010 +++
[gwt-contrib] [google-web-toolkit] r8365 committed - Reorder outer 'this' constructor arguments to come before user argumen...
Revision: 8365 Author: sco...@google.com Date: Thu Jul 8 08:05:07 2010 Log: Reorder outer 'this' constructor arguments to come before user arguments. The main purpose of this change is to remove the impedance mismatch between our constructor argument order, and the argument order for JSNI ::new() invocations. Our constructors put the synthetic this args after user args, JSNI ::new() puts the args before user args. Once this impedance mismatch is cleared up, in a follow up change I plan to remove the static synthetic 'new' methods in favor of targeting the constructors directly. http://gwt-code-reviews.appspot.com/675801/show Review by: tobyr http://code.google.com/p/google-web-toolkit/source/detail?r=8365 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java Thu Jun 24 15:39:22 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java Thu Jul 8 08:05:07 2010 @@ -77,7 +77,6 @@ import java.util.ArrayList; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Set; @@ -177,19 +176,11 @@ program.getTypePrimitiveInt(), true, false, newCtor); } -// user args -mapParameters(newCtor, ctorDecl); -addThrownExceptions(ctorDecl.binding, newCtor); -// original params are now frozen - -info.addCorrelation(program.getCorrelator().by(newCtor)); - -int syntheticParamCount = 0; ReferenceBinding declaringClass = b.declaringClass; +SetString alreadyNamedVariables = new HashSetString(); if (declaringClass.isNestedType() !declaringClass.isStatic()) { - // add synthetic args for outer this and locals + // add synthetic args for outer this NestedTypeBinding nestedBinding = (NestedTypeBinding) declaringClass; - SetString alreadyNamedVariables = new HashSetString(); if (nestedBinding.enclosingInstances != null) { for (int i = 0; i nestedBinding.enclosingInstances.length; ++i) { SyntheticArgumentBinding arg = nestedBinding.enclosingInstances[i]; @@ -198,11 +189,22 @@ argName += _ + i; } createParameter(arg, argName, newCtor); - ++syntheticParamCount; alreadyNamedVariables.add(argName); } } - +} + +// user args +mapParameters(newCtor, ctorDecl); +// original params are now frozen + +addThrownExceptions(ctorDecl.binding, newCtor); + +info.addCorrelation(program.getCorrelator().by(newCtor)); + +if (declaringClass.isNestedType() !declaringClass.isStatic()) { + // add synthetic args for locals + NestedTypeBinding nestedBinding = (NestedTypeBinding) declaringClass; if (nestedBinding.outerLocalVariables != null) { for (int i = 0; i nestedBinding.outerLocalVariables.length; ++i) { SyntheticArgumentBinding arg = nestedBinding.outerLocalVariables[i]; @@ -211,7 +213,6 @@ argName += _ + i; } createParameter(arg, argName, newCtor); - ++syntheticParamCount; alreadyNamedVariables.add(argName); } } @@ -222,11 +223,7 @@ // Now let's implicitly create a static function called 'new' that will // allow construction from JSNI methods if (!enclosingType.isAbstract()) { - ReferenceBinding enclosingBinding = ctorDecl.binding.declaringClass.enclosingType(); - JReferenceType outerType = enclosingBinding == null ? null - : (JReferenceType) typeMap.get(enclosingBinding); - createSyntheticConstructor(newCtor, - ctorDecl.binding.declaringClass.isStatic(), outerType); + createSyntheticConstructor(newCtor); } return true; @@ -402,8 +399,7 @@ * constructed. This may be codenull/code if the class is a * top-level type. */ -private JMethod createSyntheticConstructor(JConstructor constructor, -boolean staticClass, JReferenceType enclosingType) { +private JMethod createSyntheticConstructor(JConstructor constructor) { JClassType type = constructor.getEnclosingType(); // Define the method @@ -418,43 +414,19 @@ JNewInstance newInstance = new JNewInstance( type.getSourceInfo().makeChild(BuildDeclMapVisitor.class, new instance), constructor, type); - - /* - * If the type isn't static, make the first parameter a reference to the - * instance of the enclosing class. It's the first instance to allow the - * JSNI qualifier to be moved without
[gwt-contrib] [google-web-toolkit] r8367 committed - Updated the target in maven repo to M2....
Revision: 8367 Author: amitman...@google.com Date: Thu Jul 8 08:12:05 2010 Log: Updated the target in maven repo to M2. Patch by: amitmanjhi Review by: jasonparekh http://code.google.com/p/google-web-toolkit/source/detail?r=8367 Modified: /trunk/tools/scripts/maven_script.sh === --- /trunk/tools/scripts/maven_script.shFri Jun 25 08:42:47 2010 +++ /trunk/tools/scripts/maven_script.shThu Jul 8 08:12:05 2010 @@ -22,8 +22,8 @@ for i in dev user servlet do - mvn install:install-file -DgroupId=com.google.gwt -DartifactId=gwt-${i} -Dversion=2.1.0.M1 -Dpackaging=jar -Dfile=build/lib/gwt-${i}.jar -DgeneratePom=true + mvn install:install-file -DgroupId=com.google.gwt -DartifactId=gwt-${i} -Dversion=2.1.0.M2 -Dpackaging=jar -Dfile=build/lib/gwt-${i}.jar -DgeneratePom=true done touch /tmp/empty-fake-soyc-vis.jar -mvn install:install-file -DgroupId=com.google.gwt -DartifactId=gwt-soyc-vis -Dversion=2.1.0.M1 -Dpackaging=jar -DgeneratePom=true -Dfile=/tmp/empty-fake-soyc-vis.jar +mvn install:install-file -DgroupId=com.google.gwt -DartifactId=gwt-soyc-vis -Dversion=2.1.0.M2 -Dpackaging=jar -DgeneratePom=true -Dfile=/tmp/empty-fake-soyc-vis.jar echo installed the gwt libs in the maven repo -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] [google-web-toolkit] r8369 committed - Update 2.1 M2 Maven repo with updated M2 artifacts.
Hi Guys, I just noticed that there was an update to the Maven artefacts for M2. Without meaning to be presumptuous, I just wanted to check that you know that current users of M2 with Maven won't receive the updates from the repository because the artefacts aren't snapshots. To receive the updates, they'll need to delete the existing ones from their local repositories. Please ignore if I've missed the point! Cheers, Daniel On 9 July 2010 08:20, codesite-nore...@google.com wrote: Revision: 8369 Author: jasonpar...@google.com Date: Thu Jul 8 13:56:20 2010 Log: Update 2.1 M2 Maven repo with updated M2 artifacts. http://code.google.com/p/google-web-toolkit/source/detail?r=8369 Modified: /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/2.1.0.M2/gwt-servlet-2.1.0.M2.jar /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/2.1.0.M2/gwt-servlet-2.1.0.M2.jar.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/2.1.0.M2/gwt-servlet-2.1.0.M2.jar.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/maven-metadata.xml /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/maven-metadata.xml.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/maven-metadata.xml.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-soyc-vis/2.1.0.M2/gwt-soyc-vis-2.1.0.M2.jar /2.1.0.M2/gwt/maven/com/google/gwt/gwt-soyc-vis/2.1.0.M2/gwt-soyc-vis-2.1.0.M2.jar.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-soyc-vis/2.1.0.M2/gwt-soyc-vis-2.1.0.M2.jar.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-soyc-vis/maven-metadata.xml /2.1.0.M2/gwt/maven/com/google/gwt/gwt-soyc-vis/maven-metadata.xml.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-soyc-vis/maven-metadata.xml.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-user/2.1.0.M2/gwt-user-2.1.0.M2.jar /2.1.0.M2/gwt/maven/com/google/gwt/gwt-user/2.1.0.M2/gwt-user-2.1.0.M2.jar.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-user/2.1.0.M2/gwt-user-2.1.0.M2.jar.sha1 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-user/maven-metadata.xml /2.1.0.M2/gwt/maven/com/google/gwt/gwt-user/maven-metadata.xml.md5 /2.1.0.M2/gwt/maven/com/google/gwt/gwt-user/maven-metadata.xml.sha1 === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar Thu Jul 8 13:56:20 2010 File is too large to display a diff. === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar.md5 Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar.md5 Thu Jul 8 13:56:20 2010 @@ -1,1 +1,1 @@ -e6e946bb45e8d20b98cf374e969c417b +34d17a1d650e7bc7982d6f7dd2d96152 === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar.sha1 Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/2.1.0.M2/gwt-dev-2.1.0.M2.jar.sha1 Thu Jul 8 13:56:20 2010 @@ -1,1 +1,1 @@ -683b8e4f09a34262f399ad6963a4941df7388a83 +8d7b35b70f1309f790bda19f131445bfb20fd66a === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml Thu Jul 8 13:56:20 2010 @@ -7,6 +7,6 @@ versions version2.1.0.M2/version /versions -lastUpdated20100701144018/lastUpdated +lastUpdated20100708204159/lastUpdated /versioning /metadata === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml.md5 Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml.md5 Thu Jul 8 13:56:20 2010 @@ -1,1 +1,1 @@ -83c996c9a5333cc1f5547fb88a3db0a7 +87a38fb30b2744cd3554a86d496c6357 === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml.sha1 Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-dev/maven-metadata.xml.sha1 Thu Jul 8 13:56:20 2010 @@ -1,1 +1,1 @@ -e500018ffabacf49c5825bc66dee0e26ffc68f74 +807356d40925bda386a79cd5da37bee7647d243e === --- /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/2.1.0.M2/gwt-servlet-2.1.0.M2.jar Fri Jul 2 10:29:54 2010 +++ /2.1.0.M2/gwt/maven/com/google/gwt/gwt-servlet/2.1.0.M2/gwt-servlet-2.1.0.M2.jar Thu Jul 8 13:56:20 2010 File is too large to display a diff.
Re: [gwt-contrib] History token encoding issues
I settled for an alternate implementation of HistoryImpl that can be seen on the rawhistory branch of our gwt-traction project here: FWIW, I think this is a good idea. Thanks for linking to your other HistoryImpl--I will keep the link handy. - Stephen -- http://groups.google.com/group/Google-Web-Toolkit-Contributors