On Sun, Jul 24, 2011 at 5:10 PM, Michael Petritsch
<[email protected]> wrote:
> I am using wicket 1.4.16, the markupplaceholder is there (checked with 
> firebug).
>
> I have also tried it with a simple visible label:
>
> public class MyPanel extends Panel {
>  Label myUpdatedLabel;
>  public MyPanel() {
>    add(new AbstractDefaultAjaxBehavior() {
Why do you use this behavior but not a more specific one ? E.g.
AjaxEventBehavior.
>            @Override
>            protected void respond(AjaxRequestTarget target) {
>              myUpdatedLabel.setDefaultModel("bar");
>              target.addComponent(myUpdatedLabel);
>            }
>    }
>    myUpdatedLabel = new Label("myLabel","foo");
>    myUpdatedLabel.setOutputMarkupId(true);
>    add(myUpdatedLabel);
> }
>
> This works, however what I actually have to do in the response()
> method is the following:
> myUpdatedLabel = new Label("myLabel","bar");
> myUpdatedLabel.setOuputMarkupId(true);
> target.addComponent(myUpdatedLabel);
What you really want is:
myUpdatedLabel.setDefaultModelObject("bar");
target.addComponent(myUpdatedLabel);
>
> But when I try this nothing happens. The html of the label remains
> untouched: <div id="myLabeld" wicket:id="myLabel">foo</div>
setOutputMarkupPlaceholderTag(true) is needed only if you change the
visibility of Ajax updated component. I don't see visibility related
logic in your code.

What exactly you want to achieve ?
>
> On Mon, Jul 18, 2011 at 4:59 AM, msj121 <[email protected]> wrote:
>> I am not sure if it is still true, but if you have the label added, just the
>> visibility is false from the beginning, then in older versions of wicket it
>> would not actually put the component, even the placeholder. I dealt with
>> this before, but I think in newer versions presumably this was changed....
>> In theory a good way to check if this is an issue is to setvisible to true
>> in the beginning and alternate.
>>
>>
>> If your trying to add a new markup that never existed in html to the page,
>> it should throw an error, and then you will need to use ListViews etc... as
>> described above.
>>
>> --
>> View this message in context: 
>> http://apache-wicket.1842946.n4.nabble.com/Loading-wicket-components-from-javascript-tp3673381p3674372.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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

Reply via email to