On 12/29/05, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> OK, but how to get to the markupstream?

For containers which are currently being rendered:
markupContainer.getMarkupStream()
markupContainer.findMarkupStream()

Note: MarkupContainer.markupStream is a temporary variable only and
only available during the render cycle.

> It is internal for MarkupContainer,
> and there is no way to get at the stream of another component while in
> IBehaviour#onComponentTag(Component component, ComponentTag
> tag).

The component you want the markup stream for has to be rendered
already. That is, you can not get the markup stream of a component
which will be rendered later. Separating the current render phase into
a attachMarkup and render phase is scheduled for wicket V2 as it most
likely requires major changes to wicket core (and will not be
backwards compatible. Chris and Jon discussed it a year ago already)

However, this is how to get a markupStream
MarkupStream markupStream =
findParentWithAssociatedMarkup().getAssociatedMarkupStream();
// Make sure the markup stream is position at the correct element
markupStream.setCurrentIndex(this.markupStreamPosition);


>
>  Should we open up the API to get at the markup attributes in a read-only
> manner?
>

I don't see why.

Juergen

>  Martijn
>
>
>
>
> On 12/28/05, Juergen Donnerstag <[EMAIL PROTECTED]> wrote:
> >
> > On 12/28/05, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> > > All,
> > >
> > >  Is it possible to retrieve the value of an attribute of a markup tag
> which
> > > is used in combination with a component?
> > >
> >
> > CompentTag.getAttributes().get("myAttr")
> >
> > and if tag is not given
> >         // Get the current markup element
> >         final MarkupElement element = markupStream.get();
> >
> >         if (element instanceof ComponentTag)
> >         {
> >                 // Get element as tag
> >                 final ComponentTag tag = (ComponentTag)element;
> >
> > Juergen
> >
> > >  Say I want to get the contents of the 'id' attibute of a tag, but not
> > > overwrite it...
> > >
> > >  This is very useful when working with prototype.js or other javascript
> > > libraries that can automatically update markup based on the return
> answer,
> > > and when one doesn't want the 'id' attribute to be generated by wicket
> (CSS,
> > > etc).
> > >
> > >  Martijn
> > >
> > > --
> > > Living a wicket life...
> > >
> > > Martijn Dashorst - http://www.jroller.com/page/dashorst
> > >
> > > Wicket 1.1 is out:
> http://wicket.sourceforge.net/wicket-1.1
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> > for problems?  Stop!  Download the new AJAX search engine that makes
> > searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> > _______________________________________________
> > Wicket-develop mailing list
> > [email protected]
> >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> >
>
>
>
> --
>
> Living a wicket life...
>
> Martijn Dashorst - http://www.jroller.com/page/dashorst
>
> Wicket 1.1 is out: http://wicket.sourceforge.net/wicket-1.1


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to