Difference b/w SetoutputMarkupId(true) and SetOutputMarkupHolderTag(true?)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Difference b/w SetoutputMarkupId(true) and SetOutputMarkupHolderTag(true?)

raju.ch
Can anyone tell me the difference b/w SetoutputMarkupId(true) and SetOutputMarkupHolderTag(true)?
Reply | Threaded
Open this post in threaded view
|

Re: Difference b/w SetoutputMarkupId(true) and SetOutputMarkupHolderTag(true?)

Matthias Keller
Hi

setOutputMarkupId sets the "id" attribute of the HTML tag. This
generally must be set if the tag shall be updated by AJAX
setOutputMarkupPlaceholderTag has the effect that a *hidden* component
is still added to the HTML tree but - hidden. This is used, if the
component is initially not visible (isVisible() == false) and would
normally not leave a trace in the generated HTML file, thus it cannot be
set visible by AJAX since it doesn't have a 'handle' to it. So it
generally must be set to true if the component is to be updated by AJAX
but is NOT initially visible.

Matt

On 2011-11-21 10:38, raju.ch wrote:
> Can anyone tell me the difference b/w SetoutputMarkupId(true) and
> SetOutputMarkupHolderTag(true)?


smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Difference b/w SetoutputMarkupId(true) and SetOutputMarkupHolderTag(true?)

Ernesto Reinaldo Barreiro-4
In reply to this post by raju.ch
setOutputMarkupHolderTag(true) is there for the use case where you
want to place an empty element (e.g. an empty "div" with an ID
assigned to it)  and later on replace it, via AJAX, with real
contents. E.g.

final WebMarkupContainer div = new WebMarkupContainer("div");
 div.setVisible(false);
 div.setOutputMarkupHolderTag(true);
 // contents added to div

will place a

<div id="generatedId" style="display:none;"></div>

later on via AJAX you could do

onClick(AjaxRequestTarget target) {
     div.setVisible(true);
     target.add(div);
}

which will produce

<div id="generatedId">Contents here</div>

Regards,

Ernesto

On Mon, Nov 21, 2011 at 10:38 AM, raju.ch <[hidden email]> wrote:

> Can anyone tell me the difference b/w SetoutputMarkupId(true) and
> SetOutputMarkupHolderTag(true)?
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Difference-b-w-SetoutputMarkupId-true-and-SetOutputMarkupHolderTag-true-tp4091035p4091035.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Difference b/w SetoutputMarkupId(true) and SetOutputMarkupHolderTag(true?)

raju.ch
Thank you very much
Reply | Threaded
Open this post in threaded view
|

Re: Difference b/w SetoutputMarkupId(true) and SetOutputMarkupHolderTag(true?)

raju.ch
In reply to this post by Matthias Keller
Thank you very much