Re: Wicket placeholder for tr component causing invalid markup

2009-01-27 Thread the_adam

Hi,


Jeremy Thomerson-5 wrote:
 
 I agree 100% - that's the only clean solution I see.
 

To let you all know - Igor has provided a quick solution and committed it to
a trunk. Now there is overridible Component#renderPlaceholderTag method.

Regards,
Adam
-- 
View this message in context: 
http://www.nabble.com/Wicket-placeholder-for-%3Ctr%3E-component-causing-invalid-markup-tp21663544p21681424.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



RE: Wicket placeholder for tr component causing invalid markup

2009-01-27 Thread Harrison, Andy
I'm unclear of what you actually want here...

In the thread you state:

I know the benefits of wicket:enclosure. What I need, however is a
placeholder, which is what wicket:enclosure doesn't provide (instead it
removes it's entire body along with self when the specified child is not
visible). This makes it impossible to show a component after the page
has
been rendered without it. 

Surely if you use the wicket:enclosure around a tr (something I have
done in the past) then surely all you need is a little ajax to make the
enclosure and its contents visible again?  IIRC all you need to do is to
add the list item to the target once you've set the visibility.

Feel free to berate if I'm on the wrong track.

Regards

Andrew

-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: 26 January 2009 15:27
To: users@wicket.apache.org
Subject: Re: Wicket placeholder for tr component causing invalid
markup

I agree 100% - that's the only clean solution I see.

On Mon, Jan 26, 2009 at 9:25 AM, the_adam
adam.parchimow...@gmail.comwrote:



 Jeremy Thomerson-5 wrote:
 
  The problem you're facing is clear - and you're right -
wicket:enclosure
  won't work for you.  Unfortunately, that closed-tag code for the
  placeholder
  is hard-coded in Component.
 

 Thanks for understanding :) Also, I've looked already in the Component
 source and I realise that it can't be done as is, hence the thread.


 Jeremy Thomerson-5 wrote:
 
  Hmmm  Could you instead have a wrapping component inside of your
TR
  and
  use that for the visibility swap?  (...) Or don't use TR - use div's
 (...)
 

 The wrapping component would be a solution, but it's rather an ugly
 workaround and a code-expensive one (as of trading invocation of
chainable
 method for an additional container AND manual setting of a td colspan
 property AND explicit visibility linking).

 I might have opened this thread in a wrong group - I was thinking
about a
 possibility of reimplementing the placeholder generation fragment of
 Component#render(MarkupStream) method. Right now it is hardcoded into
the
 method and invoked if flag FLAG_PLACEHOLDER has been set to true. It
could
 delegate the generation to a different method which wouldn't be final.
I
 can
 think of a few solutions, but since we've settled that my problem
won't be
 solved in a clean way with the current state of Wicket I will move
this
 discussion to developers group.
 --
 View this message in context:

http://www.nabble.com/Wicket-placeholder-for-%3Ctr%3E-component-causing-
invalid-markup-tp21663544p21667320.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 
Jeremy Thomerson
http://www.wickettraining.com



..

CarbonNeutral?  office

Thomson.co.uk for Holidays, Flights, Hotels, customer reviews and over 2000 
videos. Find us at www.thomson.co.uk, Sky 637 or on your high street.

CONFIDENTIALITY NOTICE  DISCLAIMER

This message, together with any attachments, is for the confidential and 
exclusive use of the intended addresses(s). If you receive it in error, please 
delete the message and its attachments from your system immediately and notify 
us by return e-mail. Do not disclose copy, circulate or use any information 
contained in this e-mail. 
(1) The content of this e-mail is to be read subject to our terms of business, 
as applicable. 
(2) E-mail may be intercepted or affected by viruses and we accept no 
responsibility for any interception or liability for any form of viruses 
introduced with this e-mail. 
(3) The sender shall remain solely accountable for any statements, 
representations or opinions that are clearly his or her own and not made in the 
course of employment. 
(4) For risk, protection and security purposes, we may monitor e-mails and take 
appropriate action. 
Registered Office: TUI Travel House, Crawley Business Quarter, Fleming Way, 
Crawley, West Sussex RH10 9QL 

TUI Travel PLC, Registered in England and Wales (Number 6072876)
TUI Northern Europe Limited, Registered in England and Wales (Number 3490138)
TUI UK Limited, Registered in England and Wales (Number 2830117) ; VAT Number: 
233 3687 62
Thomsonfly Limited, Registered in England and Wales (Number 444359); VAT 
Number: 490 2120 79  

Telephone: +44 (0)24 7628 2828 | Fax: +44 (0)24 7628 2844 | IT Helpdesk: +44 
(0)20 7383 1555 | IT E-mail: postmas...@thomson.co.uk

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



RE: Wicket placeholder for tr component causing invalid markup

2009-01-27 Thread the_adam


Phooey wrote:
 
 I'm unclear of what you actually want here...
 
Actually what I want has been already provided as stated in my previous post
:)


