-
20 Mar 2012 8:51 AM #1
ButtonCell with image - problem
ButtonCell with image - problem
Hi, I am on a new project and we want to use gxt3 instead of gxt2.X.
I’m trying to implement a grid, I don’t know if it’s a bug but I have problems when I try to put buttonCell in the grid, the problems are:
1) the method render don’t render the first row;
2) when I click on the buttonCell over the Image (Icon), I can’t click on it, I expected one component (a button with an image), not 2 components.
I attach a screenshot and my java classes.
http://dl.dropbox.com/u/22225410/But...0On%20Grid.png
http://dl.dropbox.com/u/22225410/project.rar
Other problems that I have are:
1) The NumerInputCel l has only readOnly method, I was looking for the disable method.
2) For the Format (private static final NumberFormat format = NumberFormat.getFormat("#,##0.00")
I expected to have this format 1.000,00 not 1,000.00.
If you can help me with these problems.
Thank you.
Cheers
-
22 Mar 2012 4:04 AM #2
Hi all,
I already resolved the last 2 minor problems for the NumberInputCell.
I'm still in trouble with the render of the ButtonCell.
Thank you!
-
22 Mar 2012 5:32 AM #3
2) For the Format (private static final NumberFormat format = NumberFormat.getFormat("#,##0.00")
I expected to have this format 1.000,00 not 1,000.00.
Can you tell us how you solved this?
Is it right that the digit grouping/decimal symbol used, is that of the locale (regional settings)?
-
22 Mar 2012 5:53 AM #4
Hi,
yes it's the local (regional settings).
I put in my "Project_Module_Name".gwt.xml:
<extend-property name="locale" values="it_IT"/>
<set-property-fallback name="locale" value="it_IT"/>
Cheers.
-
26 Mar 2012 8:55 AM #5
In what browser are you noticing this issue? Also, are you noticing this issue in production mode or development mode?
-
26 Mar 2012 8:57 AM #6
Chrome & Firefox both with development and production, i'll test with IE but i doubt the problem is browser related
-
27 Mar 2012 10:56 AM #7
To address your second issue, I'm not noticing any problems clicking on the image part of the button. I've tested this with the latest code from SVN in Firefox 11 in development mode. Please try your project with our next release to see if this problem has been resolved.
For your first issue, you're setting the icon too late. You're making an anonymous subclass of ButtonCell, and you're overriding its render method. You then set the width, height, text, and icon of the cell after you've called super.render, at which point the SafeHtmlBuilder that contains the markup for that cell has already been populated. This is why every next cell is rendered correctly.
In fact, your entire overridden render method is unnecessary. Simply create the cell, then call those setters afterward. This also prevents those setters from being called unnecessarily with each render.
Code:ButtonCell<String> cell = new ButtonCell<String>() { … } cell.setWidth(26); cell.setHeight(26); cell.setText(" "); cell.setIcon(Images.INSTANCE.converti_ctv_prodotto());Last edited by WesleyMoy; 27 Mar 2012 at 10:57 AM. Reason: Add missing icon call
-
27 Mar 2012 1:27 PM #8
Hi,
thank you for your answer, you're right, in fact I tried to make an override of the render method (in the wrong way), because I have to put different icons on buttonsCell depending on the value (name of product) of the row, so I can't just set the icon afterwards (I have different one), like the other setters. If you any suggestion let me know.
Thanks again.
-
28 Mar 2012 12:47 AM #9
Hi,
closed thread [resolved].
I found a way to set the different icons depending on different values, doing that I lost the override of onBrowserEvent for my customTooltip, I have to find a way do fix this too.
thak you.
-
23 Oct 2012 11:06 AM #10
I see that my previous post didn't generate properly...so let me clear it up...
Hi,I am wondering how this issue was fixed. I am having a similar issue.I want to add a button to a cell in a column only if a specific condition is met.
Here's what I have:
The problem is, the button is displayed on the grid, but I cannot click on it. There is a tiny area around the button that allows me to click on it, but nothing happens when I click on the rest of the button. Clicking on the text, "Cancel", does not do anything.Code:ButtonCell<ContactScheduleDTO> cancelCell = new ButtonCell<ContactScheduleDTO>() { @Override public void render(Context context, ContactScheduleDTO value, SafeHtmlBuilder sb) { //Only show the cancel button if it is a ToBeCancelled ContactScheduleDTO if(value.getContactScheduleType() == ContactScheduleType.ToBeCancelled) { super.render(context, value, sb); } } }; cancelCell.setText("Cancel");
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote