uibinder

How do I add items to GWT ListBox in Uibinder .ui.xml template ?

余生长醉 提交于 2019-11-30 12:42:21
问题 How to add the listbox items using UiBinder? 回答1: This is a listbox of translations of an enumeration, I suppose this also works for a listbox with string values (version of GWT: 2.1.0) You only need the renderer for translating the enumeration values. //UI XML <g:ValueListBox ui:field="requesterType"/> //JAVA CODE @UiField(provided = true) ValueListBox<RequesterType> requesterType = new ValueListBox<RequesterType>(requesterTypeRenderer); static EnumRenderer<RequesterType>

Trying to get UIBinder to give me a span not a div

China☆狼群 提交于 2019-11-30 06:40:59
I am building a widget with UiBinder, and I need to have it enclosed in a <span /> but UiBinder only gives me <div /> . E.g. <g:HTMLPanel /> => <div /> . HorizonPanel, FlowPanel, VerticalPanel also give out only <div /> . Does any one know a solution? Try this: <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' xmlns:g='urn:import:com.google.gwt.user.client.ui'> <g:HTMLPanel tag="span"> <!-- your stuff --> </g:HTMLPanel> </ui:UiBinder> You can keep using a <div> but just add display: inline to its CSS, which will make it display as though it were a <span> . Edit: fixed place at the end

How to use the GWT editor framework for validation?

倖福魔咒の 提交于 2019-11-30 04:47:49
I am trying to integrate with the new GWT Editor framework of GWT 2.1.0. I also want to add my validation checks into the framework. However, I am struggling to find a decent example how to do this. For the moment I have the following code: <!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:e="urn:import:com.google.gwt.editor.ui.client"> <ui:with type="be.credoc.iov.webapp.client.MessageConstants" field="msg" /> <g:HTMLPanel> <e:ValueBoxEditorDecorator ui:field=

Which Google GWT product uses UiBinder? [closed]

夙愿已清 提交于 2019-11-30 03:40:53
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I would like to know which product of google written in GWT uses UiBinder. This would allow me to highlight the use case of UiBinder

How can I set id for GWT widgets in UiBinder?

。_饼干妹妹 提交于 2019-11-29 02:12:17
In java code we can set id. Is it possible to set 'id' for GWT widgets in UiBinder itself? If it is possilbe please give me a sample. Actually I tried the following code, <g:Button ui:field="login" debugId="loginButton"> Then I checked it in alert. Window.alert("Id: " + login.getElement().getId()); But the output is Id: . Id is not set for the login button Is there any better way to do this? Can anyone help me? Thanks in advance, Gnik Check an availability of the following line in your module file (*.gwt.xml ): <inherits name="com.google.gwt.user.Debug"/> And call the ensureDebugId(Element, id

How can I internationalize a GWT UIBinder page with Messages?

折月煮酒 提交于 2019-11-29 00:45:04
问题 I am trying to internationalize a UIBinder application with property files. Since we have already a lot of translations exposed by the com.google.gwt.i18n.client.Messages interface (GWT 1.7.1), we would like to reuse these messages. I have tried the following: <!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:res="ui:with:be.credoc.iov.webapp.client

Adding ClickHandler to div which contains many other widget

走远了吗. 提交于 2019-11-28 21:33:08
It seems that Panel doesn't inherit from HasClickHandlers and I can't add a clickHandler to DivElement. Is there any way to add the clickHandler to a DIV? EDIT: The reason I can't use Label as that the DIV I want to be clickable contains other DIV. By default, Panel doesnt 'sink' the onCLick event. That is, clicking on Panels doesnt actually result into a 'ClickEvent' and hence the handler isnt fired. To use click events with Panel (or for that matter any other Widget) you must first invoke sinkEvents() on it with the appropriate event bits. For example: SimplePanel p = new SimplePanel(); p

How to declare dependent style names with UiBinder

旧城冷巷雨未停 提交于 2019-11-27 19:02:09
I have a simple UiBinder widget containing a TextArea: <!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"> <g:TextArea visibleLines="3" /> </ui:UiBinder> I want to control the background color of this textarea for writeable and read only states. GWT uses the "-readonly" style name decorator to achieve this. So I try this: <!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

How can I set id for GWT widgets in UiBinder?

怎甘沉沦 提交于 2019-11-27 16:44:49
问题 In java code we can set id. Is it possible to set 'id' for GWT widgets in UiBinder itself? If it is possilbe please give me a sample. Actually I tried the following code, <g:Button ui:field="login" debugId="loginButton"> Then I checked it in alert. Window.alert("Id: " + login.getElement().getId()); But the output is Id: . Id is not set for the login button Is there any better way to do this? Can anyone help me? Thanks in advance, Gnik 回答1: Check an availability of the following line in your

How do I style a gwt 2.1 CellTables headers?

我与影子孤独终老i 提交于 2019-11-26 22:23:41
问题 I see nothing in the documentation except a reference to include some "CssResource" and get it with ClientBundle, but how do I exactly override the tbody and th of a CellTable? Is this possible? 回答1: Create an interface: interface TableResources extends CellTable.Resources { @Source({CellTable.Style.DEFAULT_CSS, "<your css file>.css"}) TableStyle cellTableStyle(); } interface TableStyle extends CellTable.Style { } and initialize the cell table: CellTable.Resources resources = GWT.create