RequestFactory, frozen autobeans, and MVP
I'm trying to convert an app from using plain JSON to using RequestFactory. The app has a view and presenter. So, I use the RequestFactory to get Contact instances, and pass them on the view to edit. But, the editing runs into an issue with the AutoBean being frozen. Without MVP, I would just open a request, invoke edit and pass the bean, and be done. But, it doesn't seem right to now do that in the view. And, I have an issue with holding a request open just to enable editing the bean, when it's conceivable that the user will bail out and not end up saving their changes. So, what would the best flow be for this situation? -- You received this message because you are subscribed to the Google Groups "GWT Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: How to figure out HTMLPanel rendering is complete
I think there are three things that need to happen each time you get more content, at least two of which are asynchronous: 1. your ajax call to get content, asynchronous 2. when you place received HTML code into document, browser will start to render HTML, but without the images yet. I believe that if you run the deferred command as suggested just after setting the HTML content into the panel, it will run when the HTML is fully rendered, but w/o any images in place 3. browser will start to load referenced images (from img tags src attributes) and other items with src, possibly in parallel with the rendering of the HTML If you really don't want to start loading any new content until the HTML and images are fully loaded, then you would need some mechanism to know when all the images are complete. You might actually want to still use a deferred command at this point, since the point in time where images are loaded is probably earlier than the point where they are actually rendered. You can help out the process if you control the incoming HTML, by using height and width attributes in the img tags. That way the placeholders will be sized immediately, and you wouldn't have to wait until they have loaded. Unfortunately, I believe that this gets in the way of responsive design, since it prevents a max-width css rule from working correctly. On Tuesday, October 21, 2014 9:13:22 AM UTC-4, sch wrote: Thanks for the reply. Since we do NOT want to make a server call until the rendering is complete I am not sure if scheduleDeferred would help. Please correct if I am wrong. On Saturday, 18 October 2014 00:42:44 UTC+5:30, Raphael Garnier wrote: Hi, Maybe you could use scheduleDeferred of Scheduler to run code when the DOM is done. See http://www.gwtproject.org/javadoc/latest/com/google/gwt/core/client/Scheduler.html#scheduleDeferred(com.google.gwt.core.client.Scheduler.ScheduledCommand) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: CellTable - How to programmatically start editing a cell.
Found this old thread, and thought it worth commenting. I took a variant of Ralf's approach in an effort to get tabbing/enter key movement to the next cell. In my recreation of EditTextCell, I revised the commit method: private void commit(Context context, final Element parent, ViewData viewData, ValueUpdaterString valueUpdater) { String value = updateViewData(parent, viewData, false); clearInput(getInputElement(parent)); setValue(context, parent, viewData.getOriginal()); if (valueUpdater != null) { valueUpdater.update(value); } Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { NativeEvent clickEvent = Document.get().createClickEvent(1, 0, 0, 0, 0, false, false, false, false); Element td = parent.getParentElement(); Element nextTd = td.getNextSiblingElement(); if (nextTd != null){ nextTd.dispatchEvent(clickEvent); } } }); } It seems to work, and has the benefit that I don't need to extend or rewrite every possible editable cell type. But, I don't know if there are any pitfalls that I've missed, other than it won't jump over a non-editable column to the subsequent editable column, and it won't jump to the next row. Steve On Friday, April 13, 2012 1:16:10 PM UTC-4, Alfredo Quiroga-Villamil wrote: Scenario is as follows: - CellTable with a column containing an EditTextCell. - Add new record to the ListDataProvider. - I can edit and do all the good stuff by hand to the newly added record in the CellTable. Requirement: - Programmatically call a starttEdit on say the first cell of the newly created row/record. My investigation results: After going through the code and investigating, all roads seem to point to ViewData in EditTextCell. Specifically, ViewData in EditTextCell has setEditing(boolean) which should do the trick. However, ViewData has package access. Before I go and start to override, copy/paste things to be able to access the ViewData member I need, I figured I ask first since this seems like a basic operation when adding new records to a CellTable. I am thinking that I am very likely missing something. Any help/pointers are appreciated. Thanks, Alfredo -- Alfredo Quiroga-Villamil AOL/Yahoo/Gmail/MSN IM: lawwton -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: How to figure out HTMLPanel rendering is complete
I'm guessing that you're doing incremental loading - that as soon as the user reaches the bottom of the current content, you get more? You could remove the scroll handler when you start to load the HTML, and then restore it when the HTML has been received. Or have the loading mechanism set a flag and unset it when done, and the scroll handler checks that flag before doing anything (maybe better to use an integer count, increment when starting load, decrement when complete, and scrolll handler only works when it's zero. But, if there are images in the received content, they will be loading asynchronously after that, which will affect the size of the content. The best* way I can think of to handle that is to scan the received HTML looking for img tags, and then add a native JS load/error handler to each one, and keep a running count. the load handler would decrement the count, and, when it reaches 0, all images will be loaded. You might still need a deferred command, since just because the image has loaded doesn't mean that the DOM has reflowed. *Maybe the second best way. If you used an iframe as your loader instead of GWT's Ajax mechanism, you could set a readystatechange handler. ReadyState 4 is supposed to mean that everything has been received, including images. But, I don't know how well supported that is across browsers. On Friday, October 17, 2014 8:34:25 AM UTC-4, sch wrote: I am working on an application which fetches HTML content from the server and displays it to the user. The content fetched from the server is a complete HTML document. I have used UiBinder to specify UI for the view. g:HTMLPanel ui:field=mainPanel styleName=ap-mainPanel/g:HTMLPanel In the view I have setViewerContent(String content) method and also a member panel for holding content[contentPanel] public void setViewerContent(String content){ contentPanel = new HTMLPanel(content); contentPanel.setStyleName(ap-mainPanel ap-scrollPanel); //$NON-NLS-1$ contentPanel.addAttachHandler(new AttachEvent.Handler() { @Override public void onAttachOrDetach(AttachEvent event) { if(event.isAttached()) { System.out.println(-- rendering complete --); isRenderComplete = true; } } }); mainPanel.clear(); mainPanel.add(contentPanel); addScrollHandler();} I add a scroll handler to the contentPanel which listens to the ScrollEvent and onScroll() calls the appropriate methods to fetch content from the server based on whether scroll is at the top or bottom. public void addScrollHandler() { Event.sinkEvents(contentPanel.getElement(), Event.ONSCROLL); contentPanel.addHandler(this, ScrollEvent.getType());} public void onScroll( ScrollEvent event ){ if( HelperUtils.isScrollAtBottom( event.getSource() ) ) { if(isRenderComplete) { System.out.println(-- Process Down scroll START--); isRenderComplete = false; getUiHandlers().reachedMaxVerticalScrollPostion(); System.out.println(-- Process Down scroll END--); } } if( HelperUtils.isScrollAtTop( event.getSource() ) ) { if(isRenderComplete) { System.out.println(-- Process Up scroll START--); isRenderComplete = false; getUiHandlers().reachedMinVerticalScrollPostion(); System.out.println(-- Process Up scroll END --); } }} The problem I was facing was as we render the content I see calls made to the server to fetch content continuously. New scroll events are being fired while the content fetched from the server is being rendered. We would not want this i.e while the content is being rendered we do not want the ScrollEvent to be fired. I tried the above code where I have attached AttachEvent.Handler() to contentPanel. A flag isRenderComplete is maintained which is turned true on contentPanel attach. This flag is used in the onScroll method before triggering any server call.This approach seems to work. But I am not sure if this is the correct one. Does anyone has any better solution[s] ?If the content has images and other external stuff will they be loaded before AttachEvent is fired ? Also since we are creating new contentPanel everytime each fetch takes the scrollbar to the top. I tried to add a new HTMLPanel markerPanel with couple of line breaks to the contentPanel. Then in the onAttachOrDetach() of contentPanel tried to scroll to the markerPanel. This did not work. public void setViewerContent(String content){ contentPanel = new HTMLPanel(content); markerPanel = new HTMLPanel( br br ); contentPanel.setStyleName(ap-mainPanel ap-scrollPanel); //$NON-NLS-1$ contentPanel.addAttachHandler(new AttachEvent.Handler() { @Override public void
Re: How to figure out HTMLPanel rendering is complete
I'm guessing that you're doing incremental loading - that as soon as the user reaches the bottom of the current content, you get more? You could remove the scroll handler when you start to load the HTML, and then restore it when the HTML has been received. Or have the loading mechanism set a flag and unset it when done, and the scroll handler checks that flag before doing anything (maybe better to use an integer count, increment when starting load, decrement when complete, and scrolll handler only works when it's zero). But, if there are images in the received content, they will be loading asynchronously after that, which will affect the size of the content. The best* way I can think of to handle that is to scan the received HTML looking for img tags, and then add a native JS load/error handler to each one, and keep a running count. The load handler would decrement the count, and, when it reaches 0, all images will be loaded. You might still need a deferred command, since just because the image has loaded doesn't mean that the DOM has reflowed. *Maybe the second best way. If you used an iframe as your loader instead of GWT's Ajax mechanism, you could set a readystatechange handler. readyState 4 is supposed to mean that everything has been received, including images. But, I don't know how well supported that is across browsers. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: ie10 permutation causing browser errors? (gwt 2.6.1) really baffled here.
You should try to get your hands on a real IE10. My experience with IE11 is that its emulation of earlier versions is far from perfect, particularly with the JS engine. I've had GWT code that failed in IE11 emulating IE10, but worked fine in a real IE10. On Friday, October 3, 2014 1:49:10 PM UTC-4, darkflame wrote: Ok, it also works if its left as Edge, but the user agent is explicitly set to Internet Explorer 10 Whatever Ie10s default user agent is (ie, not touching the settings) does not work, however. IE is weird. It looks like my workaround is simple then; force it to use Ie10 mode and not compatibility? (although Edge would be better for future proofing wouldn't it?) ~~~ Thomas Bertines online review show: http://randomreviewshow.com/index.html Try it! You might even feel ambivalent about it :) On 3 October 2014 19:37, Thomas Wrobel dark...@gmail.com javascript: wrote: ah, ok...hmm. It crashes in EDGE which is selects by default. It works in 10 if its specifically set to that. It works in 9 (but other stuff is broken, which is expected) (This was tested using IE's emulation selector) Could my html markup be making IE select Edge wrongly? Isn't Edge supposed to be the newest it can manage? ~~~ Thomas Bertines online review show: http://randomreviewshow.com/index.html Try it! You might even feel ambivalent about it :) On 3 October 2014 19:28, Jens jens.ne...@gmail.com javascript: wrote: Could it be that your IE 10 runs in compatibility mode? In that case it might not support JavaScript String.replace(). -- J. -- -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: Using datagrid.redrawRow after failed cell validation
Thanks - that did the trick. In retrospect, I should have realized that from the discussion of view data in the Javadocs. On Thursday, October 2, 2014 3:22:28 PM UTC-4, Jens wrote: Don't you want to clearViewData() in the catch block so you clear the pending change if the parser throws an exception? e.g. @Override public void update(final int index, R item, String value) { try { double doubleValue = 0.0; if (value != null !value.isEmpty()) { doubleValue = MyFormat.PARSER.parse(value); } item.setAmt(doubleValue); } catch(Exception e) { // parser does not like value, so reset pending change thisCell.clearViewData(item); } grid.redrawRow(index); }); -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Using datagrid.redrawRow after failed cell validation
I'm updating a double value in a datagrid to using a custom parser on an EditTextCell. If the parser throws an error, then I'm trying to put the original value back by redrawing the row. But, the erroneous value stays in place. Stepping through the code, I do see it going through HasDataPresenter's setRowData method, and even see the original value in the row object. But, that value doesn't get drawn. If I now click on the cell again, then click away without editing, then the original value does get written into the cell. That led me to try a deferred command, which didn't work, hence code below with a ridiculous delay before redrawing (which, needless to say, also doesn't work). If it makes any difference, I'm using a SingleSelectionModel. Am I doing something wrong here? Or is there a better way to check the values as they're being entered? @Override public void update(final int index, R item, String value) { double doubleValue = 0.0; boolean needsRedraw = false; try { if (value != null !value.isEmpty()) { doubleValue = MyFormat.PARSER.parse(value); needsRedraw = true; // added } item.setAmt(doubleValue); thisCell.clearViewData(item); } catch(Exception e) { needsRedraw = true; } if (needsRedraw) { //grid.redrawRow(index); Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand() { public boolean execute() { grid.redrawRow(index); return false; } }, 1000); } } }); -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: extend UiBinder engine
That's what I figured :) On Tuesday, June 3, 2014 4:22:57 AM UTC-4, Thomas Broyer wrote: What I meant is that the factory you give to UiBinder would work the same as a @UiFactory in your class: no need for a @UiField/ui:field; if you have a foo:MyWidget/ in your ui.xml, whether it has a ui:field or not, it'll be created by the factory. My proposal was just to be able to move @UiFactory methods into a class that could be shared by several UiBinder instances; i.e. exactly what you asked for ;-) I should have answered: “you're right, it's not possible, but I proposed the exact same thing in issue 6151” ;-) I've been contemplating other avenues of UI generation, like HTMLPanel. I've tried using a JSP to generate a block of HTML dynamically, usually including looping, and retrieve that using RequestBuilder, and putting that into an HTMLPanel. The only difficult part is managing the id's of various elements. And of course, having half the code in src, and the other half under war - but I could use a generator class under src to get around that. It seems that a dynamic version of UiBinder or UiRenderer would be possible, since GWT has client runtime XML processing capabilities. And the set of available tags could be expanded to include some analogs to the JSP core tags, like c:forEach. The Java class would have to be created in advance, so either there would need to be fields for all possible widgets, with nulls legal, or the widgets could be entries in a map instead of class properties. Widgets resulting from a loop would be in an array or List. Maybe someday in my copious free time, I'll play around with that. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
java.util.Date emulation Year 00 issue
If I use a com.google.gwt.i18n.client.DateTimeFormat with my own pattern, like -MM-dd, I run into the situation described in the Javadocs under Additional Parsing Considerations if the user enters a two digit year 00 (most likely intending it to be the year 2000). The following code: DateTimeFormat fmt = DateTimeFormat.getFormat(-MM-dd); Date d = fmt.parse(00-01-01); System.out.println(d + getYear: + d.getYear() + getTime: + d.getTime()); long d1 = d.getTime(); d = fmt.parse(01-01-01); System.out.println(d + getYear: + d.getYear() + getTime: + d.getTime()); long d2 = d.getTime(); long diff = d2 - d1; System.out.println((diff/1000.0/60/60/24/366)); Results in: Thu Jan 01 00:00:00 EST 1 getYear: -1899 getTime: -6216737400 Sat Jan 01 00:00:00 EST 1 getYear: -1899 getTime: -6213575160 1.0 So, I believe that internally the date is on the right year, since the two dates are different by 366 days (apparently year 0 was a leap year), but when getting the year from it, it adjusts year 0 to 1. This is messing up logic I have with a custom extension of DateTimeFormat to adjust how two-digit years are parsed - the first step in parse is super.parse(text), and then I do my own adjustment by 1900 or 2000 after that. So, entries of 00 are being turned into 2001. This is actually a Java problem, and we can get into a long metaphysical discussion of whether there really should be a year 0 or not, but it does affect parsing, and I believe that the way that DateTimeFormat handles two-digit years supplied to a pattern brings it to the forefront. So, the question is, should GWT's Date emulation be faithful to its Java equivalent, or behave in a manner consistent with DateTimeFormat? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: extend UiBinder engine
For those us that might encounter this need for somewhat simple situations, why not use a @UiFactory? That provides a reasonably clean solution that separates the security aspects. Provide a parameter like roles to the create method, which could parse a comma-separated list of roles in a string to determine whether to show or hide. g:FlowPanel g:TextBox addStyleNames=test ui:field=txtA roles=admin,sales/ g:TextBox addStyleNames=test ui:field=txtB roles=guest/ /g:FlowPanel @UiFactory public TextBox create(String roles) { TextBox txtBox = new TextBox(); txtBox.setVisible(Roles.hasAccess(roles)); return txtBox; } } Roles would know the current user role(s) and determine if one of the roles in the user matches one of the valid roles for the widget. It would be nice if the UiFactory methods could somehow be separated out into their own class for reuse, but I don't think that's possible. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: extend UiBinder engine
Yeah, that would be useful. I'm kind of curious about the part: I'd like to see something a bit more advanced where you don't need to declare the @UiFields. I may be misinterpreting that, since I don't see how you could use the Java class without the fields. Or you just talking about assuming the presence of the annotation, since the Java field names have to match the ui:field attributes in the xml anyway? On Monday, June 2, 2014 12:21:33 PM UTC-4, Thomas Broyer wrote: On Monday, June 2, 2014 3:32:41 PM UTC+2, Steve C wrote: It would be nice if the UiFactory methods could somehow be separated out into their own class for reuse, but I don't think that's possible. Cf. the discussion in https://code.google.com/p/google-web-toolkit/issues/detail?id=6151 -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: ListBox how set selected item by value
One of the first things I ever put into my personal utility classes module was an extension of ListBox to have setValue(String) and getValue(String) methods. Or, you could use ValueListBox instead of ListBox, but it's kind of a pain to work with due to the need for a Renderer. (But, it does allow the use of object values, not just Strings). On Thursday, May 29, 2014 5:58:48 AM UTC-4, Ivano Vingiani wrote: Create a Widget that extends (or wrap) ListBox that implements setValue(value) On Wednesday, May 20, 2009 8:32:22 AM UTC+1, zeroonea wrote: when i load data to form to edit, how i set selected item in listbox by value -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: Override html styles with css resource
I have no idea why that would be the case. Most non-GWT mobile web development makes heavy use of CSS media queries, which, unless there's been a change I missed, can't be used in CssResource. On Wednesday, May 7, 2014 5:16:27 AM UTC-4, Dominic Warzok wrote: Hi, as the gwt documentaion says the common way to apply styles is to use css resources. Now I try to implement cssresoures to my webapp. But I don't find an example how to override standard html attributes. For example I want to style a link. In normal CSS I use: a{ color: xxx; } a:hover{ color: anotherColor; } Is this possible in CSS Resources ? Thanks in advance ;) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
empty table widget size and reuse
I'd like to have an empty table widget in a DataGrid, which would cover the entire width and height of the table area. Basically, I'd like to just have a vertically and horizontally centered label. Right now I can only get one that occupies the minimum area it needs based on it's content size, or I could fix a size in px. But, trying to set the size to 100% for width and/or height has no effect, because it gets put inside a table that I believe I have no code access to. And that table has no sizing specified. Is there a way to do this? Question 2: I'd also like to have just one of these, to use across multiple grids. But, assigning the same widget instance to all my grids doesn't work - I don't see it. I suspect that it would show up for the last grid I added it to, if I can figure out which one that is. It seems that the grid widget could store the reference and reattach it each time it's needed, allowing one single instance to be reused. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: Override html styles with css resource
I wouldn't say that the recommended way to create CSS is to use CssResource. If I just want to create general styling, there's nothing wrong with the CSS-file-in-the-war-directory approach. Keep in mind that using a CssResource will require a full recompile if you change anything, while just changing the linked CSS file in the war directory won't. On Wednesday, May 7, 2014 5:16:27 AM UTC-4, Dominic Warzok wrote: Hi, as the gwt documentaion says the common way to apply styles is to use css resources. Now I try to implement cssresoures to my webapp. But I don't find an example how to override standard html attributes. For example I want to style a link. In normal CSS I use: a{ color: xxx; } a:hover{ color: anotherColor; } Is this possible in CSS Resources ? Thanks in advance ;) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Datagrid cell navigation by tabbing
Is anyone else interested enough in being able to navigate within a DataGrid by tabbing that I should raise it as an issue? I see in classes like EditTextCell that the templates assign a tabindex of -1, so this behavior seems unavailable by design, and I fear that the code to achieve it might be pretty horrendous. But, this is one situation where behaves like Access would be nice. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Inline style vs class for cell renderer
I'm wondering if anyone has done any efficiency testing on using inline styles vs class in cell renderers. Right now I'm using a template with two methods: @Template(div style='text-align:right'{0}/div) public SafeHtml valid(String value); @Template(div style='text-align:right' class='{1}'{0}/div) public SafeHtml invalid(String value, String invalidStyle); I used an inline style for the text-alignment, but it occurred to me that I could use a class for that instead if it would be rendered more efficiently by the browser. Has anyone tried comparing the two approaches? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: Is there any chance to fix this issue in upcoming 2.6.1?
Any chance we can retitle this so we all know what it's about? :) On Monday, March 24, 2014 3:42:38 PM UTC-4, Slava Pankov wrote: I've found nasty bug when using ui:import in UiBinder template. Looks like the solution is very simple/tiny change in UiBinderParser.java, is it possible to include it to upcoming GWT 2.6.1? http://code.google.com/p/google-web-toolkit/issues/detail?id=8641 -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: DataGrid on a hidden tab
I'm still seeing this issue using GWT2.6.0. For the tab that was visible when the grids were drawn, I see this structure: div class=gwt-TabLayoutPanelContent style=position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; div class=GPBYFDEIH style=position: relative; overflow: hidden; height: 100%; __gwtcellbasedwidgetimpldispatchingfocus=true __gwtcellbasedwidgetimpldispatchingblur=true div style=position: absolute; left: 0px; width: 100%; top: 0px; min-width: 20px; min-height: 20px; overflow: hidden;/div div style=position: absolute; left: 0px; width: 100%; bottom: 0px; min-width: 20px; min-height: 20px; overflow: hidden;/div div style=position: absolute; left: 0px; width: 100%; overflow: hidden; top: 25px; height: 77px; For a tab that wasn't visible when the grids were drawn, I see this: div class=gwt-TabLayoutPanelContent style=position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; div class=GPBYFDEIH style=position: relative; overflow: hidden; height: 100%; __gwtcellbasedwidgetimpldispatchingfocus=true __gwtcellbasedwidgetimpldispatchingblur=true div style=position: absolute; left: 0px; width: 100%; top: 0px; min-width: 20px; min-height: 20px; overflow: hidden;/div div style=position: absolute; left: 0px; width: 100%; bottom: 0px; min-width: 20px; min-height: 20px; overflow: hidden;/div div style=position: absolute; left: 0px; width: 100%; overflow: hidden; top: 0px; height: 0px; The last div shown, which is what eventually holds the table, has top 0 and height 0 if the tab wasn't visible when the grid was drawn. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
Re: Custom widget with custom UiBinder markup
Some additional questions in the absence of a full dev guide: 1. What about a class that extends TabLayoutPanel? I can write and annotate a method addTab(Widget w) in order to use the xxx:tab child instead of g:tab, but what about the grandchild g:header that the g:tab could have had? 2. Can the first parameter to the annotated method be a subclass of Widget to restrict the possible types? Steve On Friday, February 3, 2012 12:44:00 PM UTC-5, Paul Stockley wrote: Add two methods @UiChild public void addLeft(Widget w) {...} @UiChild public void addRight(Widget w) {..} Then make sure you widget implements HasWidgets or similar. In your uibinder you can now use custom:mywidget ui:field=widget custom:left!-your widgetcustom:/left custom:right!-your widgetcustom:/right !- your widget !- your widget !- your widget /custom:mywidget -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: SplitLayoutPanel particulars
AFAIK, there is no way to disable a splitter in SplitLayoutPanel. But, you can use a plain LayoutPanel as the container, and its children would be the original right side widget, and the left side as a SplitLayoutPanel with just two pieces (probably West and Center). So, the former East part wouldn't be in the SplitLayoutPanel any more, it would be in the container LayoutPanel. On Thursday, February 20, 2014 3:24:26 PM UTC-5, Blake wrote: Greetings, As sort of a pseudo continuation of my last email, I switched to a SplitLayoutPanel. That gave me everything I was looking for and a movable partition to boot. I do experience two new problems that I haven't found a solution for. I really appreciate the help. The two problems I am having is: 1. There is a user adjustable splitter in the middle of the two halves. This is perfect. The problem is that I also have a user adjustable splitter at the far right too. I do not want that. How can I get rid of that? 2. Related to item 1, the SplitLayoutPanel fills up the browser window as I want. However, when the browser window is resized the SplitLayoutPanel auto-resizes vertically as I want but does not auto-resize horizontally. (Probably the reason for the far right splitter!) So, I want no far right splitter, and I want the SplitLayoutPanel to auto-resize both vertically and horizontally. My code looks like this: Widget leftBottom = ...; Widget leftTop = ...; Widget rightBottom = ...; Widget rightTop = ...; SplitLayoutPanel layout = new SplitLayoutPanel(); int totalWidth = RootLayoutPanel.get().getOffsetWidth() - layout.getSplitterSize() * 2; DockLayoutPanel dlp1 = new DockLayoutPanel(Style.Unit.PT); dlp1.addSouth(leftBottom, 35); dlp1.add(leftTop); layout.addWest(dlp1, totalWidth/2); DockLayoutPanel dlp2 = new DockLayoutPanel(Style.Unit.PT); dlp2.addSouth(rightBottom, 35); dlp2.add(rightTop); layout.addWest(dlp2, totalWidth/2); I go for long periods of time developing just fine but run into problems every time I try something new. Your help is really appreciated. Thanks. Blake McBride -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Latest Google Eclipse update has hosed my Eclipse
I just updated my Google plugin for Eclipse, per a notification that popped up this morning. My current project now shows a lot of errors, and several error dialogs pop up when I try to open an existing GWT project workspace. Java editors and some other panes, like the class outline, just show big red X's. The errors I get are JVM version is 1.0.0; version 1.7.0 or later is needed to run Google Plugin for Eclipse. I can't pull up most of the Google-related properties, either. They show an error popup the first time I go to use them, and then just an error message in the panel after that. I tried pointing Eclipse to my JRE1.7, but that didn't help. I really hope that I don't need to set 1.7 as the Java version for GWT projects now, since several current projects are tied to 1.6,and changing that is not in my control. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: Latest Google Eclipse update has hosed my Eclipse
After my initial post, I had gone to Eclipse docs and per them had put in: --vm C:\Program Files\Java\jdk1.7.0_45\jre\bin\javaw.exe just above the --vmargs line, but that didn't help. I also tried: --vm C:\Progra~1\Java\jdk1.7.0_45\jre\bin\javaw.exe which has worked with system paths, but still no luck. But, taking a closer look at your post, I see that I had --vm, and it should have been just one dash: -vm All is good now :) On Sunday, December 29, 2013 2:33:57 PM UTC-5, Jens wrote: You can try to start Eclipse using Java7 instead of Java6: Open eclipse.ini and add (path is Mac OS specific, so change as needed): -vm /Library/Java/JavaVirtualMachines/jdk1.7.0_BUILDNUMBER/Contents/Home/bin/java The Google Plugin itself requires Java7, so Eclipse should be executed under Java7. The Java Version of your projects should be irrelevant. -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: Firing a ChangeEvent from a widget that wouldn't natively fire one
Jens, Thanks for the comments ... See below On Saturday, December 14, 2013 8:42:06 AM UTC-5, Jens wrote: Is there any reason to be concerned about firing a ChangeEvent from a composite based on a FlowPanel? I'm trying to track user edits within a form, in order to set a dirty data flag. Sometimes the form has subforms, each of which has it's own data dirty tracking. Basically, I'm handling ChangeEvents and ValueChangeEvents within the subform, and when those occur, I'm firing a ChangeEvent from the subform. It all seems to work, but I have a vague discomfort with it, knowing that things like textboxes and selects natively fire change events, but div tags don't. Is all the event management related to manually fired change events done entirely in GWT? Not sure if that has any bad consequences but I would guess it does not. Maybe some old IE's have bugs regarding event bubble'ing for change events. That was one of my main concerns. It works in IE10s emulation of IE8, but I've found that that emulation is far from perfect. Some things work in it that don't work in a real IE8. Fortunately, I'm not concerned with earlier IE. However, as dirty tracking is a logical thing I would fire a logical event and not a DOM event. I think I would have created a DirtyEvent/FormEditedEvent + Handler. Alternatively you could also create an interface DirtyTracker that has some methods like setDirty(Form/IsWidget) and have the top most class that controls your form hierarchy handle the dirtiness of all forms (you would pass the DirtyTracker down the Form hierarchy, and each form would call setDirty(this) if it detects that it is dirty). I'm actually going to fire an event like that from the panel containing all the widgets, but need to know when to do that. And, what I'm writing is a sort of framework to simplify things for folks writing the view classes, so the abstract base view has: protected void setChangeHandler(HasChangeHandlers ... widgets) { for (HasChangeHandlers widget : widgets) { widget.addChangeHandler(dataChangeHandler); } } and they can just pass it a list of widgets I may end up switching that to use ValueChangeHandlers instead, since almost every data widget fires them. But, ListBox doesn't implement HasValueChangeHandlers, because it has no concept of value. But, I already extend ListBox to give it setValue and getValue for strings, so I can fire a ValueChangeEventString. But, where that leaves me uncomfortable is that I don't consider that my subforms' overall concept of a value have changed, If they did, then I'd have to grab the value of the bean every time one field changed in order to supply a value with the event, or turn the change handling off after the first invocation makes it dirty, and then turn it back on again if the form is reset, or newly populated. Or, I'd have to implement firing the data dirty event from the subforms as well, which might be the best way to go. But, then the subforms in the main view need to be treated separately from the plain widgets, so I'd need two methods like the above, and users would have to invoke both, separating their components into widgets vs subforms. I also tried writing an overload of the above method using HasValueChangeHandlers ..., but that isn't distinguishable from the first version, according to the compiler. I suppose another approach would be to use Widget ..., and then test what the item is an instanceof. But then what to do if an item isn't either one - ignore it, or throw an exception? This is one place where it would be nice to have mixins - so I could just add some more logic to things like ValueBoxBase to fire my own custom value. As an aside, it's a little weird that ListBox fires ChangeEvent, and not ValueChangeEvent, while ValueListBox fires ValueChangeEvent but not ChangeEvent, given that they're both based on select tags. They serve different purpose. ListBox is the direct wrapper of the select tag while ValueListBox works on a higher level as it can deal with any kind of values not just strings. The fact that ValueListBox uses a ListBox internally is an implementation detail. I can see that, I guess what baffles me is why ListBox doesn't fire ValueChangeEventString, or ValueChangeEventInteger And, on a related note, it seems weird to me that many of the ValueBoxBase classes don't have a primary style, so that, for example, a TextBox looks different than an IntegerBox -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit
Firing a ChangeEvent from a widget that wouldn't natively fire one
Is there any reason to be concerned about firing a ChangeEvent from a composite based on a FlowPanel? I'm trying to track user edits within a form, in order to set a dirty data flag. Sometimes the form has subforms, each of which has it's own data dirty tracking. Basically, I'm handling ChangeEvents and ValueChangeEvents within the subform, and when those occur, I'm firing a ChangeEvent from the subform. It all seems to work, but I have a vague discomfort with it, knowing that things like textboxes and selects natively fire change events, but div tags don't. Is all the event management related to manually fired change events done entirely in GWT? As an aside, it's a little weird that ListBox fires ChangeEvent, and not ValueChangeEvent, while ValueListBox fires ValueChangeEvent but not ChangeEvent, given that they're both based on select tags. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
ListBox and default selection
In plain old HTML, I can create a select tag, and specify one option as selected, so that it comes up as the selection by default, or gets selected if the user resets the form. GWT doesn't appear to offer this capability - I don't see anything like setDefaultSelectedIndex(int index), or addItem(String itemText, boolean defaultSelected). Is this an oversight, or something that was done deliberately? The situation I'd like to use it for is a set of enumerated column values from a DB, to be listed in alphabetical order, but where the default value isn't the first. As it stands now, I'm going to have to keep track of the proper index to select when the form is cleared, as opposed to getting it done once when I initially set up the form. Hmm, that being said, it seems like there's no reset capability anyway - a ResetButton apparently belongs only in a FormPanel, and there's no reset method in ListBox. I suspect that I'm going to have to extend ListBox to provide a way to set a default selected index AND a reset capability. So, this turned into more of a rant than a question, but I'd still be interested in hearing if there was a specific reason those capabilities were left out, or if my anticipated extensions are a bad idea for some reason I haven't thought of. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: Changing css without recompiling
There are a number of different tricks you can use for dynamic styling. Because the StyleInjector is going to append to the head section, any style tags it injects will come after any existing content. One simple way to get your styles to override later appearing ones is to give the body tag an id, and then include that id in your rules. The resulting rule will have higher priority/precedence. Like: body#myid .gwt-Label { ... } You can use RequestBuilder to retrieve the CSS file via Ajax, then inject the resulting string using the StyleInjector. If your changes are just things like colors and background-image urls, and there aren't too many, you can write a class with static get methods to retrieve various values, like a color or url string. Populate the static fields backing those methods before injecting your CSS resource, and use things like @eval in the resource to retrieve the values within a rule. If you actually want to replace CSS at runtime - to reskin for some reason, the only way I can think of to do that would be to manually create your own style element, and set it's inner HTML to the contents of an Ajax-retrieved CSS file. To change the styling, retrieve the alternate CSS file, and overwrite the contents of your style tag. (I suppose it could be populated in the initial HTML, but given an id so you can access it later to replace the rules.) On Saturday, November 9, 2013 2:27:03 AM UTC-5, Aleks wrote: Hi all, My problem is related to this blog post - http://googlewebtoolkit.blogspot.com.au/2011/03/styling-and-skinning-your-apps-with.html. Namely, I have a gwt app, using UIBinder that I wish to be able to style without recompiling. I have a 'default' style that is defined in a css in the src packages and included in all the *.ui.xml templates via the ui:style src=.../ tag. Now I wish to be able to change the default style at runtime, but without recompiling. The link above suggests this is possible, and my understanding is also that they have default styles in the ui.xml files and then they override it in the static stylesheet included by the host html. I've tried this, deployed my app (in dev mode) with the following organisation: - the uibinder templates all reference a css file in a src package via the ui:style src=.../ tag - now my host.html also link's a different css where I use the same selectors with different values to override the style. This does NOT work! The externally linked css seems to have no effect. Looking at the generated html, I can see the styles from the src package being obfuscated, but the linked css (when I click on the link) is as normal - no obfuscation. I am guessing that is part of the problem since the generated html elements definitely reference the obfuscated selector names. Any ideas/hints on how to get this work or where I am going wrong? Thanks! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: Using Object in classes passed via GWT RPC
I don't see what you're talking about in the error printout, but do see a bunch of other things. One thing I found out the hard way is that you can't serialize a sublist - I have always assumed that it contains ties back to the original list, which would cause issues when serializing (like the framework would have to send the whole list anyway because of the back-link to it). So, there may be other problems that are causing the initial problem, and then not-so-clear error messages implying something else. Also, if I was going to have an Object field, I would type it as Serializable instead. On Friday, November 8, 2013 1:37:37 PM UTC-5, James Clough wrote: I am trying to return the result of a calculation from an RPC call, and having trouble with the GWT compiler. Specifically, the class I am returning has a field of type Object in it. This field can contain: String, Integer, Double, Long, Boolean or Date. If I change the Object field to type String, the compiler is happy. The thing that has me stumped is that I have other methods in the same RPC service that return similar objects containing Object fields and these are working correctly. I also have an RPC-based event mechanism that is returning event classes that contain MapString,Object and these appear to work correctly. I of course have to have another interface (a whitelist) that refers to the types I want to return in the Object fields to get serialization code generated for those types. Am I doing something wrong? I see the documentation says I can't return Object, but it's been working for a couple of years. Is there a better way to accomplish this? Here's the class of the object I'm trying to return: public class CalculationResult implements Serializable { private static final long serialVersionUID = 1L; private Object value = null; private PropertyType type; private ListLocalizedMessage errors; public CalculationResult() { super(); } public Object getValue() { return value; } public void setValue(Object value) { this.value = value; } public PropertyType getType() { return type; } public void setType(PropertyType type) { this.type = type; } public ListLocalizedMessage getErrors() { if( this.errors == null ) { this.errors = new ArrayListLocalizedMessage(); } return this.errors; } public void setErrors(ListLocalizedMessage errors) { this.errors = errors; } } PropertyType is a simple enum. LocalizedMessage is a serializable class containing only String and ListString fields and is used extensively in other RPC calls. When I compile my project with GWTC, I get the following: [java] Compiling module com.XX.XXx [java]Computing all possible rebind results for 'com.XX.gwt.ui.client.rpc.PMRPCService' [java] Rebinding com.XX.gwt.ui.client.rpc.PMRPCService [java] Invoking generator com.google.gwt.user.rebind.rpc.ServiceInterfaceProxyGenerator [java] Generating client proxy for remote service interface 'com.XX.gwt.ui.client.rpc.PMRPCService' [java]Checking type argument 0 of type 'java.util.Arrays.ArrayListE' because it is exposed as an array with a maximum dimension of 1 in this type or one of its subtypes (reached via com.XX .core.resources.calculation.CalculationResult) [java][ERROR] com.google.gwt.editor.client.adapters.ListEditorWrapperT, E is not default instantiable (it must have a zero-argu ment constructor or no constructors at all) and has no custom serializer. (reached via com.XX.core.resources.calculation.CalculationResult) [java][ERROR] com.google.gwt.user.client.ui.DelegatingChangeListenerCollection is not default instantiable (it must have a zero-a rgument constructor or no constructors at all) and has no custom serializer. (reached via com.XX .core.resources.calculation.CalculationResult) [java][ERROR] com.google.gwt.user.client.ui.DelegatingClickListenerCollection is not default instantiable (it must have a zero-ar gument constructor or no constructors at all) and has no custom serializer. (reached via com.XX .core.resources.calculation.CalculationResult) [java][ERROR] com.google.gwt.user.client.ui.DelegatingFocusListenerCollection is not default instantiable (it must have a zero-ar gument constructor or no constructors at all) and has no custom serializer. (reached via com.XX .core.resources.calculation.CalculationResult) [java][ERROR] com.google.gwt.user.client.ui.DelegatingKeyboardListenerCollection is not default instantiable (it must have a zero -argument constructor or no constructors at all) and has no custom serializer. (reached via com.XX .core.resources.calculation.CalculationResult) [java][ERROR]
Re: How to wire multiple editor to same bean.
My bad - had left one of the subpanel widget's Editor.Paths at by mistake. Fixed that and it worked fine. I'm not quite sure why that resulted in the error that I saw, though ... On Sunday, November 10, 2013 1:10:00 PM UTC-5, Steve C wrote: In trying Daniel's approach, I have a primary view class CompanyView implementing EditorCompany. It has several child AddressView objects, which implement EditorAddress; there are several Address fields in the Company. They get populated without my AddressView class ever invoking driver.edit or driver.flush (and I don't seem to need any set or getValue methods). But, that's just an aside. I then created a sub-editor PurchasingView also implementing EditorCompany, since the related data is in single fields within Company, instead of a sub-object. @UiField @Editor.Path() PurchasingView purchasingView; I assumed that the PurchasingView should define and GWT.create it's own driver interface, and that it's constructor should initialize that driver. When the time comes to edit the Company in the outer view in DevMode, or when I compile, I get the following error: Type mismatch: cannot convert from Company to String It refers me to some generated code, which begins with: public class PurchasingView__Context extends com.google.gwt.editor.client.impl.AbstractEditorContextjava.lang.String { And, as you might imagine, the methods it contains relate to String, not Company. I don't currently have get/setValue, but tried those as well, assuming that getValue ought to return driver.flush(), and setValue(Company value) ought to do driver.edit(value) - needless to say, that didn't help What am I missing here to get it to recognize that it should be editing a Company, not a String? On Wednesday, April 18, 2012 12:17:06 PM UTC-4, Thomas Broyer wrote: On Wednesday, April 18, 2012 5:49:56 PM UTC+2, saurabh saurabh wrote: Hi all, I don't have much experience with Editor frameworks so this question may appear naive or dumb. So suppose we have a big bean or proxy having a many fields. A good idea in view part could be having group them under TabLayoutPanel otherwise a big form on a page may not appear user friendly. Example: Patient Registration Form --- ||Personal Details || Patient Habbits || Family History || Medical History || Insurance || | --- | | | | | --- Here I feel comfortable to have five different UI like detailsView, habbitsView and so on and having them under one composite but all of 'em are concerned to one Class Patient. So my question is how I can wire multiple Editors to same bean, each for different set of properties. I don't find much on net for Editors, I guess it could be CompositeEditors, but I need some help for how to do it. See https://developers.google.com/web-toolkit/doc/latest/DevGuideUiEditors#Very_large_objects (and note that you can use @Path() to have a subeditor for the same object as is being edited). Alternatively, you can use several EditorDrivers on the same object; you'd just have to make sure they don't step on each others (that is, you don't edit the same field in two distinct EditorDrivers). The only difference is that you can edit() the object only when needed (e.g. when the tab is first revealed), but you'll have to flush() all the drivers that you called edit() on before saving your object, or you risk losing data (not persisting changes made by the user). -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to wire multiple editor to same bean.
In trying Daniel's approach, I have a primary view class CompanyView implementing EditorCompany. It has several child AddressView objects, which implement EditorAddress; there are several Address fields in the Company. They get populated without my AddressView class ever invoking driver.edit or driver.flush (and I don't seem to need any set or getValue methods). But, that's just an aside. I then created a sub-editor PurchasingView also implementing EditorCompany, since the related data is in single fields within Company, instead of a sub-object. @UiField @Editor.Path() PurchasingView purchasingView; I assumed that the PurchasingView should define and GWT.create it's own driver interface, and that it's constructor should initialize that driver. When the time comes to edit the Company in the outer view in DevMode, or when I compile, I get the following error: Type mismatch: cannot convert from Company to String It refers me to some generated code, which begins with: public class PurchasingView__Context extends com.google.gwt.editor.client.impl.AbstractEditorContextjava.lang.String { And, as you might imagine, the methods it contains relate to String, not Company. I don't currently have get/setValue, but tried those as well, assuming that getValue ought to return driver.flush(), and setValue(Company value) ought to do driver.edit(value) - needless to say, that didn't help What am I missing here to get it to recognize that it should be editing a Company, not a String? On Wednesday, April 18, 2012 12:17:06 PM UTC-4, Thomas Broyer wrote: On Wednesday, April 18, 2012 5:49:56 PM UTC+2, saurabh saurabh wrote: Hi all, I don't have much experience with Editor frameworks so this question may appear naive or dumb. So suppose we have a big bean or proxy having a many fields. A good idea in view part could be having group them under TabLayoutPanel otherwise a big form on a page may not appear user friendly. Example: Patient Registration Form --- ||Personal Details || Patient Habbits || Family History || Medical History || Insurance || | --- | | | | | --- Here I feel comfortable to have five different UI like detailsView, habbitsView and so on and having them under one composite but all of 'em are concerned to one Class Patient. So my question is how I can wire multiple Editors to same bean, each for different set of properties. I don't find much on net for Editors, I guess it could be CompositeEditors, but I need some help for how to do it. See https://developers.google.com/web-toolkit/doc/latest/DevGuideUiEditors#Very_large_objects (and note that you can use @Path() to have a subeditor for the same object as is being edited). Alternatively, you can use several EditorDrivers on the same object; you'd just have to make sure they don't step on each others (that is, you don't edit the same field in two distinct EditorDrivers). The only difference is that you can edit() the object only when needed (e.g. when the tab is first revealed), but you'll have to flush() all the drivers that you called edit() on before saving your object, or you risk losing data (not persisting changes made by the user). -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: Error when defining a generic Composite widget using Java Generics
I think you're code to set the id is running before there is any DOM peer yet. When I've needed to access a widget's element, I've usually done it in an attach handler, or in a method that I know won't get invoked until the widget has been attached to the DOM. On Wednesday, October 9, 2013 10:12:46 AM UTC-4, Steen Lillethorup Frederiksen wrote: I am trying to create a generic Composite widget, using Java Generics. However I keep getting the assertion error: java.lang.AssertionError: This UIObject's element is not set; you may be missing a call to either Composite.initWidget() or UIObject.setElement() I have defined my Composite widget as follows: public class DataEntryDataType extends FocusWidget extends Composite { final protected FlowPanel panel; final protected InlineLabel promptLabel; final protected DataType inputElement; public DataEntry(final DataType inputField, final String guiId, final String prompt) { super(); promptLabel = new InlineLabel(prompt); inputElement = inputField; panel = new FlowPanel(); panel.add(promptLabel); panel.add(inputField); initWidget(panel); getElement().setId(guiId); promptLabel.setStylePrimaryName(dio-DataEntry-Prompt); inputElement.setStylePrimaryName(dio-DataEntry-Input); } And I am defining my concrete Composite widgets as follows (could be TextBox, TextArea etc.): public class ListEntry extends DataEntryListBox { public ListEntry(String guiId, String prompt) { super(new ListBox(), guiId, prompt); } ... } Can anyone explain to me, what I have missed here? Thanx Steen -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: Style problems with Firefox+LayoutPanel
On Tuesday, September 24, 2013 7:08:42 AM UTC-4, Thomas Broyer wrote: On Tuesday, September 24, 2013 12:08:20 AM UTC+2, Steve C wrote: Actually, I saw essentially the same view in Chrome, at least regarding the height of the select. The width is a different story. In general, I wouldn't add individual widgets to the root layout panel, I'd add panels, and put the widgets inside them. That helps get around some of the browser idiosyncrasies, particularly with select tags. It looks like the RootLayoutPanel adds a div wrapper around any widget you add to it, and actually applies the sizing to that. The widget you added is then set to have top, bottom, left, and right all at 0 within that div. Note that it can be changed using setWidget{Horizontal|Vertical}Position. Interesting - so setting the vertical position to BEGIN actually removes the bottom: 0; on the select within its layer. It's also nice that the Javadocs for the method point out the within its layer part. (It would be even nicer if methods like setWidgetLeftWidth noted that you're actually setting the parameters for the layer, not for the widget itself.) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: Style problems with Firefox+LayoutPanel
Actually, I saw essentially the same view in Chrome, at least regarding the height of the select. The width is a different story. In general, I wouldn't add individual widgets to the root layout panel, I'd add panels, and put the widgets inside them. That helps get around some of the browser idiosyncrasies, particularly with select tags. It looks like the RootLayoutPanel adds a div wrapper around any widget you add to it, and actually applies the sizing to that. The widget you added is then set to have top, bottom, left, and right all at 0 within that div. FF seems to ignore absolute positioning using right: XX; with select tags, but if I explicitly set the style to change the right: 0; to width: 100%;, I get the expected width. You're getting a weird behavior with the height of the select because you didn't set any vertical sizing parameters for it when you added it, so it's defaulting to top and bottom of 0. Thus the selector part of it is huge. (And FF does honor the bottom: 0; setting.) Here's a revision of your code with a comparison of adding a container: public void onModuleLoad() { ListBox list = new ListBox(false); RootLayoutPanel.get().add(list); RootLayoutPanel.get().setWidgetTopHeight(list, 0, Unit.PCT, 50, Unit.PCT); RootLayoutPanel.get().setWidgetLeftWidth(list, 0, Unit.PCT, 50, Unit.PCT); list.getElement().getStyle().setWidth(100, Unit.PCT); // closer to what you want for (int i = 0; i 100; i++) { list.addItem(item + i); } ListBox list2 = new ListBox(false); FlowPanel pnl = new FlowPanel(); pnl.add(list2); RootLayoutPanel.get().add(pnl); pnl.getElement().getStyle().setBorderStyle(BorderStyle.SOLID); pnl.getElement().getStyle().setBorderColor(black); pnl.getElement().getStyle().setBorderWidth(1, Unit.PX); list2.getElement().getStyle().setWidth(100, Unit.PCT); RootLayoutPanel.get().setWidgetRightWidth(pnl, 0, Unit.PCT, 50, Unit.PCT); for (int i = 0; i 100; i++) { list2.addItem(item + i); } } I don't think that there's any relation between this and issues you might be having with Canvas. On Monday, September 16, 2013 8:29:10 AM UTC-4, vincent vigon wrote: ListBox has a weird behavior with fireFox (23.0.1), not with Chrome and Safari. Here is my code : public void onModuleLoad(){ ListBox list= new ListBox(false); RootLayoutPanel.get().add(list); RootLayoutPanel.get().setWidgetLeftWidth(list,0,Unit.PCT,50,Unit.PCT); for (int i=0;i100;i++){ list.addItem(item +i); } } The result is weird with FireFox : the list does not occupy 50% of the width, but it occupies 100% of the height. It seems that the Layout Mechanism does not work on Firefox. It is probably a problem with Css because I have a second problem (probably linked) : on firefox, all my drawing on canvas are black (no colors). Thank you for helping me Vincent -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to use different CSS/Code for different browsers/devices/os?
1. The problem with GWT's conditional CSS is that it is evaluated once, at the time the CSS resource is processed, which means that you won't get runtime changes if the user changes the window size (or a mobile user changes the orientation). 2. The problem with media queries in the CSS is that GWT's CSS resources don't (as of the last time I looked) support them. 3. Another problem with media queries is that IE6-8- don't support them. My solution has been to: 1 2: have a separate CSS resource for each media query, but without the query within it. Instead, get the CSS string from the resource and wrap the query around it yourself, and then inject the resulting string. 3: have yet another variation of each resource, for IE6-8, where there is a marker class in front of every selector, like: Base resource for @media (min-width: 400px) and (max-width: 639px): .special { color: red; } IE6-8 version: @external .ie_400_639; .ie_400_639 .special { color: red; } Then, for IE6-8, use a window resize handler to manage adding the appropriate class to the html tag (and, of course, removing any outdated class). Run that when the entrypoint class loads as well. Yeah, part 3 is a pain to manage - I ended up creating a Java tool to manually run the CSS through to create the IE versions using a horrendously complicated RegEx. On Tuesday, September 17, 2013 4:12:10 PM UTC-4, Joshua Godi wrote: Why not try using responsive css with media queries? You can change the dimensions/background-url for the images and such. Here is a good source for standard media queries: http://css-tricks.com/snippets/css/media-queries-for-standard-devices/ On Saturday, September 14, 2013 8:40:46 AM UTC-5, Ed wrote: How can I use different CSS files, and different code for different Browsers or devices? What I want: For the desktop web browser, I show all of the applications functionality with images of different resolution. However, on a Tablet (iPad) I show the same application but with different images/resolution. And for the smartPhone (iPhone, Samsung S4), I show only restricted application functionality with different images/resolution (different buttons). How can this best be done to optimal use GWT (code splitting, code minimization, etc...) ? My thoughts: Use different Factory classes for different Browsers/devices. These factories classes will then create the required Client Bundles and Controller (to modify app code) classes. Then select the correct factory through GWT config files by indicating the required user.agent property. Is this the way to go ? Or/And maybe use Mgwt and let it handle it (haven't used mgwt yet)... ? Please your experience/advice? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: Is there any way to have event handlers for a cell in a CellTable that isn't in a column?
The header concept gets me a lot further down the path, and it looks like I can fake it out by having a Header rendered in the footer section. But, I'm still not getting my actions triggered, whether the Header is rendered in a header section or footer section. There's probably a piece that I've miscoded that's causing this, but the issue I'm seeing when I step through my code is that for a mouseover event, which I'm not handling in any way, the AbstractHeaderBuilder execution flows through public Header? getHeader(Element elem), and is passed the TD element. But, with a click, I see it is passed the Button tag from my action cell, and ends up returning null. (I'm using the abstract class' renderHeader method to do the rendering, and see the ID on the TD tag, which seems essential.) On Friday, September 6, 2013 6:50:49 PM UTC-4, Steve C wrote: I'd like to put a set of button cells into a composite cell in a celltable footer that uses a custom footer builder to create a row with a cell that spans most of the table columns. But, I don't get any click events on those buttons. If I put the same type of cell into a column, it works fine. The last time I had a need like this, I created a dummy column, gave it a width of 1px, and added it to the table. But I don't really like having the columns not map completely to my row objects, and having to fake my way through the getValue, etc. It seems like it ought to be possible, since CellTree doesn't use the column concept, but I haven't been able to make my way though it's or AbstractCellTable's code to figure out how to make the events be recognized. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Is there any way to have event handlers for a cell in a CellTable that isn't in a column?
I'd like to put a set of button cells into a composite cell in a celltable footer that uses a custom footer builder to create a row with a cell that spans most of the table columns. But, I don't get any click events on those buttons. If I put the same type of cell into a column, it works fine. The last time I had a need like this, I created a dummy column, gave it a width of 1px, and added it to the table. But I don't really like having the columns not map completely to my row objects, and having to fake my way through the getValue, etc. It seems like it ought to be possible, since CellTree doesn't use the column concept, but I haven't been able to make my way though it's or AbstractCellTable's code to figure out how to make the events be recognized. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: Is there any way to have event handlers for a cell in a CellTable that isn't in a column?
Actually, I'm using my own parallel to ActionCell that copies most of it's code and adds a few things. I couldn't extend ActionCell directly due to something with private or package access, if I recall correctly. I've used that same cell in columns and it's worked OK. (Sorry about the red herring with ButtonCell - I was speaking generally about a cell with a button, and forgot that there actually was a ButtonCell.) I've added a CellPreviewHandler to the table to print a console message when invoked, and also print a console line from onBrowserEvent in my ActionCell, and neither of them triggers when I click my buttons. Looking though the code for several of the API classes involved, it seems that the event path goes through the columns. (As an aside, I'm not all that fond of using an updater when there's nothing to update - somewhat the same line of reasoning that keeps me from just adding a column. But I've seen that approach taken in a few examples, like the CustomDataGrid, although that also has the associated cells in a column.) On Friday, September 6, 2013 6:57:39 PM UTC-4, Thomas Broyer wrote: I think you could use an ActionCell instead of ButtonCell: because you're in the footer, the cell/column doesn't correspond to a field in a row, so FieldUpdater wouldn't fit. On Saturday, September 7, 2013 12:50:49 AM UTC+2, Steve C wrote: I'd like to put a set of button cells into a composite cell in a celltable footer that uses a custom footer builder to create a row with a cell that spans most of the table columns. But, I don't get any click events on those buttons. If I put the same type of cell into a column, it works fine. The last time I had a need like this, I created a dummy column, gave it a width of 1px, and added it to the table. But I don't really like having the columns not map completely to my row objects, and having to fake my way through the getValue, etc. It seems like it ought to be possible, since CellTree doesn't use the column concept, but I haven't been able to make my way though it's or AbstractCellTable's code to figure out how to make the events be recognized. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: Dirty Form Flag in GWT or basically how to identify if in the form if there are any unsaved changes
jaga, If you're going to update the model object with every change, then it seems that you'd need a value change handler on every form field. I've usually implemented this concept by having a single inner class ValueChangeHandler instance for the form composite, along with a boolean dirty field. The handler gets added to every form field. Given that there's a single handler instance, I don't think that takes up too much memory. You can cut down the amount of code you have to write by creating a utility method, something like addWithHandler(HasValueChangeHandlers widget, ValueChangeHandler handler) that adds the handler to the widget and then delegates to the panel's add method - with appropriate variations for panels that have parametrized add methods. In the onValueChange method I check the dirty flag - if it's false, I set it to true and fire a custom DataDirty event (which is just a simple custom event with no special fields - usually the only thing I'm interested in is the event source, which I can get from the inherited getSource method). Then my external logic can add whatever I want as a handler. That way, my model bean stays in it's original condition until I go to save the form data, from something like a *Save *button click. That way, I don't have to worry about any external references to the same bean seeing the changes before I want them to. And with a *Cancel *button click I can just repopulate the form from the model object. The dirty field gets set back to false upon loading, saving, or cancelling. On Tuesday, January 29, 2013 4:26:29 PM UTC-5, BM wrote: I have a form in GWT and I want to capture an event similar to dirtyform flag in JQuery. Basically I want to understand if any of the form data has been changed. The requirement is pretty simple here. I am NOT looking for if the data has been actually been modified but just to find out if they touched my form data by any way. So let's say if my form has one GWT Textbox and one ListBox. For me the form data is changed with any of the following condition: 1) If the user changes the value inside Textbox and revert it back to previous original value. 2) The user changes the default selection of ListBox to new selection but changes back to default selection. 3) If the user changes the value inside Textbox to a new value. 4) The user changes the default selection of ListBox to new selection. The form data is not changed if the user just views the form but did not change any of the values in the Widgets at all. One way I thought would be to use onChange event and set a local flag hasDataChanged to true. Once the flag hasDataChanged has been set to true then don't reset it as it means the user touched the form. Based on the value of flag hasDataChanged show an alert message when navigating away from the page. But my problem is that if there are more GWT user interaction widgets (let's say 15 TextBox, 5 ListBox), the UI will fire onChanged Event every time. Plus I have to add onChange event handler to all of my GWT widgets. Perhaps there is a better way to do handle this. May be on view level if there is a single event I can assign which knows if any of GWT widgets been touched by the user? Any help would be appreciated! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: EditTextCell column fires update when clicked if using SiingleSelectionModel
Danilo, That worked for me, although the line numbers were slightly different. I edited code from 2.5.1 - was yours based on an earlier version? I'm still trying to figure out the logic flow, given that the issue doesn't occur until I add a selection model. I like the selection cell concept. I've made a radio group cell to handle a set of radio buttons, but the drawback has been that it takes up a lot of space. Your concept layered on top of that might be a good solution, especially if I can use a popup when the buttons are displayed. (General thought - it seems like a generic popup cell might be useful, which things like DatePickerCell could extend, but that would also give inherited logic for any other sort of custom popup cell I'd want to create.) On Sunday, August 25, 2013 12:25:33 PM UTC-4, Steve C wrote: In a simple celltable, if I set a SingleSelectionModel, then clicking on an EditTextCell triggers the updater for that column, even though the editor doesn't even open (and the value is the current value). Without the selection model this doesn't happen. Is this expected behavior? I've pasted sample code below. Also worth noting is the behavior if I hit *Enter *to clear the alert box - that triggers whatever enter would do on the cell (like open it for editing). Better yet, try editing a cell, and clicking on a different row, then using *Enter *to close all of the alerts that come up. public class EditTextCellBug implements EntryPoint { public void onModuleLoad() { ListBean list = new ArrayListBean(); list.add(new Bean(John)); list.add(new Bean(Jane)); ListDataProviderBean provider = new ListDataProviderBean(list); // problem occurs whether we use explicit key provider or not CellTableBean ct = new CellTableBean(provider); provider.addDataDisplay(ct); ColumnBean, String col = new ColumnBean, String(new EditTextCell()) { @Override public String getValue(Bean b) { return b.name; } }; col.setFieldUpdater(new FieldUpdaterBean, String() { @Override public void update(int index, Bean b, String value) { Window.alert(b.name + updating to + value); b.name = value; } }); ct.addColumn(col); // problem doesn't occur if we don't set the selection model SingleSelectionModelBean selModel = new SingleSelectionModelBean(); ct.setSelectionModel(selModel); RootPanel.get().add(ct); // doesn't fire updater - only manual selection does selModel.setSelected(list.get(0), true); } } class Bean { public String name; public Bean(String name) { this.name = name; } } As a side note, with the single selection model in place, it takes a second click to open the cell for editing if the row wasn't currently selected. (I think I may have a misunderstanding of the role of a selection model, since it doesn't seem to be needed for simple editing, and there are three states a row can have, no bg, yellow bg, and blue, using the default styling. Do I only need one if I actually want to do something with the user's selection?) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: use GwtCreateResource to provide text programatically
What you're asking for could be (in my humble opinion) useful. But, as things currently stand, it won't work syntactically. The method in the bundle doesn't return the resource, it returns an object that lets you create the resource. So, if anything was going to work at all, it would be: {res.labels.create.title} Eclipse code-assistance actually suggests create after res.labels. - but then flags the completed expression as an error. On Tuesday, August 27, 2013 4:57:51 AM UTC-4, Jordan Amar wrote: I would like my uiBinder to use a ClientBundle which will provide some runtime customized labels. Kind of a TextResource but not from a text file ! I tried with GwtCreateResource but from the DevGuidehttp://www.gwtproject.org/doc/latest/DevGuideClientBundle.html#GwtCreateResource it seems like it's not possible. Am I right ? (create() and name() are the only methods available) What I would like to achieve is something like this: client bundle: public interface MyWidgetResources extends ClientBundle { GwtCreateResourceWidgetLabels labels(); @Source(lol.css) CssResource style(); } labels class: public final class MyWidgetLabels { public String title() { return load(mywidget-title); } public String banner() { return load(mywidget-banner); } private String load(String key) { // load from external.. } } uiBinder: ui:with type=com.package.MyWidgetResources field=res/ gwt:SimplePanel gwt:Label text={res.labels.title}/gwt:Label gwt:Label text={res.labels.banner}/gwt:Label /gwt:SimplePanel My code looks like this already but res.label.title does not work. I could try to first store a reference to res.labels.create but it seems like I can't access any methods of labels in my uiBinder. Is there a solution for me ? Maybe with a custom ResourceGeneratorhttp://www.gwtproject.org/doc/latest/DevGuideClientBundle.html#Pluggable_Resource_Generation ? In this case some more pointers would be welcomed because i didn't really catch how that worked... Thanks ! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: Correct way to sink events on UiBinder Element
Here's how I've done it for a click on a save button within a binder: I don't have any call to sinkEvents - I think that's OK because the Widget class does that already (?) @UiField ButtonElement saveButton; // other UiFields public HandlerRegistration addSaveHandler(final ClickHandler handler) { return addDomHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (Element.as(event.getNativeEvent().getEventTarget()) == saveButton) handler.onClick(event); } }, ClickEvent.getType()); } On Thursday, August 15, 2013 3:59:48 PM UTC-4, Shaun Tarves wrote: I am defining several elements via UiBinder. My understanding is these are created as com.google.gwt.dom.client.Element during the createAndBind call. I would like to add a click handler to one of these elements. Is there any way other than casting those to com.google.gwt.dom.client.Element like this? @UiField Element clickable; DOM.sinkEvents((com.google.gwt.user.client.Element) clickable, Event.ONCLICK); DOM.setEventListener((com.google.gwt.user.client.Element) clickable, new EventListener() { public void onBrowserEvent(Event event) { //TODO: Some code } }); -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: EditTextCell column fires update when clicked if using SiingleSelectionModel
I'vde been looking through the EditTextCell code, and can't figure out where that happens. In onBrowserEvent it looks like the flow of execution should end up in edit mode under the circumstances I described. What patch did you make? On Sunday, August 25, 2013 2:09:31 PM UTC-4, Danilo Reinert wrote: I guess that's because the EditTextCell fires an update event even you haven't changed it's value. I was having a similar issue and made a simple patch to the EditTextCell component in order to avoid always firing the update event. Now my EditTextCell only fires when its value has really changed. -- D. Reinert Em domingo, 25 de agosto de 2013 13h25min33s UTC-3, Steve C escreveu: In a simple celltable, if I set a SingleSelectionModel, then clicking on an EditTextCell triggers the updater for that column, even though the editor doesn't even open (and the value is the current value). Without the selection model this doesn't happen. Is this expected behavior? I've pasted sample code below. Also worth noting is the behavior if I hit *Enter *to clear the alert box - that triggers whatever enter would do on the cell (like open it for editing). Better yet, try editing a cell, and clicking on a different row, then using *Enter *to close all of the alerts that come up. public class EditTextCellBug implements EntryPoint { public void onModuleLoad() { ListBean list = new ArrayListBean(); list.add(new Bean(John)); list.add(new Bean(Jane)); ListDataProviderBean provider = new ListDataProviderBean(list); // problem occurs whether we use explicit key provider or not CellTableBean ct = new CellTableBean(provider); provider.addDataDisplay(ct); ColumnBean, String col = new ColumnBean, String(new EditTextCell()) { @Override public String getValue(Bean b) { return b.name; } }; col.setFieldUpdater(new FieldUpdaterBean, String() { @Override public void update(int index, Bean b, String value) { Window.alert(b.name + updating to + value); b.name = value; } }); ct.addColumn(col); // problem doesn't occur if we don't set the selection model SingleSelectionModelBean selModel = new SingleSelectionModelBean(); ct.setSelectionModel(selModel); RootPanel.get().add(ct); // doesn't fire updater - only manual selection does selModel.setSelected(list.get(0), true); } } class Bean { public String name; public Bean(String name) { this.name = name; } } As a side note, with the single selection model in place, it takes a second click to open the cell for editing if the row wasn't currently selected. (I think I may have a misunderstanding of the role of a selection model, since it doesn't seem to be needed for simple editing, and there are three states a row can have, no bg, yellow bg, and blue, using the default styling. Do I only need one if I actually want to do something with the user's selection?) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: load image file from directory outside WAR folder and display in gwt app.
The solution for that would be no different fro GWT than for any other client-side approach: write a servlet that can locate the file and stream the image contents to the response output stream. The file path/name info can either be a parameter, or, with some clever servlet mapping, part of the url used to invoke the servlet. A search like servlet stream image yields a lot of possible approaches. On Monday, August 26, 2013 6:41:26 AM UTC-4, Jostein wrote: Hi all, I have the following situation: I have a directory, /home/images, on my Ubuntu server containing images. The images are uploaded from an Android application by a servlet. I am running Tomcat7 on this server and the image directory is owned by the Tomcat7 user so it should be accessable from tomcat. Now I want to view the images in my GWT application running on the same tomcat server. I have not been able to find a working example for this. I hope someone point mee to the right solution here. I would like to see example including both server- and clien side code. Thanks in advance Jostein -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: ImageResource question
() : defaultResource.getURL(); } @Override public int getWidth() { return imageValid ? image.getWidth() : defaultResource.getWidth(); } @Override public boolean isAnimated() { return imageValid ? false : defaultResource.isAnimated(); // ??? } } On Saturday, August 17, 2013 12:30:11 PM UTC-4, df wrote: Could you give some code? Thanks W dniu czwartek, 15 sierpnia 2013 01:05:30 UTC+2 użytkownik Steve C napisał: Thanks for asking that question - it led me to a solution to a problem that I've had, which is skinning an app using different versions of resources loaded asynchronously from the war directory as opposed to coded into a ClientBundle. I created a client bundle extending SimplePager.Resources, with sources that reference dummy placeholder images in my source tree, then created a separate class implementing that interface. In the constructor I populate it from the GWT.created bundle (since some of the resources aren't dynamic, and I can just delegate through to them) but then load my dynamic images into Image widgets. Those, in turn, are each given to an implementation of ImageResource that holds an Image widget, and obtains the width, height, url, etc. from it (wasn't sure what the heck to do with getName, or how to implement isAnimated). Those are the return values from the associated methods in my resource object. And then I give that to the pager constructor. The asychronicity turned out to be a bear, since I'm using a LoadHandler for each image to know when the size values will be available, and that won't do anything unless I actually add the Image to the document, so I had to create a hidden div to put them into. I haven't yet tested if that's necessary with a data: url. And a lot of layout tasks had to be pushed off into a callback. The concept works, but I suspect that unless I make all versions of a particular image the same size, I can't use any CssResource tricks based on the image. That's probably not a big deal - since the variations generally would all be the same size. Also, I don't think that there's any existing Resource class in the API with CSS resources that depend on the images, so it would only be an issue with custom resource classes. On Wednesday, August 14, 2013 3:42:34 AM UTC-4, df wrote: Hello. Is There any way to create ImageResource dynamically? For example : I get images from WebService in base64 format and I don't have opportunity to have all images on the server at compile time. Can i cast Images to ImageResource? Or is there any other solution? Thanks for help. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: ClientBundle problem: The following unobfuscated classes were present in a strict CssResource:
Several places: The CSS resource processor expects to obfuscate the class names from your CSS file. So, for example, labels might get turned into GESPCACKI. That's why you have a method declared in the interface, so you can retrieve the obfuscated name string. You don't explicitly see a method where you use labels in the Uibinder, but the attribute {res.style.labels} in the tag g:Label ui:field=labUsername addStyleNames={res.style.labels} is actually invoking res.style().labels(). If you wish to use class names in the CSS file that you don't want obfuscated (like .gwt-Label, for example), you need to mark them with @external: mycss.css : @external .headerPan, .textb, .button; .headerPan { background-image:none; background-color:blue !important; height:40px; border-bottom:1px solid black; position : relative; font-size:10.0 em; } etc. In these lines: headerPanel.addStyleName(headerPan); labPassword.addStyleName(labels); username.addStyleName(textb); validBtn.addStyleName(button); The styles for headerPan, textb, and button will work as expected. The statement labPassword.addStyleName(labels); Will do nothing, since there is no class named labels in the CSS. It should be labPassword.addStyleName(res.style().labels()); And, somewhere before that you need to create res and inject the stylesheet: example.resources.Resources res = GWT.create(example.resources.Resources.class); res.style().ensureInjected(); On Friday, August 16, 2013 7:06:35 PM UTC-4, Laurent Bagno wrote: Hello, I have a problem at the compilation with this error : The following unobfuscated classes were present in a strict CssResource: textb button headerPan [ERROR] [gwtmobileexample] - Generator 'com.google.gwt.resources.rebind.context.InlineClientBundleGenerator' threw an exception while rebinding 'example.resources.Resources' Below, it's my code. Where is the problem ? Thank you AuthenticationPage.ui.xml !DOCTYPE ui:UiBinder SYSTEM http://dl.google.com/gwt/DTD/xhtml.ent; ui:UiBinder xmlns:ui=urn:ui:com.google.gwt.uibinder xmlns:g=urn:import:com.google.gwt.user.client.ui xmlns:mgwt=urn:import:com.googlecode.mgwt.ui.client.widget ui:with field='res' type='example.resources.Resources'/ mgwt:LayoutPanel mgwt:HeaderPanel ui:field=headerPanel mgwt:center g:HTML ui:field=centerConnection/g:HTML /mgwt:center /mgwt:HeaderPanel mgwt:WidgetList g:Label ui:field=labUsername addStyleNames={res.style.labels}Username/g:Label mgwt:MTextBox ui:field=username/mgwt:MTextBox g:Label ui:field=labPasswordPassword/g:Label mgwt:MPasswordTextBox ui:field=passworddsdds/mgwt:MPasswordTextBox mgwt:Button ui:field=validBtnValider/mgwt:Button /mgwt:WidgetList /mgwt:LayoutPanel /ui:UiBinder AuthenticationPage.java : package example.client; import org.apache.log4j.Logger; import com.google.gwt.core.client.GWT; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HasText; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Widget; import com.googlecode.mgwt.ui.client.widget.Button; import com.googlecode.mgwt.ui.client.widget.HeaderPanel; import com.googlecode.mgwt.ui.client.widget.MTextBox; import example.resources.Resources; public class AuthenticationPage extends Composite implements HasText { @UiField HeaderPanel headerPanel; @UiField Label labUsername; @UiField Label labPassword; @UiField MTextBox username; @UiField MTextBox password; @UiField Button validBtn; private static AuthenticationPageUiBinder uiBinder = GWT .create(AuthenticationPageUiBinder.class); interface AuthenticationPageUiBinder extends UiBinderWidget, AuthenticationPage { } public AuthenticationPage() { initWidget(uiBinder.createAndBindUi(this)); labPassword.setText(fdf); headerPanel.getElement().getStyle().clearBackgroundColor(); headerPanel.getElement().getStyle().clearBackgroundImage(); headerPanel.addStyleName(headerPan); labPassword.addStyleName(labels); username.addStyleName(textb); validBtn.addStyleName(button); } @Override public String getText() { // TODO Auto-generated method stub return null; } @Override public void setText(String text) { // TODO Auto-generated method stub } } Resources.java : package example.resources; import com.google.gwt.core.shared.GWT; import com.google.gwt.resources.client.ClientBundle; import
Re: Correct way to sink events on UiBinder Element
It sounds like you're using an HTML-based binder, not a Widget binder, so your createAndBindUi would produce an Element that your class can set as its DOM representation (I usually make my class extend Element - for some reason the Eclipse wizard wants to make it a UiObject). And, then, as another poster mentioned, you can have SpanElement, DivElement, etc., in the Java class to match what's in the xml. So, you shouldn't have to cast to element, the pieces should already be some sort of Element. I'm pretty sure @UiHandler won't work for an HTML-based binder, since the Java fields aren't widgets. I haven't tried your approach for hooking up handlers, but have used a delegating approach - the Java class, as a Widget, can have a regular click handler, which can then look at the target of the event and decide what to do accordingly (like fire off a custom event that represents whatever clicking the element meant). On Thursday, August 15, 2013 3:59:48 PM UTC-4, Shaun Tarves wrote: I am defining several elements via UiBinder. My understanding is these are created as com.google.gwt.dom.client.Element during the createAndBind call. I would like to add a click handler to one of these elements. Is there any way other than casting those to com.google.gwt.dom.client.Element like this? @UiField Element clickable; DOM.sinkEvents((com.google.gwt.user.client.Element) clickable, Event.ONCLICK); DOM.setEventListener((com.google.gwt.user.client.Element) clickable, new EventListener() { public void onBrowserEvent(Event event) { //TODO: Some code } }); -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: ImageResource question
Thanks for asking that question - it led me to a solution to a problem that I've had, which is skinning an app using different versions of resources loaded asynchronously from the war directory as opposed to coded into a ClientBundle. I created a client bundle extending SimplePager.Resources, with sources that reference dummy placeholder images in my source tree, then created a separate class implementing that interface. In the constructor I populate it from the GWT.created bundle (since some of the resources aren't dynamic, and I can just delegate through to them) but then load my dynamic images into Image widgets. Those, in turn, are each given to an implementation of ImageResource that holds an Image widget, and obtains the width, height, url, etc. from it (wasn't sure what the heck to do with getName, or how to implement isAnimated). Those are the return values from the associated methods in my resource object. And then I give that to the pager constructor. The asychronicity turned out to be a bear, since I'm using a LoadHandler for each image to know when the size values will be available, and that won't do anything unless I actually add the Image to the document, so I had to create a hidden div to put them into. I haven't yet tested if that's necessary with a data: url. And a lot of layout tasks had to be pushed off into a callback. The concept works, but I suspect that unless I make all versions of a particular image the same size, I can't use any CssResource tricks based on the image. That's probably not a big deal - since the variations generally would all be the same size. Also, I don't think that there's any existing Resource class in the API with CSS resources that depend on the images, so it would only be an issue with custom resource classes. On Wednesday, August 14, 2013 3:42:34 AM UTC-4, df wrote: Hello. Is There any way to create ImageResource dynamically? For example : I get images from WebService in base64 format and I don't have opportunity to have all images on the server at compile time. Can i cast Images to ImageResource? Or is there any other solution? Thanks for help. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Typed service methods using RequestFactory and ServiceLocator
I'm trying to work up an example of request factory using a service locator. The discussions/tutorials all say that ServiceLocator is useful when there's a generic DAO with static methods for instance operations. I'm taking that to mean that my entity classes don't have their own methods to get a specific instance. The javadocs for ServiceLocator say A ServiceLocator provides instances of a type specified by a Servicehttp://www.gwtproject.org/javadoc/latest/com/google/web/bindery/requestfactory/shared/Service.htmlwhen Requesthttp://www.gwtproject.org/javadoc/latest/com/google/web/bindery/requestfactory/shared/Request.htmlmethods declared in a RequestContexthttp://www.gwtproject.org/javadoc/latest/com/google/web/bindery/requestfactory/shared/RequestContext.htmlare mapped onto instance (non-static) methods. I think that's actually backwards -- it looks like the ServiceLocator supplies an instance when what would normally be instance methods (like persist) are actually static and passed an instance. My guess is that the framework generates glue code to invoke the methods on the instance but also pass them the instance. My entities are all instances of DataStoreItem. One specific subclass is Flick. I can write a service that uses a locator with static methods including public static DataStoreItem find(Class? extends DataStoreItem clazz, Long id). My request context class is public interface FlickRequest extends RequestContext. And, unlike so many of the examples I've seen, I actually see benefit to having the context definition include a method to retrieve a single instance (otherwise, how do I actually request one?): public RequestFlickProxy get(long id); But, as I said before, my Flick class doesn't include a static get method. The locator analog to that method takes a class object in addition to the id (to be honest, I haven't tried passing it my proxy class object, but I doubt that would work, since on the server side it would have to receive the actual bean class, not the proxy class). And, it looks like the ServiceLocator will only work for the methods that ought to operate on instances, not methods that would always be static. I tried this as my service locator: public class FlickServiceLocator implements ServiceLocator { @Override public Object getInstance(Class? clazz) { return new ItemDAOWrapperFlick(Flick.class); } } Where the ItemDAOWrapper holds the class object and delegates find(id) to find(clazz, id), but am still seeing errors on my request context that my domain class doesn't have a find method. So, how do I write a method to get an instance by id, when the entity class doesn't do that, and my generic DAO class can only do that when given an class to work on (short of writing an explicit wrapper class for each domain type that can add those methods)? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: Dom change propagation time
I've run into similar issues adding a style name to a widget and then immediately trying to read the class attribute of the element. I think that the issue is that while JS is single-threaded, the browser itself isn't required to be, and the effect of some JS statements can take time to complete within the browser's native code, even though the JS method returned immediately. Try Scheduler.scheduleDeferred, which runs your code with a minimal timeout (basically what you did yourself -- your code should also work if you make the timeout just 1 millisecond). On Monday, August 12, 2013 9:55:29 AM UTC-4, asif...@gmail.com wrote: Hi , I am changing the id of an element in the dom with tableeditor.getElement().setId(tableeditor); where @UiField SimplePanel tableeditor; After this I call a javascript which manipulates the dom based on the id=tableeditor. However, if I put a timeout of 1 sec after changing the dom id property, the javascript works fine. IF I call the javascript immediately after the setId call, then two things happen 1. The id is not set. 2. The javascript throws an exception since it is expecting the id to be present. What is the reason of this behaviour? I would prefer not putting a timer, unless there is no other way to make this work. Regards -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: RPC for Xsite communication
I've used code based on what's at: http://experienceswithgwt.blogspot.com/2010/04/gwt-and-cross-site-requests_28.htmlto use CORS with earlier IE versions. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: StyleInjector issues in IE
Added this to issue tracker as #8261 -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
StyleInjector issues in IE
I'm using Ajax to retrieve multiple CSS files, each dedicated to a single media query. or each one, I then wrap the appropriate media query around the contents, and then inject it via StyleInjector.injectAtEnd. The page the app is running has a whole pile of stuff going on, including scripts related to social network sharing. We've run into two issues: 1. The media queries don't seem to be applied, although IE9-10's dev tools are hinky enough that this may not actually be the problem 2. Image urls in the CSS sometimes get applied as if they came from some other domain, in this particular case, one of the social media ones. I believe that the issue is in StyleInjector.StyleInjectorImplIE, at the end: @Override public StyleElement injectStyleSheetAtEnd(String contents) { int documentStyleCount = getDocumentStyleCount(); if (documentStyleCount == 0) { return createNewStyleSheet(contents); } return appendToStyleSheet(documentStyleCount - 1, contents, true); } Where the style element it chooses to add to is likely to be one of the foreign ones, especially since the social media scripts tend to run late in the load process. It looks like IE exposes the href of the CSS, so this could be checked. So, I'm going to try changing it to use injectStylesheet, which looks like it chooses the shortest to add to if there are already 30 in place (but isn't that going to affect ordering of the rules?) I would try to write an extension of StyleInjectorImplIE, except that, like many GWT classes, it isn't extensible. I've finally gotten annoyed enough at that to write a separate post about it. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
GWT classes aren't extensible
On many occasions, I've wanted to adjust the behavior of a GWT class, but have found that I can't, because they tend not to be written with extensibility in mind. 1. Many internal utility methods are private 2. Many inner classes are private, or maybe package access For example, I wanted to make just a few tweaks in StyleInjector. But, any helper logic that I might want to use from the base, such as private native StyleElement createElement() or private StyleElement createNewStyleSheet(String contents), are, um, PRIVATE. So I basically have to copy the entire code for the class in my extension. Similarly, when I wanted to create a nullable EditTextCell, I couldn't just extend that class, since the actual data for the cell in is static class ViewData, which I can't get to, because I'm in a different package. So, I had to copy the entire class in order to change just a few lines. ' Why is there so much avoidance of protected? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: GWT classes aren't extensible
I see your point, but, on the other hand, I worry about something that needed to be fixed in one of those methods or inner classes that I copied, and would probably never know about. On Friday, July 12, 2013 7:05:04 PM UTC-4, Ed wrote: This is a known issue with gwt, see the issue tracker for details. However, don't forget that this gives the GWT dev team the possibility to change the internal behavior of classes as they don't have to worry about breaking changes because they are extended... So it makes it easier for the dev team to move on adding/changing features. On the other hand, copying a class and adding your own stuff isn't that much work ;) But still, I have to admit, that things could be set up a bit more OO such that improves extendibility. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: Anchor does not work in IE - very strange problem!
I've found that with the IE developer tools, you need to refresh the DOM view within the tools (there's a refresh icon in the HTML view section). The view doesn't seem to take the JS changes to the page into account initially. (And sometimes you never see CSS that GWT injects, but that's off-topic.) BTW, I ran your code and it worked fine in IE-7-10 as provided by the dev tools in IE10 (I just had onCommand do an alert with the two values), so maybe the issue is further down the line. On Friday, June 21, 2013 8:40:12 AM UTC-4, GWTter wrote: IE has had developer tools built in as far back as version 8, just press F12. If you're working with =IE7 then: IE dev toolshttp://www.microsoft.com/en-us/download/details.aspx?id=18359. Although it may work in other browsers or on the other anchor you want to see exactly what is or isn't occurring so you can narrow the scope of the issue, else it's a blind guessing game. I would put an alert or println in the onClick method to see first if the click is even registering for the first button, this will aid you in your analysis and you can then proceed from there. You haven't posted the onCommand method so we have no idea if the click is even registering in the first button case. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to change css style during runtime?
Rather than setting the primary name, you could create a new style that modifies the property, and add or remove that name. I'm assuming below that cellTableKeyboardSelectedCell is for that purpose, so you could do widget.addStyleName(cellTableKeyboardSelectedCell). If so, I'd make the rule .cellTable.cellTableKeyboardSelectedCell. Even better would be to use a dependent style: .cellTable.cellTable-keyboardSelectedCell { border: } and then in your Java code: widget.addStyleDependentName(keyboardSelectedCell); or, to remove it: widget.removeStyleDependentName(keyboardSelectedCell); On Thursday, February 7, 2013 9:50:55 AM UTC-5, membersound wrote: Hi, how can I change a specific css style property during runtime? I have a CellTable.Resource to define cellTable style MyCellTable.css. Now I want to change a specific css property during runtime. .cellTableKeyboardSelectedCell { border: } How can I access my css file during runtime and change that specific property? Probably it has to do with cellTable.setStylePrimaryName(), but I could not figure out how I could achieve this. Thanks -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: @Import CssResource not working (as expected?)
Here's a complete example: @Import and @ImportedWithPrefix examplehttp://www.steveclaflin.com/blog-stuff/gwt/CssResourceImports.html -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
CSSResource processing of CSS files in war directory
I'm working on an app where we decided to create CSS resources under the source tree as usual, but only setting properties that affect layout, like display, float, sizing, positioning, etc. The look of the app is under control of design-oriented folks that aren't GWT-savvy, who want to be able to adjust things like colors, backgrounds, etc., without having to recompile and retest. Their CSS files are located in the war directory. Currently, our source-tree-based CSS uses all @external class names, and we then pull in the war-based CSS files via RequestBuilder, and inject them into the app. I've provided the design folks with a list of the class names that we apply in the GWT code, and a map of where they are used, so that they can set their colors, etc. I think that there might be a way to use the compiled CSSResource artifacts on the server side, by requesting a servlet instead of a plain CSS file, and then processing the CSS files the way the compiler does, but at runtime. That way I can use class name obfuscation, and all the nice things like @def and @eval. (I might end up using a servlet or JSP anyway, in order to ensure that the war CSS files don't try to set certain properties, but it would be nice if I could also use the resource processing logic.) But, before I venture down that road, I figured I'd see if that is indeed possible, and if anyone has tried that, or has found an alternative way to defer the CSS until runtime. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: reordering of column in celltable
I tried this, and it works, with two issues: 1. you need to remove the existing instance of the column. Unlike regular DOM elements (and therefore Widgets), which can only be in one place at a time, the cells generate a rendered string, which will be a new snippet of HTML, which will be result in new DOM element. And, apparently, nothing the table logic is policing the number of times a given column can appear, so the column will exist in two locations: the original location pushed one to the right if the insert position was before it, and the new location. 2. With a DatePickerCell, the first time I changed the date via the popup, nothing happened in the table, but the column updater did get invoked, and refreshing the document, or just paging forward and back again, showed me that the update had taken, and I saw the new data. Subsequent edits to cells in that column did reflect immediately in the table. Code snippet: private CellTableCustomer ct = new CellTableCustomer(pageRows); // later, as the last column in the table: ColumnCustomer, Date expiresColumn = new ColumnCustomer, Date( new DatePickerCell(DateTimeFormat.getMediumDateFormat())) { @Override public Date getValue(Customer cust) { return cust.getExpiration(); } }; expiresColumn.setFieldUpdater(new FieldUpdaterCustomer, Date() { @Override public void update(int index, Customer cust, Date value) { cust.setExpiration(value); custUpdater.updateCustomer(cust); } }); TextHeader expiresHeader = new TextHeader(Expiration); ct.addColumn(expiresColumn, expiresHeader); // after finishing table setup, and adding everything to the Root Panel int colIndex = ct.getColumnIndex(expiresColumn); ColumnCustomer, ? col = ct.getColumn(colIndex); ct.removeColumn(expiresColumn); ct.insertColumn(0, col, expiresHeader); On Saturday, June 30, 2012 5:23:08 AM UTC-4, Thomas Broyer wrote: On Saturday, June 30, 2012 11:17:03 AM UTC+2, tong123123 wrote: If the celltable has something like addColumn(ColumnT,? col, int insertIndex) insertColumn(int beforeIndex, ColumnT,? col)http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/cellview/client/AbstractCellTable.html#insertColumn(int,+com.google.gwt.user.cellview.client.Column) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/bv9-T7-sE6AJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Invalid JSNI method reference
For the method you're using, you could make it more general-purpose: public static void messageBox( String sTitle, Object message ) { Window.alert( sTitle + | + message.toString() ); } @com.ecopy.gwt.client.Utils::messageBox(Ljava/lang/String;,Ljava/lang/Object;)(TheTitle, 99.999); And I believe that AutoBoxing will take care of the double-to-Double conversion, but haven't actually tested that. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/9naSp1CTYdcJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Gin module binding using annotatedWith and AsyncProvider
Well, I have to apologize - I have it working now, although I don't think I actually changed anything related to the problem. FYI, the error message I printed was incorrect and *not *the cause of the problem - the actual annotation I was using was indeed @Async and not @Special, which I changed in the code examples I gave to avoid any implication that it wasn't just a made-up annotation. As an aside, I also got a Provider version working, which was a bear. I ended up creating a proxy class that wrapped an of the class I wanted (and implemented the same interface), then passed all the methods through to the contained object, then added another method to kick off the runAsync call. Two things I don't like about that approach are: - I ended up explicitly instantiating my class in the runAsync call, which seems to render some of the injection concept moot - because of my additional method to load the proxy, I either had to add that to my interface, or typecast what I got from the provider to the proxy class in order to invoke it. I chose the latter. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/X_D6SIDhy5MJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Gin module binding using annotatedWith and AsyncProvider
Well, I have to apologize - I have it working now, although I don't think I actually changed anything related to the problem. FYI, the error message I printed was incorrect and *not *the cause of the problem - the actual annotation I was using was indeed @Async and not @Special, which I changed in the code examples I gave to avoid any implication that it wasn't just a made-up annotation. As an aside, I also got a Provider version working, which was a pretty ugly, and not something that seems easily reusable. I ended up creating a proxy class that wrapped an instance of the class I wanted (and implemented the same interface), passed all the methods through to the contained object, then added another method to kick off the runAsync call. Two things I don't like about that approach are: - I ended up explicitly instantiating my class in the runAsync call, which seems to render some of the injection concept moot - because of my additional method to load the proxy, I either had to add that to my base interface, or typecast what I got from the provider, to the proxy class, in order to invoke it. I chose the latter. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/wut0xvRnYMUJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Gin module binding using annotatedWith and AsyncProvider
If I want to inject an instance of a specific class based on an annotation, I can do this in a Gin module: bind(DiSecondary.class).annotatedWith(Special.class).to(DiSecondarySpecialImpl.class); I also already have: bind(DiSecondary.class).to(DiSecondaryImpl.class); I can then retrieve the special instance into my DiMain (Composite wrapping a Panel) constructor with: @Inject public DiMain(@Special DiSecondary special) { add(special); } But, if I want to code-split DiSecondarySpecialImpl using AsyncProvider, the analogous approach does not work: @Inject public DiMainAsync(@Special final AsyncProviderDiSecondary diSecondaryProvider) { diSecondaryProvider.get(new AsyncCallbackDiSecondary() { public void onFailure(Throwable caught) {} public void onSuccess(DiSecondary result) { add(result); } }); } I get a GWT compiler error. If I remove the annotation, then, of course, I get the non-special implementation. Am I being unreasonable to expect that the compiler could apply the annotation to the async provider for the base class instead of the base class itself? Is there a different route that I can use to get the desired behavior (annotation-based selection of an alternate async loaded class)? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/B_PDh8TMfVwJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Gin module binding using annotatedWith and AsyncProvider
On Sunday, August 26, 2012 1:43:09 PM UTC-4, Thomas Broyer wrote: You should ask on https://groups.google.com/d/forum/google-gin as the GWT Compiler is not involved in these decisions, only the GIN generator. BTW, what's the error? Does it work if you don't use an AsyncProvider? (direct injection, or through a Provider) And as a workaround / alternative, I suppose you could use a @Special ProviderDiSecondary and an explicit GWT.runAsync. I'll repost the original question there. In the meantime: 1. It works fine without the AsyncProvider. 2. The error the compiler gives is: [ERROR] No implementation bound for Key[type=com.x.dep_inj.client.DiSecondary, annotation=@com.x.dep_inj.client.Async] and an implicit binding cannot be created because the type is annotated. 3. Thanks for the suggestion about the Provider. I had tried something along those lines, but couldn't figure out a way to get the callback to it. But, I've got a few more ideas on that now that are worth trying. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/awUQpKosoBsJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: LazyPanel and lazy loading
Thanks, I thought that was the case, especially from looking at the code in LazyPanel.java, but the first line of the Javadoc for LazyPanel is a little misleading: Convenience class to help lazy loading. Steve On Dec 8, 2:39 am, -sowdri- sow...@gmail.com wrote: LazyPanel and runAsync() are for different purpose. LazyPanel is just a container for lazy-*initialization *of widgets. As the widget creation involves dom manipulation, which is relatively costly, you could use LazyPanel to defer it, in case you have a really complex widget. runAsync, is used for code splitting, ie to introduce split points. If you look at the simple example with just creation of widget inside the runAsync block, it may look like a better version of LazyPanel, but its not. -sowdri- -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
LazyPanel and lazy loading
I believe that LazyPanel in and of itself does not perform lazy loading - that I would still need to use GWT.runAsync to achieve lazy loading. Is this the case? And, if so, does LazyPanel provide any benefit for lazy loading with runAsync? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Adding event handlers to elements in HTML-style UiBinder
Actually, it looks like I do need the Element.as(). Without it, I have a reference to an EventTarget, not an Element. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Adding event handlers to elements in HTML-style UiBinder
Thomas, Thanks. My main concern was if I had done enough to ensure the end-of- life-cycle cleanup. The Element.as got in there at some point when I was trying to get the right reference and Eclipse was flagging errors. I probably made another change that eliminated that need somewhere along the way. On Mar 14, 1:54 pm, Thomas Broyer t.bro...@gmail.com wrote: @UiHandler only works on widgets! Steve: your code looks good. You don't need the Element.as() though. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Adding event handlers to elements in HTML-style UiBinder
I finally managed to find a way to do this, but am in no way sure if I haven't left a problem lurking somewhere underneath. I had a table containing form elements that I wanted to use as a UiBinder template. I didn't need event handling for most inputs, but did want a click handler for a button. I tried Button.wrap, but it looks like that only works for a button not already owned by a widget, but my table binder becomes a widget, so that route was out. It would be nice if there was some built-in way to widgetize an element like that, so that from that point on normal GWT tasks could be performed on it. I used an HTML binder rather than a Widget binder because there was no way I could have a table as the top-level element without using a tag like g:Grid, which I wanted to avoid because then I can't edit the layout easily, and also because I already have the table code. (One goal of this was to take a number of existing JSP tag files and turn them into GWT widgets via the binder. Other than the event issue, that actually works out very well.) Wrapping my table in something like a g:HtmlPanel, where I could use a g:Button was out, since then the container div is the element that my primary style affects, and setting its width allowed the table to overflow the boundaries. So, here is the line from my template: trtd colspan=2button ui:field=saveButtonSave/button/td/ tr And, in the java file, my registration method: public HandlerRegistration addSaveHandler(final ClickHandler handler) { return addDomHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (Element.as(event.getNativeEvent().getEventTarget()) == saveButton) handler.onClick(event); } }, ClickEvent.getType()); } So, have I done everything that I need to to make this work reliably? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Can't set or remove focus from a TabBar.Tab
One would think that the following should remove the focus border around a tab: TabBar bar = new TabBar(); // populate bar.getTab(0).setFocus(false); Yet a tab behaves as if it is focusable. I think this is because it COULD be Focusable, a FocusWidget, or a FocusPanel, but in the existing implementation it instead has a wrapper that is a FocusPanel, but the wrapper isn't what is returned by getTab. And, although the docs for the unrelated TabBar.onKeyPress method mention that one should add the handler to the individual tab wrappers instead, afaik there is no way to actually retrieve the wrapper. -- 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 appears to be overriding my css
If you use a stylesheet linked in from your html code, it will get loaded before the theme stylesheet is loaded, so your styles will get overwritten. If you put the stylesheet and associated images in a public folder of your module and reference it in the gwt.xml file (a la GWT 1.5), it will be added after the theme stylesheet, and thus override the GWT theme styling. Another approach is to make your styles more specific than the GWT styles, for example, html body .gwtDecoratorPanel .topLeft { ... }. This seems to work in IE7 and FF 3.5. I have seen rules starting with htmlbody in various posts, but this does not work in IE for me. My dissatisfaction with this is that I can see a browser deciding that the html body doesn't add any specificity to the rule, since that combination is guaranteed to happen. Yet another approach is to rely on the implementation of a widget, with a rule like .gwtDecoratorPanel tr td.topLeft { ... } The problem with this is that conceivably some day GWT could decide that positioned divs are better than a table for the DecoratorPanel implementation. Perhaps the best approach would be to give the body an id, or use an id'd div as the RootPanel, and start the css rule with the id. On Nov 5, 6:23 pm, Rob Tanner caspersg...@gmail.com wrote: Hi, I just upgraded Eclipse to Galileo and downloaded the GWT plugin and started a new project. I added a customized stylesheet (just adding a link in the html) that I use to affect a standardized look and feel. At this point (besides the root panel) all I've added is a single panel that contains a logo and in my custom stylesheet I define an image for the background in a body tag. In hosted mode, it all displays correctly. However, when I click on compile in the hosted display window, what ultimately gets displayed in a regular browser does not include the background image. From the browser, I checked to make sure the link to my custom sheet was good and I also used the link in the style sheet to make sure I could see the background image. Also, just for grins, I commented out the body tag in the standard.cssthat GWT provides. Not only did that not make a difference, the act of compiling replaced the standard.css file, thus effectively uncommenting the body tag. And finally, I tried adding the body tag to the defaultcssfile in the WEB-INF folder and it made no difference. The bottom line, it looks like mycssfile is being overridden behind the scenes. That doesn't make a lot of sense, but that's what it looks like. Any ideas. -- 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.
Does public path=X / still work in GWT 1.6/7 ?
I'm having trouble getting the above to work in a gwt.xml file, as in: source path=entrypoint / public path=webresources / where my file structure is: src/com/xyz/gwt/myapp/ -- -- entrypoint/ -- -- -- MyApp.java -- webresources/ -- -- -- MyApp.css -- 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=.
JUnit RPC test and Resource not found
I get the following stack trace when trying to test an RPC as per the instructions at pages such as http://code.google.com/webtoolkit/articles/testing_methodologies_using_gwt.html .http://localhost:1659/com.webucator.gwt.filmlist.FilmList.JUnit/ getfilms The development shell servlet received a request for 'getfilms' in module 'com.xyz.gwt.filmlist.FilmList.JUnit.gwt .xml' [WARN] Resource not found: getfilms; (could a file be missing from the public path or a servlet tag misconfigured i n module com.xyz.gwt.filmlist.FilmList.JUnit.gwt.xml ?) On Error : Cannot find resource 'getfilms' in the public path of module 'com.xyz.gwt.filmlist.FilmList.JUnit' I have the servlet configured in web.xml, and use the annotation on the service interface. I've gotten the same result using the old approach of defining the endpoint in my code (as in GWT.getModuleBaseURL() + getfilms). Both yield the same result, that there is an extra level JUnit inserted into the base URL. I don't have a file called com.xyz.gwt.filmlist.FilmList.JUnit.gwt.xml, but I do have com.xyz.gwt.filmlist.FilmList.gwt.xml If I put a servlet tag in my module gwt.xml file, then things work, but why back up from a presumably improved structure just to be able to run tests? Is there some way to do this without the servlet tag in the gwt.xml file? -- 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=.
Creating a module in GWT 1.7 - css file location
In GWT 1.5, I would put the module css file in the public package. In 1.7 the preferred approach is to put it in the war directory. I haven't tested to see if the public package concept still works. If I wanted to have a project as a module, I could then jar the whole thing, and the project inheriting the module would find the css file in the public directory. 1. To create a module for 1.7, do I have to add the relevant css file to the new project's war directory, or do I back up and create it in a public package a la 1.5? (or do I do something else, like add the war directory to the module's jar file)? 2. Is there a tool in the Eclipse plugin to create/export a module jar file, or do I have to do that manually? 3. Is there a structure for the module war file other than that the root starts the package structure (e.g., a src folder, a bin or classes folder, etc.)? -- 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=.
Re: GWT: JUnit Google App Engine Tutorial assumes intelligence
I'd like to generalize this whole discussion a bit - to my mind the entire JUnit testing scenario is one of the worst documented and described elements in GWT. Most of the examples out there are repackagings of the same simplistic ones that have been around for a few versions now. In addition to the undocumented item listed in the previous comment, it seems that your test class must be in the same package as your entry-point class, but sourced from the test folder instead of src. -- 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=.
Re: Creating a module in GWT 1.7 - css file location
OK, I answered my own question, at least as far as item #1, with some help from http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html#DevGuideAutomaticResourceInclusion It seems that either approach will work. Having the css in the public package will result in it automatically being included, as long as the modules gwt.xml file references it. Otherwise, I need to include the module's css file in the war directory of the inheriting project, and have that project's html file link to it. I guess that would also give me the ability to more easily override the styling, plus it gets around Eclipse's reluctance to create a package level named public (although it was nice enough to use it if I created it externally). I still wonder about #2 - if there is a way to jar it without resorting to two command-line jar commands ... On Nov 13, 1:37 pm, Steve C st...@steveclaflin.com wrote: In GWT 1.5, I would put the module css file in the public package. In 1.7 the preferred approach is to put it in the war directory. I haven't tested to see if the public package concept still works. If I wanted to have a project as a module, I could then jar the whole thing, and the project inheriting the module would find the css file in the public directory. 1. To create a module for 1.7, do I have to add the relevant css file to the new project's war directory, or do I back up and create it in a public package a la 1.5? (or do I do something else, like add the war directory to the module's jar file)? 2. Is there a tool in the Eclipse plugin to create/export a module jar file, or do I have to do that manually? 3. Is there a structure for the module war file other than that the root starts the package structure (e.g., a src folder, a bin or classes folder, etc.)? -- 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=.
Differences between Hosted and Web mode JUnit testing
I have read numerous times that Hosted mode tests bytecode, while Web mode tests in actual JavaScript. Wanting to delve into this deeper, I came up with the following, in which the JUnit tests succeed in both hosted and web modes. I was expecting that because I used native JS features not available in Java, it would fail in hosted mode: package com.x.gwt.firsttest.client; public class StringProducer { public native String getSomeText()/*-{ String.prototype.yo = function() { return Hello there; }; return Yo.yo(); }-*/; } And then the test class: package com.x.gwt.firsttest.client; import com.google.gwt.junit.client.GWTTestCase; public class FirstTest extends GWTTestCase { public String getModuleName() { return com.x.gwt.firsttest.FirstApp; } public void testStringProducer() { assertEquals(Hello there, new StringProducer().getSomeText()); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Event Handlers and event capture
Apparently Event Handling uses bubbling, not capture, since an HTMLPanel does not notice blur events on a contained input element (I believe that the blur event is fired through the capture phase by browsers, but does not buibble back up). Is there any way to capture BlurEvents in a HTMLPanel for a contained input element? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Getting reference to Widget from contained Element's id
If I have the id of an Element that I got using Widget.getElement (then I called setId on that), can I later use the id to get the Element and back up to its Widget? I'm using JSNI with library code that wants the id of an element to control. I'm passing the id into a JSNI function, but also want to affect the element in additional ways. But, in the JSNI function, I don't have access to the Widget. I figured I could call a regular method (which would have access to Widgets) from the JSNI method, but all I have to pass to it is the id. Hence my desire to look up the Widget from the Element's id. I guess I could make up my own Map of ids to Widgets, but was hoping something like that already existed. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Using exterrnal class in GWT and No source is available error
I'd like to use some external libraries in GWT for the server code, but get the error mentioned above. I took a look at the page at http://code.google.com/intl/fr/webtoolkit/articles/using_gwt_with_hibernate.html, which seems to do just that, and even downloaded the code zip file. But, I haven't been able t figure out how they get it to compile. There certainly doesn't seem to be any Hibernate source code involved Is there some sort of compiler flag to set, or other way to tell GWT to not peruse the source code? It seems that the GWT compiler ought to be able to figure out what classes it needs to look at and which it doesn't (presumably the only ones it needs to look at are those being serialized, and the servlets that are going to provide them - but for the latter group only to see what is being serialized, and not the other details of how those objects get populated). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Migration Instructions 1.5 to 1.6 rename-to
The page at http://code.google.com/webtoolkit/doc/1.6/ReleaseNotes_1_6.html is somewhat unclear regarding rename-to: module rename-to='testapp' Which left me wondering: is the value arbitrary, and, how does it relate to any other settings or directories? (Since the file tree shown under that doesn't have a testapp directory, but does have TestApp). I followed the example, and made it the all-lowercase version of my project name, and noticed that it replaced the last part of the package structure (i.e., what had been an uppercase first letter was now a lowercase letter as in the rename-to value.) Doing this in Eclipse, I then had a testapp directory under war, but I assume that the graphic shown is prior to that occurring. But it might clarify what happens with the rename-to value to show that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---