Gwt Button Disable problem in Mozilla firefox and Chrome(cross browser)

757 views
Skip to first unread message

somaldo

unread,
Jun 27, 2011, 8:18:53 AM6/27/11
to Google Web Toolkit, somu...@gmail.com
Hi


Currently am working on the Gwt button disable in crossbrowser. In
Internet explorer its working properly But in Mozilla firefox and
Chrome the button is not disabled properly and whenever mouse over on
the disabled button, button got focus( but clicking event function is
not occuring)

The following code i have used :

final Button sendButton = new Button("Send");
sendButton.setEnabled(false);

Also i have tried the following thing.

final Button sendButton = new Button("Send");
DOM.setElementPropertyBoolean(sendButton.getElement(), "disabled",
true);

Please help me out.

Somaldo

mohamed salah

unread,
Jun 27, 2011, 9:49:17 AM6/27/11
to google-we...@googlegroups.com


-----------------------------------------
salaam

this Solutions in not true

---------------------------------------------------------------
 final Button sendButton = new Button("Send");
     sendButton.setEnabled(false);

Also i have tried the following thing.

 final Button sendButton = new Button("Send");
 DOM.setElementPropertyBoolean(
sendButton.getElement(), "disabled",
true);
--------------------------------------------------------------------
is true Solutions
create method for example
--------------------------------------------------------
private void createButtonClosed() {

        final HTML closeHtml = new HTML("Close");
        this.horizontalPanel.setCellHorizontalAlignment(closeHtml, HasHorizontalAlignment.ALIGN_CENTER);
        this.horizontalPanel.add(closeHtml);
        closeHtml.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(final ClickEvent event) {
                // TODO Auto-generated method stub
                Window.enableScrolling(true);
                EditAccountDialog.this.hide();
            }
        });
        closeHtml.setStyleName("1");

        // ----
        closeHtml.addMouseMoveHandler(new MouseMoveHandler() {
            @Override
            public void onMouseMove(final MouseMoveEvent event) {
                closeHtml.setStyleName("2");
            }
        });
        closeHtml.addMouseOutHandler(new MouseOutHandler() {
            @Override
            public void onMouseOut(final MouseOutEvent event) {
                closeHtml.setStyleName("1");
            }
        });
----------------------------------------------------
Notes see the method 
addMouseMoveHandler and addMouseOutHandler
inside method setStyleName this method inside Css and outside Methods
Method genral Css setStyleName


 (1 )for example  css
genral  method inside css
--------------------------------------------
.1 {
    color: #0B5879;
    padding: 2px;
    border-width: 1px;
    border-style: solid;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #000000;
    border-top: 1px solid #ffffff;
    border-bottom: 1px solid #000000;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    vertical-align: middle;
    background-color: rgb(222, 222, 222);
    cursor: pointer;
    white-space: nowrap;
}
-------------------------------------------

(2)for example  css
addMouseMoveHandler method inside css
 
.2 {
    color: White;
    padding: 2px;
    border-width: 1px;
    border-style: solid;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #000000;
    border-top: 1px solid #ffffff;
    border-bottom: 1px solid #000000;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    vertical-align: middle;
    background-color: rgb(8, 89, 123);
    cursor: pointer;
    white-space: nowrap;
}

thanks
mohammad salah


Regard: Mohamed salah hasan
Mobile :+20106594094
tel     :+2024460320


somaldo

unread,
Jun 27, 2011, 10:19:54 AM6/27/11
to Google Web Toolkit, somu...@gmail.com
Hi


Currently am working on the Gwt button disable in crossbrowser. In
Internet explorer its working properly But in Mozilla firefox and
Chrome the button is not disabled properly and whenever mouse over on
the disabled button, button got focus( but clicking event function is
not occuring)

The following code i have used :

final Button sendButton = new Button("Send");
sendButton.setEnabled(false);

Also i have tried the following thing.

final Button sendButton = new Button("Send");

somaldo

unread,
Jun 27, 2011, 10:58:21 AM6/27/11
to Google Web Toolkit


On Jun 27, 6:49 pm, mohamed salah <mohamedhasanshaks...@gmail.com>
wrote:
> * **.2 {
>     color: White;
>     padding: 2px;
>     border-width: 1px;
>     border-style: solid;
>     border-left: 1px solid #ffffff;
>     border-right: 1px solid #000000;
>     border-top: 1px solid #ffffff;
>     border-bottom: 1px solid #000000;
>     font-size: 14px;
>     font-weight: bold;
>     text-align: center;
>     vertical-align: middle;
>     background-color: rgb(8, 89, 123);
>     cursor: pointer;
>     white-space: nowrap;
>
> }
>
> thanks
> mohammad salah *
>
> *Regard: Mohamed salah hasan
> Mobile :+20106594094
> tel     :+2024460320*

Thanks for your immediate support. But the above solution is not opt
for my problem.
Still the problem exist in cross browser

Thomas Broyer

unread,
Jun 27, 2011, 11:15:28 AM6/27/11
to google-we...@googlegroups.com, somu...@gmail.com
The Button widget is a "native button" (i.e. a <button>), so I guess you must have an issue with CSS (and yes, Internet Explorer probably, once again, does things differently; mind you share which version you tested in? and if IE8 or IE9, in which "document mode" and "browser mode"?). Are you using a theme from GWT or rolling your own stylesheet?
If using the "clean" theme, then I don't see an issue on the Showcase: http://gwt.google.com/samples/Showcase/Showcase.html#!CwBasicButton The change in the border is wilfull, the CSS reads: .gwt-Button[disabled]:hover { border: 1px outset #ccc; }
Reply all
Reply to author
Forward
0 new messages