Thanks for the advice. But it would work well if the root element in
the ui.xml was g:FlowPanel but I want it to be g:PopupPanel.

In the meantime I have found what was wrong. UiFactory method thatsMe
must declare PopupPanel as a return type not the SamplePopup type.
When I changed this line it works as a charm.
Well it seems that I still don't understand very well UiFactory.
Also documentation only touches that subject.


However my second problem is still valid, namely, how can declare the
popuppanel and the widget over which the popup is about to show in the
one ui.xml template.
Till now I have to declare the popups, dialogboxes in the separeate
ui.xml files and the corresponding classes.
It would be nice to have them packed within the same ui.xml template.

I think that this problem applies to all subclasses of the popuppanel.

Thanks
Marcin

On Dec 20, 4:18 pm, Subhrajyoti Moitra <subhrajyo...@gmail.com> wrote:
>  public SamplePopup() {
>                logger.fine("Creating SamplePopup");
>               * add(uiBinder.createAndBindUi(this));*
>
>        }
>
> u have to add the widget to the panel.
>
> Thanks,
> Subhro.
>
>
>
>
>
>
>
> On Mon, Dec 20, 2010 at 8:30 PM, Marcin Misiewicz <misq...@gmail.com> wrote:
> > Hi
>
> > I'm trying to use PopupPanel declared in uibinder template. Template
> > looks like this :
>
> > <!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">
> >        <ui:style>
> >                .important {
> >                        font-weight: bold;
> >                        font-color: red;
> >                }
> >        </ui:style>
> >        <g:PopupPanel glassEnabled="false">
> >                <g:FlowPanel>
> >                        <g:Label addStyleNames='{style.important}'>Simple
> > label</g:Label>
> >                </g:FlowPanel>
> >        </g:PopupPanel>
> > </ui:UiBinder>
>
> > And the corresponding SamplePopup class :
>
> > public class SamplePopup extends PopupPanel {
>
> >        private static final Logger logger =
> > Logger.getLogger(SamplePopup.class
> >                        .getName());
>
> >        private static SamplePopupUiBinder uiBinder = GWT
> >                        .create(SamplePopupUiBinder.class);
>
> >        interface SamplePopupUiBinder extends UiBinder<Widget, SamplePopup>
> > {
> >        }
>
> >        public SamplePopup() {
> >                logger.fine("Creating SamplePopup");
> >                uiBinder.createAndBindUi(this);
> >        }
>
> >       �...@uifactory
> >        SamplePopup thatsMe() {
> >                logger.fine("SamplePopup in thatsMe");
> >                return this;
> >        }
> > }
>
> > The code responsible for showing up popup :
>
> > @Inject
> > SamplePopup popup;
>
> >       �...@uihandler("warning")
> >        void onWarning(ClickEvent e) {
> >                popup.showRelativeTo(warning);
> >        }
>
> > When I click the button I get the empty popup (tiny blue square)
> > attached to the bottom of the button, and of course no error
> > messages.
> > In the logs I see message FINE: Creating SamplePopup but there is no
> > message comming from UiFactory "SamplePopup in thatsMe".
> > It's strange because I use the same code structure to show DialogBox
> > and with DialogBox everything works as expected ?
>
> > So question is what am I doing wrong ?
>
> > I'd like to ask also, if its possible to declare the popup content in
> > the template which declare widget upon which the popup is about to
> > show.
> > When I declare the popup content in the same template as the widget to
> > which this popup is related, popup markup is generated when the view
> > is revealed.
>
> > Thanks in advance.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-web-tool...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2Bunsubs 
> > cr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to