On Wed, Mar 25, 2009 at 8:20 PM, Eduard Dudar <[email protected]>wrote:

>
> > Are you manually wrapping elements?  Because
> > it's perfectly legal to do
> >
> > TextBox t = new PasswordTextBox();
>
> Yes, GWT doesn't build DOM structure but only adds a behavior to
> special elements. And yes, that is legal to assign new PasswordTextBox
> to TextBox but with public constructor usage and not the case.
>
> > If you notice the assert is only called in very specific instances.  If
> you
> > are actually wrapping DOM elements, you've got to ask yourself if you are
> > doing it correctly.
>
> Thanks, already asked. An clearly I don't see any reason why I
> shouldn't treat password box as simple text box? Because it looks
> different? The only difference between them is rendering one. If you
> will use some symbolic font your text box will look exactly as
> password do. As DOM elements they are absolutely identical and only
> browser should know there how to render text or password.

Identical for now.  There's no guarantee they'll stay that way.  Clearly
from a proper abstraction perspective,  PasswordTextBox inherits from
TextBox.  The more important thing is that unless you are dealing with
existing HTML code, you shouldn't be touching DOM elements.

> It's not legal to wrap a password DOM element with a
> > TextBox and that is pretty clear why that would be the case.
>
> Interesting... And why so? Element that I have after DOM.getElementById
> (...) is a raw one. I can cast it to InputElement with as(...). At
> this point I have general input that represents all types of input,
> either image or text. I can do setDir or setSrc for text element on
> page without any getType() checking. And that is legal. InputElement.as
> (DOM.getElementById("myPassword")).setSrc() is legal. And again there,
> why TextBox.wrap("myPassword").setText("...") is not legal?

Well if it's a password, why aren't you using PasswordTextBox.wrap?  I fail
to see what the actual issue issue you are having is.

If it's a specific problem you are encountering, then please post a snippet
demonstrating the problem, what the expected behaviour is, and what the
actual behaviour is.

If it's a general disagreement with the architecture choice, then open a
ticket & state your case and if it's a valid argument, then the GWT
engineers will fix it.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to