A problem I came across recently: container.newMarkupResourceStream()
is called to load the markup and overriding it allows users to develop
components with very special needs regarding the source of the markup
stream. As this method is invoked from Component.<init>, you can not
rely on any parameter passed to MyComponent.<init> nor on any
initializating in your component to control markup loading. It renders
container.newMarkupResourceStream() almost useless now. Wouldn't it be
better to lazy load the markup when needed or at least to allow for
lazy loading if needed?

Juergen

On 8/22/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
> i want to stress out that it is not just for ajax!
> It is for everything in 2.0. Markup should be there when the component is
> constructed
> because developers could depend on it now in the constructor and if because
> of some
> parent in the change that couldn't match somehow it suddenly doesn't work
> everything could break.
>
> johan
>
>
>
> On 8/22/06, Juergen Donnerstag < [EMAIL PROTECTED]> wrote:
> >
> Not yet, until now I prepared the markup loading process to be better
> prepared for the change. The change we are talking about is not a
> small change. It means to turn the render process inside out and I
> thought that is planned for V3. IMO there will be no perfect solution
> for V2 which is due in ~2 months. We'll have a more flexible and
> pluggable markup finder implementation soon, but users implementing
> there own component resolvers will have to implement there own markup
> finder as well (if the component is meant to be accessible from ajax).
> So, for V2 everything is possible, but with room for improvement. The
> question probably is how many users are implementing there own
> resolvers and hence are affected.
>
> Juergen
>
> On 8/22/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
> > so whats the deal with the resolvers? you guys come up with something
> > concrete?
> >
> > i was thinking about the repeaters - currently if you look at
> ICellPopulator
> > the populateItem method looks like this:
> >
> > void populateItem(final Item cellItem, final String componentId, final
> > IModel rowModel);
> >
> > that componentId is not really necessary because i can use
> > IComponentResolver to match the markup to any id as long as there is only
> > one component in the cellItem. so that will save some pain. there are a
> few
> > other places that are in the exact same boat, so there we can also
> improve.
> > but before i do this i would like to know if we are going to rip out the
> > icomponentresolver and replace it with something else or if its going to
> > stay for good.
> >
> > -Igor
> >
> >
> >
> > On 8/8/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
> > >
> >
> > But we really need to find a solution for that before the final of 2.0
> > Drop the resolver completely or whatever for me we can't support both
> things
> > Then when using a custom what ever resolver will completely bypase the
> > constructor change..
> > That just can't be in my eyes.
> >
> > We should just think about a solution as soon as possible so that all the
> > components
> > gets on constructor time there markup resolved. Not at render time anymore
> >
> > So how can we do that.. How would you rewrite the current resolvers we
> have
> > here in core
> > (So don't think about custom resolves)
> >
> >
> > johan
> >
> >
> > On 8/8/06, Juergen Donnerstag < [EMAIL PROTECTED] > wrote:
> > > On 8/8/06, Johan Compagner < [EMAIL PROTECTED] > wrote:
> > > > yeah looking that the IComponentResolvers implementations
> > > > They are not really for resolving markup for a component
> > > > But they are much more resolving components (creating them) for the
> > markup.
> > > > And some are really calling render() on components so they really
> think
> > they
> > > > are in the render phase.
> > > >
> > > > But we have to resolve the markup of the component in the constructor
> > > > Everything just "depends" on that now. We are saying now in 2.0 that
> you
> > can
> > > > do anything
> > > > in the constructor of your component/panel. That you have everything
> > there
> > > > now (attributes and so on)
> > > >
> > > > We just can't make exceptions there that sometimes that isn't true..
> > That
> > > > would just be wrong.
> > >
> > > The current implementation is already a temporary solution only. I
> > > don't see any issues with changing it until the resolver approach has
> > > been completely removed. Keeping it as is means that some 1.2 code
> > > doesn't work in 2.0. That includes e.g. bordered pages as well as all
> > > apps where users created there own resolvers.
> > >
> > > > So we just have to find a way to always be able to resolve the (none
> > > > autoadd) components that are
> > > > added in the constructor..
> > > >
> > > > What kind of situations do fail now?
> > > >
> > >
> > > see above. Because users have been allowed to create there own
> > > resolvers, and they did in the past, IMO there is no simple solution.
> > > Eventually they'll have to create a IMarkupFinder for there own
> > > resolvers, but until we changed the core these applications shouldn't
> > > fail all by a sudden.
> > >
> > > Juergen
> > >
> > > >
> > > > johan
> > > >
> > > >
> > > >
> > > > On 8/8/06, Juergen Donnerstag <[EMAIL PROTECTED] > wrote:
> > > > > On 8/8/06, Johan Compagner < [EMAIL PROTECTED] > wrote:
> > > > > > What do you mean the current new code (the code now in components
> > > > > > constuctor?)
> > > > > > is only there for ajax?
> > > > > >
> > > > >
> > > > > The MarkupFragmentFinder has been developed to support AJAX calls.
> As
> > > > > it can be used to detected markup errors early, it has been added to
> > > > > the Component constructor.
> > > > >
> > > > > > It has nothing to do with ajax. It has everything to do with fail
> as
> > > > early
> > > > > > as possible when
> > > > >
> > > > > clearly it has. see above.
> > > > >
> > > > > > adding components to a parent.
> > > > > > The MarkupFinder has to be improved that it uses also the
> > > > MarkupResolvers
> > > > > > somehow.
> > > > >
> > > > > I don't think that it is possible. Resolvers work exactly the
> reverse
> > > > > order. Resolvers take a wicket:id and find the component in the
> > > > > hierarchy. MarkupFragmentFinder takes the component id and searches
> > > > > for the markup fragment. IMO the idea of the resolvers should find
> > > > > there way into core, but the implementations will be completely
> > > > > different.
> > > > > But that wouldn't solve the problem. The whole render() process is
> > > > > based on the "traditional" approach. We would need to change that as
> > > > > well to eliminate the need for "traditional" approach. Otherwise
> > > > > you'll allways have to maintain two resolvers, one for the
> > > > > "traditional" render process and one for the MarkupFragmentFinder.
> > > > >
> > > > > >
> > > > > > We just have to have 1 perfect way to resolve the markup that
> > belongs to
> > > > a
> > > > > > component.
> > > > >
> > > > > I completely agree, but I don't think it can be done over night.
> > > > >
> > > > > > And that should be called in the constructor of the component.
> > > > > >
> > > > >
> > > > > yes. And until it is available we should replace the exceptions with
> > logs.
> > > > >
> > > > > Juergen
> > > > >
> > > > > > johan
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 8/8/06, Juergen Donnerstag < [EMAIL PROTECTED] >
> > wrote:
> > > > > > >
> > > > > > Since we introduced Ajax we have two different means to associate
> > > > > > Components and Markup. The "traditional" way which resolves the
> > > > > > Component based on the wicket:id, and since this approach didn't
> > work
> > > > > > Ajax where we needed per Component render, the new approach
> resolves
> > > > > > the Markup based on the Component id. The traditional approach
> (more
> > > > > > specific the implementation of the approach) in Wicket is far more
> > > > > > flexible and evolved than the new one and is able to handle
> > situations
> > > > > > which the new one can't. That will hopefully change soon, but
> until
> > > > > > than I propose the following change:
> > > > > >
> > > > > > The current code in Component basically disables all traditional
> > > > > > resolvers which are more sofisticated than the new one, however as
> > > > > > stated above the new approach is only used for AJAX components.
> > > > > > Instead of throwing an exception if the new one doesn't find the
> > > > > > markup, I'd much rather log a warning and go on as usual, as there
> > is
> > > > > > a high potential that the code still works. I had a several such
> > > > > > examples in wicket-examples.
> > > > > >
> > > > > > Any objections?
> > > > > >
> > > > > > Juergen
> > > > > >
> > > > > > Component.java:
> > > > > > public Component(MarkupContainer<?> parent, final String id, final
> > > > > > IModel<T> model)
> > > > > > {
> > > > > >   try
> > > > > >   {
> > > > > >       MarkupStream markupStream = MarkupFragmentFinder.find
> (this);
> > > > > >       ComponentTag tag = markupStream.getTag();
> > > > > >       if (tag.hasAttributes ())
> > > > > >       {
> > > > > >           markupAttributes = new
> > > > CopyOnWriteValueMap(tag.getAttributes());
> > > > > >       }
> > > > > >    }
> > > > > >    catch (MarkupException ex)
> > > > > >    {
> > > > > >        log.warn("MarkupFragmentFinder was unable to find the
> markup
> > > > > > associated with Component '"
> > > > > >             + id + "'. You will not be able to use the component
> for
> > > > > > AJAX calls.");
> > > > > > //     throw ex;
> > > > > >     }
> > > > > >     catch (RuntimeException re)
> > > > > >     {
> > > > > >         log.warn("MarkupFragmentFinder was unable to find the
> markup
> > > > > > associated with Component '"
> > > > > >              + id + "'. You will not be able to use the component
> > for
> > > > > > AJAX calls.");
> > > > > > //       throw new
> WicketRuntimeException("Couldn't
> > > > find
> > > > > > the markup of
> > > > > > the component '" + id
> > > > > > //       + "' in parent " + parent.getPageRelativePath (), re);
> > > > > >      }
> > > > > >      parent.add(this);
> > > > > > }
> > > > > >
> > > > > >
> > > >
> >
> -------------------------------------------------------------------------
> > > > > > Using Tomcat but need to do more? Need to support web services,
> > > > security?
> > > > > > Get stuff done quickly with pre-integrated technology to make your
> > job
> > > > > > easier
> > > > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> > > > Geronimo
> > > > > >
> > > >
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > > > > > _______________________________________________
> > > > > > Wicket-develop mailing list
> > > > > > Wicket-develop@lists.sourceforge.net
> > > > > >
> > > >
> >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > > >
> > > > > >
> > > > > >
> > > >
> >
> -------------------------------------------------------------------------
> > > > > > Using Tomcat but need to do more? Need to support web services,
> > > > security?
> > > > > > Get stuff done quickly with pre-integrated technology to make your
> > job
> > > > > > easier
> > > > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> > > > Geronimo
> > > > > >
> > > >
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > > > > >
> > > > > > _______________________________________________
> > > > > > Wicket-develop mailing list
> > > > > > Wicket-develop@lists.sourceforge.net
> > > > > >
> > > >
> >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> >
> -------------------------------------------------------------------------
> > > > > Using Tomcat but need to do more? Need to support web services,
> > security?
> > > > > Get stuff done quickly with pre-integrated technology to make your
> job
> > > > easier
> > > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> > Geronimo
> > > > >
> > > >
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > > > > _______________________________________________
> > > > > Wicket-develop mailing list
> > > > > Wicket-develop@lists.sourceforge.net
> > > > >
> > > >
> >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > >
> > > >
> > > >
> > > >
> >
> -------------------------------------------------------------------------
> > > > Using Tomcat but need to do more? Need to support web services,
> > security?
> > > > Get stuff done quickly with pre-integrated technology to make your job
> > > > easier
> > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> > Geronimo
> > > >
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > > >
> > > > _______________________________________________
> > > > Wicket-develop mailing list
> > > > Wicket-develop@lists.sourceforge.net
> > > >
> >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > >
> > > >
> > > >
> > >
> > >
> >
> -------------------------------------------------------------------------
> > > Using Tomcat but need to do more? Need to support web services,
> security?
> > > Get stuff done quickly with pre-integrated technology to make your job
> > easier
> > > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> > >
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > > _______________________________________________
> > > Wicket-develop mailing list
> > > Wicket-develop@lists.sourceforge.net
> > >
> >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > >
> >
> >
> >
> -------------------------------------------------------------------------
> >
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job
> > easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >
> > _______________________________________________
> > Wicket-develop mailing list
> > Wicket-develop@lists.sourceforge.net
> >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> >
> >
> >
> >
> >
> >
> -------------------------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job
> > easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >
> > _______________________________________________
> > Wicket-develop mailing list
> > Wicket-develop@lists.sourceforge.net
> >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> >
> >
> >
>
> -------------------------------------------------------------------------
>
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Wicket-develop mailing list
> Wicket-develop@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
> _______________________________________________
> Wicket-develop mailing list
> Wicket-develop@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>
>
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to