You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martin Grigorov <mg...@apache.org> on 2010/09/18 17:18:54 UTC

Inmethod-grid, 1.5, MarkupStream problems

Hi,

I'm trying to upgrade wicketstuff-inmethod-grid to Wicket 1.5:
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/jdk-1.5-parent/inmethod-grid-parent

Making it compiling was easy. Now there is one problem (on two places) - the
code uses some advanced technics to write the markup by using
component.render(MarkupStream).
In Wicket 1.5 the code related to MarkupStream and co. is improved/changed
and I have hard time to understand how to upgrade this stuff.
The first place with this problem is at:
com.inmethod.grid.common.ColumnsHeaderRepeater.onRender(). There to make it
work I added:
   component.setMarkup(getParent().getParent().getMarkup());    // this
doesn't look correct
   component.render();

The second place is com.inmethod.grid.common.AbstractGridRow.onRender().
Here I almost cheated it by using:
   IMarkupFragment associatedMarkup = ((MarkupContainer)
component).getAssociatedMarkup();
   component.setMarkup(associatedMarkup);
   component.render();

but it is still failing.

Anyone (Juergen, Matej) has idea how to deal with this ?

martin-g

P.S. the 1.4 version of the code can be found at
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches/wicketstuff-core-1.4.12/inmethod-grid-parent

Re: Inmethod-grid, 1.5, MarkupStream problems

Posted by Martin Grigorov <mg...@apache.org>.
Thanks for making me confident when using
"component.setMarkup(getMarkup())", i.e. 'component's markup is the markup
of 'this'.
I have never used such tricks before.

Now inmethod-grid is migrated against Wicket 1.5 ! :-)
Will be available in the next Hudson build.

On Sat, Sep 18, 2010 at 8:28 PM, Juergen Donnerstag <
juergen.donnerstag@gmail.com> wrote:

> The javadoc for Component.getMarkup() and
> MarkupContainer.getMarkup(Component child) might give you a hint.
> Unfortunately I have very little time this weekend. In general,
> instead of setting the markup, components shall subclass getMarkup()
> or getMarkup(Component) and provide the markup. Compared to 1.4 it
> doesn't matter where it come from and you don't need to reset it like
> the MarkupStream. You can manually create it, get it from a file,
> search the parent markup, whatever.
>
> You may take a look at ListView and Item
>
> -Juergen
>
> On Sat, Sep 18, 2010 at 5:18 PM, Martin Grigorov <mg...@apache.org>
> wrote:
> > Hi,
> >
> > I'm trying to upgrade wicketstuff-inmethod-grid to Wicket 1.5:
> >
> https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/jdk-1.5-parent/inmethod-grid-parent
> >
> > Making it compiling was easy. Now there is one problem (on two places) -
> the
> > code uses some advanced technics to write the markup by using
> > component.render(MarkupStream).
> > In Wicket 1.5 the code related to MarkupStream and co. is
> improved/changed
> > and I have hard time to understand how to upgrade this stuff.
> > The first place with this problem is at:
> > com.inmethod.grid.common.ColumnsHeaderRepeater.onRender(). There to make
> it
> > work I added:
> >   component.setMarkup(getParent().getParent().getMarkup());    // this
> > doesn't look correct
> >   component.render();
> >
> > The second place is com.inmethod.grid.common.AbstractGridRow.onRender().
> > Here I almost cheated it by using:
> >   IMarkupFragment associatedMarkup = ((MarkupContainer)
> > component).getAssociatedMarkup();
> >   component.setMarkup(associatedMarkup);
> >   component.render();
> >
> > but it is still failing.
> >
> > Anyone (Juergen, Matej) has idea how to deal with this ?
> >
> > martin-g
> >
> > P.S. the 1.4 version of the code can be found at
> >
> https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches/wicketstuff-core-1.4.12/inmethod-grid-parent
> >
>

Re: Inmethod-grid, 1.5, MarkupStream problems

Posted by Juergen Donnerstag <ju...@gmail.com>.
The javadoc for Component.getMarkup() and
MarkupContainer.getMarkup(Component child) might give you a hint.
Unfortunately I have very little time this weekend. In general,
instead of setting the markup, components shall subclass getMarkup()
or getMarkup(Component) and provide the markup. Compared to 1.4 it
doesn't matter where it come from and you don't need to reset it like
the MarkupStream. You can manually create it, get it from a file,
search the parent markup, whatever.

You may take a look at ListView and Item

-Juergen

On Sat, Sep 18, 2010 at 5:18 PM, Martin Grigorov <mg...@apache.org> wrote:
> Hi,
>
> I'm trying to upgrade wicketstuff-inmethod-grid to Wicket 1.5:
> https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/jdk-1.5-parent/inmethod-grid-parent
>
> Making it compiling was easy. Now there is one problem (on two places) - the
> code uses some advanced technics to write the markup by using
> component.render(MarkupStream).
> In Wicket 1.5 the code related to MarkupStream and co. is improved/changed
> and I have hard time to understand how to upgrade this stuff.
> The first place with this problem is at:
> com.inmethod.grid.common.ColumnsHeaderRepeater.onRender(). There to make it
> work I added:
>   component.setMarkup(getParent().getParent().getMarkup());    // this
> doesn't look correct
>   component.render();
>
> The second place is com.inmethod.grid.common.AbstractGridRow.onRender().
> Here I almost cheated it by using:
>   IMarkupFragment associatedMarkup = ((MarkupContainer)
> component).getAssociatedMarkup();
>   component.setMarkup(associatedMarkup);
>   component.render();
>
> but it is still failing.
>
> Anyone (Juergen, Matej) has idea how to deal with this ?
>
> martin-g
>
> P.S. the 1.4 version of the code can be found at
> https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches/wicketstuff-core-1.4.12/inmethod-grid-parent
>