You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Oliver Lieven <ol...@provantis.de> on 2007/09/28 12:51:00 UTC

Can a component determine it's surrounding HTML elements?

Hi, 

I wonder if there's a way for a component to determine if it is embedded
inside some specific HTML tag, e.g. determine if it is used inside a table.

What I would like to achieve is having a component/panel which, when not
used inside a HTML table, would render itself with surrounding "table" tag.

Thanx for any hints and ideas,
Oliver
-- 
View this message in context: http://www.nabble.com/Can-a-component-determine-it%27s-surrounding-HTML-elements--tf4533713.html#a12938303
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Can a component determine it's surrounding HTML elements?

Posted by Martijn Dashorst <ma...@gmail.com>.
No that is not possible without replacing the current markup parser.

The markup parser is pretty much optimized, and doesn't use a dom to
parse the markup, but splits the markup in chuncks based on the
component tags. And markup between two component tags is treated like
one string.

What you can do is check if your panel is attached to a table tag, and
throw an exception if it is not. See textfield or passwordtextfield
for examples.

Martijn

On 9/28/07, Oliver Lieven <ol...@provantis.de> wrote:
>
> Hi,
>
> I wonder if there's a way for a component to determine if it is embedded
> inside some specific HTML tag, e.g. determine if it is used inside a table.
>
> What I would like to achieve is having a component/panel which, when not
> used inside a HTML table, would render itself with surrounding "table" tag.
>
> Thanx for any hints and ideas,
> Oliver
> --
> View this message in context: http://www.nabble.com/Can-a-component-determine-it%27s-surrounding-HTML-elements--tf4533713.html#a12938303
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Can a component determine it's surrounding HTML elements?

Posted by Alex Objelean <al...@isdc.ro>.
I don't think that there is a wicket way to do something like this, but you
can achieve the same behavior using javascript.

Alex. 


Oliver Lieven wrote:
> 
> Hi, 
> 
> I wonder if there's a way for a component to determine if it is embedded
> inside some specific HTML tag, e.g. determine if it is used inside a
> table.
> 
> What I would like to achieve is having a component/panel which, when not
> used inside a HTML table, would render itself with surrounding "table"
> tag.
> 
> Thanx for any hints and ideas,
> Oliver
> 

-- 
View this message in context: http://www.nabble.com/Can-a-component-determine-it%27s-surrounding-HTML-elements--tf4533713.html#a12938346
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org