HELLO ! Thanks for your reply,

ok, TNSInformationPanel happens to be just a class and does not have a
UIBinder file, here's how it looks ?

package com.techandsolve.bonificacionesc.web.client.base.widgets;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.techandsolve.bonificacionesc.web.client.Styles;

public class TNSInformationPanel extends VerticalPanel {

        public enum Mode {
                ERROR(Styles.ERROR_DIALOG.toString()),
                WARINING(Styles.WARNING_DIALOG.toString()),
                INFORMATION(Styles.INFORMATION_DIALOG.toString());
//              SUCCESS("");

                private String style;

                private Mode(String style) {
                        this.style = style;
                }

                public String getStyle() {
                        return style;
                }

        }

        private String messageHeader;
        private String messageLabel;

        public TNSInformationPanel() {
                this.addStyleName(Styles.PANEL.toString());
                this.setVisible(false);
        }

        private void decore() {
                Panel messagePanel = new VerticalPanel();

                if (this.messageHeader != null) {
                        messagePanel.add(new HTML("<b>" + this.messageHeader + 
"</
b><br>"));
                }

                messagePanel.add(new HTML(this.messageLabel));

                this.clear();
                this.add(messagePanel);
        }

        public String getMessage() {
                return this.messageLabel;
        }

        public void setMessage(String message) {
                this.messageLabel = message;
        }

        public String getMessageHeader() {
                return this.messageHeader;
        }

        public void setMessageHeader(String messageHeader) {
                this.messageHeader = messageHeader;
        }

        private void removeStyles() {
                for (Mode m : Mode.values()) {
                        if (m.getStyle() != null && 
!m.getStyle().trim().equals("")) {
                                this.removeStyleName(m.getStyle());
                        }
                }
        }

        public void show(Mode mode) {
                this.clear();
                removeStyles();
                this.addStyleName(mode.getStyle());
                decore();
                this.setVisible(true);
        }

        public void hide() {
                this.setVisible(false);
        }

}

What do you think ?

Let me know what do you think, and... Do you think it's a good idea to
switch to FlowPanel now ? [ I'm kind of scared, this requirement is
already delayed :(  ]

Thanks again,

Jose

On Aug 25, 2:37 pm, RPB <[email protected]> wrote:
> On first inspection, the code seems ok. Perhaps the problem is in the
> TNSInformationPanel UIBinder file? Can you post that?
>
> Also, as an aside, you might consider using FlowPanel instead of
> VerticalPanel to prevent future layout 
> problems:http://dobesland.wordpress.com/2007/07/29/tip-in-gwt-verticalpanel-co...http://code.google.com/webtoolkit/doc/latest/DevGuideUiPanels.html#St...
>
> -R
>
> On Aug 25, 3:13 pm, Jose Luis Estrella Campaña <[email protected]>
> wrote:
>
>
>
> > Howdi !
>
> > How are you all today ? fine. I hope. Dear all, I'm having this
> > annoying problem that has already taken 18 hours from me. I have this
> > Widget that used to be working, then I just added a new Panel
> > correctly nested (informationPanel) in my .ui.xml file. Now when I
> > click on a button to do what the Widget used to do, I get the
> > following error, only visible through FireBug...
>
> >  java.lang.IllegalStateException: SimplePanel can only contain one
> > child widget
>
> > Here's the file where the problem is supposed to be.
>
> > <!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:tns="urn:import:com.techandsolve.bonificacionesc.web.client.base.widg 
> > ets">
> >         <ui:style>
> >         </ui:style>
> >         <g:VerticalPanel ui:field="container">
>
> >         <tns:TNSInformationPanel ui:field="informationPanel"/>
>
> >         <g:HorizontalPanel styleName="tns-ButtonsBarHolder">
> >                 <g:HorizontalPanel styleName="tns-ButtonsBar">
> >                         <g:Label 
> > styleName="tns-ButtonsBarSpacer">[&nbsp;</g:Label>
> >                                 <tns:TNSButton ui:field="assignButton" />
> >                         <g:Label 
> > styleName="tns-ButtonsBarSpacer">&nbsp;|&nbsp;</g:Label>
> >                                 <tns:TNSButton ui:field="calculateButton" />
> >                         <g:Label 
> > styleName="tns-ButtonsBarSpacer">&nbsp;|&nbsp;</g:Label>
> >                                 <tns:TNSButton ui:field="saveAsButton" />
> >                         <g:Label 
> > styleName="tns-ButtonsBarSpacer">&nbsp;]</g:Label>
> >                 </g:HorizontalPanel>
> >         </g:HorizontalPanel>
> >                 <g:Label styleName="tns-PanelTitle" 
> > ui:field="sucursalLabel" />
> >                 <g:Label styleName="tns-HelpText">
> >                         Seleccione una plantilla
> >                         de asignacion o una de las opciones a continuacion
> >                 </g:Label>
> >                 <g:Label styleName="tns-DottedLine">&nbsp;</g:Label>
> >                 <g:HorizontalPanel>
> >                         <g:Label ui:field="pointsLabel" />
> >                         <tns:TNSTextBox 
> > ui:field="pointsToAsignTextBox"></tns:TNSTextBox>
> >                 </g:HorizontalPanel>
>
> >                 <g:HTMLPanel styleName="{style.html-panel}"
> > ui:field="employeesPanel">
> >                         <table>
> >                                 <tr>
> >                                         <td>
> >                                                 <g:Label 
> > styleName="tns-Label" ui:field="templateLabel" />
> >                                         </td>
> >                                         <td>
> >                                                 <tns:TNSListBox 
> > ui:field="templatesList" />
> >                                         </td>
> >                                 </tr>
> >                         </table>
> >                 </g:HTMLPanel>
> >                 <g:Label styleName="tns-PanelTitle" 
> > ui:field="employeesLabel" />
> >                 <g:Label styleName="tns-HelpText">El siguiente formulario 
> > permite
> > asignar
> >                         puntos a las entidades que tiene a cargo</g:Label>
> >                 <g:Label styleName="tns-DottedLine">&nbsp;</g:Label>
> >                 <g:HTMLPanel>
> >                         <g:Grid ui:field="orgsGrid" />
> >                         <g:Grid ui:field="employeesGrid" />
> >                 </g:HTMLPanel>
> >         </g:VerticalPanel>
> > </ui:UiBinder>
>
> > Could somebody please help me visualize what I'm possibly missing or
> > doing wrong ? I'm blind here, and I think I'm not even using a Panel
> > that extends from SimplePanel.
>
> > Help Me !
>
> > Sincerely,
>
> > Jose

-- 
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