Phooey wrote:
 
 Surely if you use the wicket:enclosure around a tr (something I have
 done in the past) then surely all you need is a little ajax to make the
 enclosure and its contents visible again?  IIRC all you need to do is to
 add the list item to the target once you've set the visibility.
 

You cannot show the enclosure when it is hidden - since it's not a DOM
element you cannot add it to target. Instead you'd have to use a
WebMarkupContainer (but still you'd have to output it's id, so i.e.
wicket:container wouldn't be a go). TR would have to be wrapped in TBODY
to make visibility swapping possible. But again I wanted a simple solution
without an overhead of adding additional components. Of course you could add
your own AJAX js calls that would do thing other way then the Wicket way,
but Wicket way is - return a chunk of markup and replace a dom element with
a given id with this returned chunk - you need a hook to be there before
switching visibility on.

Also - you cannot just add ListItem to the target - it's a repeater and they
don't have the body of their own - instead their children inherit it.
addChildren would be helpful here though.
-- 
View this message in context: 
http://www.nabble.com/Wicket-placeholder-for-%3Ctr%3E-component-causing-invalid-markup-tp21663544p21682504.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket placeholder for tr component causing invalid markup

2009-01-26 Thread Sébastien Piller

Hi,

I'm pretty sure what you need is wicket:enclosure [1] instead

[1] http://cwiki.apache.org/WICKET/wickets-xhtml-tags.html


the_adam wrote:

If we have a component with a corresponding markup tag tr and want to hide
it and display placeholder tag via Component#setOutputMarkupPlaceholderTag
the resulting markup will be:

tr style=display: none; id=componentId/

However this is not a valid markup. The proper markup would be:

tr style=display: none; id=componentIdtd span=x/tr where x is
the number of columns. Obviously wicket won't know how many columns there
are so one would have to set that explicitly.

Are you planning to anyhow address this issue, i.e. provide a different
placeholder method (maybe
WebMarkupContainer#setOutputRowPlaceholderTag(boolean, short)) or is the
only way of solving this to manually swap component-to-display with custom
placeholder component?
  



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



Re: Wicket placeholder for tr component causing invalid markup

2009-01-26 Thread the_adam


Pills wrote:
 
 I'm pretty sure what you need is wicket:enclosure [1] instead
 

That would be the case if I've wanted to hide certain rows forever, unless
I'm largely mistaken. I want to be able to switch the visibility of certain
table rows and since Wicket's AJAX works by replacing given DOM elements
with parts of the DOM tree from the response I need a placeholder to be
there, which is exactly opposite of what wicket:enclosure tag is for.

However maybe there is a away for inserting a node AFTER the given node or
as the last element of the parent's node in Wicket without writing my own
behaviours? Implementing this would definitely be worth considering.
-- 
View this message in context: 
http://www.nabble.com/Wicket-placeholder-for-%3Ctr%3E-component-causing-invalid-markup-tp21663544p21664382.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket placeholder for tr component causing invalid markup

2009-01-26 Thread Thies Edeling

the_adam wrote:

Pills wrote:
  

I'm pretty sure what you need is wicket:enclosure [1] instead



That would be the case if I've wanted to hide certain rows forever, unless
I'm largely mistaken. I want to be able to switch the visibility of certain
table rows and since Wicket's AJAX works by replacing given DOM elements
with parts of the DOM tree from the response I need a placeholder to be
there, which is exactly opposite of what wicket:enclosure tag is for.

  

That's exactly what wicket:enclosure does; otherwise you'd have to wrap the
row in a WebMarkupContainer to keep a reference in the DOM.


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



Re: Wicket placeholder for tr component causing invalid markup

2009-01-26 Thread the_adam


Thies Edeling-2 wrote:
 
 That's exactly what wicket:enclosure does; otherwise you'd have to wrap
 the
 row in a WebMarkupContainer to keep a reference in the DOM.
 

I know the benefits of wicket:enclosure. What I need, however is a
placeholder, which is what wicket:enclosure doesn't provide (instead it
removes it's entire body along with self when the specified child is not
visible). This makes it impossible to show a component after the page has
been rendered without it. The whole problem is even explicily stated on the
page that Pills linked to:

Note: Changing the visibility of a child component in Ajax callback method
will not affect the entire enclosure but just the child component itself.
This is because only the child component is added
to the AjaxRequestTarget. - though as far as I know even this is misleading
since you can't show even a child of something that is not visible.

Feel free to prove me wrong on this, but to shut down the subject of
wicket:enclosure regarding my case, I am rendering more than one row using a
repeater (repeater's body is the tr) and I want to be able to AJAXly switch
the visibility of some of those on and off. This excludes wicket:enclosure
from possible solutions.

If the problem I'm facing isn't clearing enough let me know, I will try to
rephrase. 
-- 
View this message in context: 
http://www.nabble.com/Wicket-placeholder-for-%3Ctr%3E-component-causing-invalid-markup-tp21663544p21665137.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket placeholder for tr component causing invalid markup

2009-01-26 Thread Jeremy Thomerson
The problem you're facing is clear - and you're right - wicket:enclosure
won't work for you.  Unfortunately, that closed-tag code for the placeholder
is hard-coded in Component.

Hmmm  Could you instead have a wrapping component inside of your TR and
use that for the visibility swap?  That's the only thing I can think of at
this point.  Or don't use TR - use div's, etc, which may only work depending
on what you're trying to do, and not for grid-style display.

Sorry I couldn't be more help here.

On Mon, Jan 26, 2009 at 7:08 AM, the_adam adam.parchimow...@gmail.comwrote:



 Thies Edeling-2 wrote:
 
  That's exactly what wicket:enclosure does; otherwise you'd have to wrap
  the
  row in a WebMarkupContainer to keep a reference in the DOM.
 

 I know the benefits of wicket:enclosure. What I need, however is a
 placeholder, which is what wicket:enclosure doesn't provide (instead it
 removes it's entire body along with self when the specified child is not
 visible). This makes it impossible to show a component after the page has
 been rendered without it. The whole problem is even explicily stated on the
 page that Pills linked to:

 Note: Changing the visibility of a child component in Ajax callback method
 will not affect the entire enclosure but just the child component itself.
 This is because only the child component is added
 to the AjaxRequestTarget. - though as far as I know even this is
 misleading
 since you can't show even a child of something that is not visible.

 Feel free to prove me wrong on this, but to shut down the subject of
 wicket:enclosure regarding my case, I am rendering more than one row using
 a
 repeater (repeater's body is the tr) and I want to be able to AJAXly switch
 the visibility of some of those on and off. This excludes wicket:enclosure
 from possible solutions.

 If the problem I'm facing isn't clearing enough let me know, I will try to
 rephrase.
 --
 View this message in context:
 http://www.nabble.com/Wicket-placeholder-for-%3Ctr%3E-component-causing-invalid-markup-tp21663544p21665137.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 
Jeremy Thomerson
http://www.wickettraining.com


Re: Wicket placeholder for tr component causing invalid markup

2009-01-26 Thread the_adam


Jeremy Thomerson-5 wrote:
 
 The problem you're facing is clear - and you're right - wicket:enclosure
 won't work for you.  Unfortunately, that closed-tag code for the
 placeholder
 is hard-coded in Component.
 

Thanks for understanding :) Also, I've looked already in the Component
source and I realise that it can't be done as is, hence the thread.


Jeremy Thomerson-5 wrote:
 
 Hmmm  Could you instead have a wrapping component inside of your TR
 and
 use that for the visibility swap?  (...) Or don't use TR - use div's (...)
 

The wrapping component would be a solution, but it's rather an ugly
workaround and a code-expensive one (as of trading invocation of chainable
method for an additional container AND manual setting of a td colspan
property AND explicit visibility linking).

I might have opened this thread in a wrong group - I was thinking about a
possibility of reimplementing the placeholder generation fragment of
Component#render(MarkupStream) method. Right now it is hardcoded into the
method and invoked if flag FLAG_PLACEHOLDER has been set to true. It could
delegate the generation to a different method which wouldn't be final. I can
think of a few solutions, but since we've settled that my problem won't be
solved in a clean way with the current state of Wicket I will move this
discussion to developers group.
-- 
View this message in context: 
http://www.nabble.com/Wicket-placeholder-for-%3Ctr%3E-component-causing-invalid-markup-tp21663544p21667320.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket placeholder for tr component causing invalid markup

2009-01-26 Thread Jeremy Thomerson
I agree 100% - that's the only clean solution I see.

On Mon, Jan 26, 2009 at 9:25 AM, the_adam adam.parchimow...@gmail.comwrote:



 Jeremy Thomerson-5 wrote:
 
  The problem you're facing is clear - and you're right - wicket:enclosure
  won't work for you.  Unfortunately, that closed-tag code for the
  placeholder
  is hard-coded in Component.
 

 Thanks for understanding :) Also, I've looked already in the Component
 source and I realise that it can't be done as is, hence the thread.


 Jeremy Thomerson-5 wrote:
 
  Hmmm  Could you instead have a wrapping component inside of your TR
  and
  use that for the visibility swap?  (...) Or don't use TR - use div's
 (...)
 

 The wrapping component would be a solution, but it's rather an ugly
 workaround and a code-expensive one (as of trading invocation of chainable
 method for an additional container AND manual setting of a td colspan
 property AND explicit visibility linking).

 I might have opened this thread in a wrong group - I was thinking about a
 possibility of reimplementing the placeholder generation fragment of
 Component#render(MarkupStream) method. Right now it is hardcoded into the
 method and invoked if flag FLAG_PLACEHOLDER has been set to true. It could
 delegate the generation to a different method which wouldn't be final. I
 can
 think of a few solutions, but since we've settled that my problem won't be
 solved in a clean way with the current state of Wicket I will move this
 discussion to developers group.
 --
 View this message in context:
 http://www.nabble.com/Wicket-placeholder-for-%3Ctr%3E-component-causing-invalid-markup-tp21663544p21667320.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




-- 
Jeremy Thomerson
http://www.wickettraining.com