Timo, Thanks a lot for your reply, regarding your answer I’m suspecting that
something is probably wrong with the Model of wmc2. I would like please to
show how did I implemented the Model of wmc2 and hopefully you’ll notice
something wrong over there:
final WebMarkupContainer wmc1= new WebMarkupContainer("wmc1");
wmc1.setOutputMarkupId( true );
…
WebMarkupContainer wmc2 = new WebMarkupContainer("wmc2", new
TrackSummeryModel());
wmc2.setOutputMarkupId( true );
wmc1.add( wmc2 );
wmc2.add( new Label("new", ((ArrayList<Integer>)wmc2.getModelObject()).get(
4 ).toString()) );
wmc2.add( new Label("running",
((ArrayList<Integer>)wmc2.getModelObject()).get( 0 ).toString()) );
wmc2.add( new Label("completed",
((ArrayList<Integer>)wmc2.getModelObject()).get( 3 ).toString()) );
wmc2.add( new Label("success",
((ArrayList<Integer>)wmc2.getModelObject()).get( 1 ).toString()) );
wmc2.add( new Label("errors",
((ArrayList<Integer>)wmc2.getModelObject()).get( 2 ).toString()) );
this.add (wmc1); //"this" extends wicket WebPage
…and wmc2 Model looks like the following:
public class TrackSummeryModel extends AbstractReadOnlyModel {
private static final long serialVersionUID = -4460246538584276209L;
@Override
public Object getObject()
{
ArrayList<Integer> result = null;
try {
result = QueryDB.summerizeTracks();
}
catch ( Exception e ) {
error( "Error while retrieving Track summery: " +
e.getMessage() );
}
return result;
}
}
I expect that TrackSummeryModel should be called its getObject() method
while need rendering (wmc2 is a child of wmc1 and wmc1 was added to the
target of some Ajax component).
The TrackSummeryModel:getObject() method is called only 5 times at the
construction of the page for each new Label I’m adding and then it stops
called for ever (BTW: wmc1 has a DataView component as a child and it
refresh via Ajax)
BTW: I attached the model’s labels such way since I’m dealing with
ArrayList<Integer> and not a simple POJO. Maybe I must create a POJO class
with 5 properties (new, running, etc) ?
Another thing:
As you suggested, I used the WICKET AJAX DEBUG and I was wondering why wmc1
enclosed within component id while wmc2 not:
...><component id="wmc1_16" encoding="wicket1" ><![CDATA[<div id="
wmc1_16">
<div id="wmc2_17">
<table cellpadding="0" cellspacing="5" class="filterBy">
<tr>
<td class="details">New:</td><td>0New: </td>
<td class="details">Running:Running: </td><td>3</td>
<td class="details">Completed:Completed:
</td><td>23</td>
<td class="details">Success:Success: </td><td>0</td>
<td class="details">Errors:Errors: </td><td>23</td>
</tr>
</table>
</div>
...
Any idea? something?...:-(
Timo Rantalaiho wrote:
>
> On Tue, 02 Dec 2008, simonm wrote:
>> <div wicket:id="wmc1">
>> <div wicket:id="wmc2">
> ...
>> The problem: wmc1 is updates while Ajaxing it (wmc1 was added as a target
>> for some ajax component), while wmc2 not!!
>> I thought that wmc2 should be updated too since it is a child of a wmc1.
>
> Exactly. You can check out the exact behavior from the
> Ajax debug console (visible when running with
> -Dwicket.configuration=development ), but because updating
> wmc1 with Ajax means replacing the corresponding div
> entirely, it definitely replaces all of its contents as
> well.
>
> Most probably your problem is due to a model of wmc2 which
> still makes it display old data on the next render.
>
> Other possibility is an error in the Ajax update; that
> should be visible in the Ajax debug console.
>
> If you want others to investigate further, you should make
> a quickstart that demonstrates the problem. It's also a good
> exercise as you'll probably solve this issue while preparing
> the quickstart ;)
>
> Best wishes,
> Timo
>
> --
> Timo Rantalaiho
> Reaktor Innovations Oy <URL: http://www.ri.fi/ >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/WebMarkupContainer-within-WebMarkupContainer-not-updated-when-Ajax-update-tp20796182p20814413.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]