PDA

View Full Version : TriggerField and TwinTriggerField bugs



eugenparaschiv
1 Aug 2008, 12:51 AM
I have opened a few threads on various bugs I have found in these classes in the GXT - Help form (I need help with them :)). I will briefly list them here as well, but I will be happy to provide more details
1. NO error warnings whatsoever
- for example: when a CSS style is not found, the code just keeps running, with very weird visual artifacts (like the triggers actually changing place when when I pass with the mouse over them and the ONMOUSEOVER event is fired); the only way to see what the problem is is to do extensive debugging; the idea here is that if a CSS is NOT FOUND the program must evidently not be allowed to continue, or at the very least display some kind of warning message

2. tooltips appearing over the triggers, which is not only NOT intuitive behavior, but makes the buttons hard to click
- discussion: this is of course due to the fact that both these classes extend TextField and so when setting the tooltip, it is set over the whole field, including the two triggers
- two fixes could be possible: one, try to set the tooltip over the input only (I admit I have no idea how to do this, and not for lack of trying) or reimplement the entire widget as something else (the GWT Composite comes to mind, but probably not; anyways something similar)
- by doing this, the client would have individual access to the three elements, especially the text field (which would now be a class instance and not the superclass); this would allow of course much more cleaner code for pretty much every aspect of the class, but it would be a major refactoring process instead of just a little fix...perhaps in time, but for now, the fix :)

3. the styles of the triggers: there is a way (a setter) to set the styles for both the triggers (evidently, if there was not, the class would be completely unusable, because the triggers would always look like the arrow of a dropdown list); the problem is that there are no setters to configure the styles for onmouseover and onmouseout which means that I am stuck with the defauls. Now if I change the image of the trigger, of course I will want to change these styles as well. I admit that out of the three items I listed in this post, I am unsure about this last one (perhaps I just don't know how to do it ... not really well documented, these classes)

That's it for now. Save some minor inconsistencies I noticed between the implementation of the TriggerField and that of the TwinTriggerField (the code for each was probably written some time apart), I will add problems as I bump into them. I would apreciate any answers to any of these problems. Thank you. Eugen .

darrellmeyer
5 Aug 2008, 8:24 PM
First, please do not group you bugs, post them individually.


1. NO error warnings whatsoever
- for example: when a CSS style is not found, the code just keeps running, with very weird visual artifacts (like the triggers actually changing place when when I pass with the mouse over them and the ONMOUSEOVER event is fired); the only way to see what the problem is is to do extensive debugging; the idea here is that if a CSS is NOT FOUND the program must evidently not be allowed to continue, or at the very least display some kind of warning message

There is not a way to determine if a style exists so no checking can be done.


2. tooltips appearing over the triggers, which is not only NOT intuitive behavior, but makes the buttons hard to click

What tooltip do you mean? The error icon? I am not aware of any issues with the error icon. If you mean something else, please clarify.


3. the styles of the triggers: there is a way (a setter) to set the styles for both the triggers (evidently, if there was not, the class would be completely unusable, because the triggers would always look like the arrow of a dropdown list); the problem is that there are no setters to configure the styles for onmouseover and onmouseout which means that I am stuck with the defauls. Now if I change the image of the trigger, of course I will want to change these styles as well. I admit that out of the three items I listed in this post, I am unsure about this last one (perhaps I just don't know how to do it ... not really well documented, these classes)

What you trying to do? The mouse over styles are just meant to show a visual indicator that the mouse is over the trigger. I am not sure what you want to customize. You could override onTriggerEvent.

eugenparaschiv
5 Aug 2008, 11:04 PM
I'll divide my post next time. I will try to go into as much detail as I can to clear up the observations of my previous post.


1. There is not a way to determine if a style exists so no checking can be done.
I understand. That's to bad.


2. What tooltip do you mean? The error icon? I am not aware of any issues with the error icon. If you mean something else, please clarify.
I am not referring to an error Icon, I am referring to an actual tooltip, as set with the method
twinField.setToolTip(toolTipText);
the problem here is, as I described in the previous post, that there is no way to set this tooltip on the input text field only. If the TwinTriggerField has no tooltip set, this of course is not a problem, but if one is set, it is set over all the three elements: the actual input text field and over the two trigger buttons; this makes the buttons harder to push and is clearly not the desired behaviour. The desired functionality here would be to set the tooltip over the input text field only, and not the whole element.


3. What you trying to do? The mouse over styles are just meant to show a visual indicator that the mouse is over the trigger. I am not sure what you want to customize. You could override onTriggerEvent.
That is exactly what I am trying to do: change the style (the picture of the button) when the mouse is over it and change it back when the mouse is not. This is a simple task, for which I need to programatically set three styles for each trigger:

the trigger style: this is the style of the trigger as it is displayed most of the time; this CAN be set programatically
the style of the trigger on mouse over: this would be the style of the trigger when the mouse is over it, and CANNOT be set programatically now
the style of the trigger on mouse out: again, this is self explanatory and cannot be set now- instead, the last two styles are now hardcoded. A simple fix would be to provide some setters:
setTriggerStyleOnMouseOver(String style)
setTriggerStyleOnMouseOut(String style)
setTwinTriggerStyleOnMouseOver(String style)
setTwinTriggerStyleOnMouseOut(String style)
so the styles could be set programatically.
As I said in my previous post, this could be me not knowing how to work with CSS (I'm a Java programmer, so I'm new to CSS), and if so, I would like to know how to solve this. The way I solved it now is by using my own class with the functionality of TwinTriggerField with some methods added, but this is of course not an elegant solution. I will provide some code as well is the post is not enough to clearly ilustrate my point. Thank you for your answer. Eugen.