That HTML doesn't look valid to me:
Your THs belong inside a TR, and while you're at it move that one into a
THEAD.
https://www.w3schools.com/tags/tag_th.asp
Maybe this is just a problem with replacing the HTML in the browser,
this is why I adviced you to check the response of the Ajax request in
the Browser network tab.
Sven
On 03.11.22 08:11, Laurent Duparchy wrote:
You need more than that ?
<div id="wakeUpForm">
<form wicket:id = "wakeUpForm">
<div wicket:id="devicesGroup">
<table class="wakeUptable" >
<th><wicket:message key="selectMessage"/></th>
<th><wicket:message key="hostNameMessage"/></th>
<th><wicket:message key="macMessage"/></th>
<th><wicket:message key="reachable"/></th>
<th><wicket:message key="removeMessage"/></th>
<tbody>
<tr wicket:id="userDevicesListView">
...
</div>
*Laurent Duparchy
ESRF - The European Synchrotron
MIS Unit
04 76 88 22 56*
Sven Meier wrote on 02/11/2022 17:38:
Show us the relevant markup please.
Sven
On 02.11.22 15:13, Laurent Duparchy wrote:
Hi,
Yes, *devicesGroup *is initially visible. Everything seems fine in
terms of Ajax request/response.
When I add only the *feedbackpanel*, it is correctly added and
painted with the correct feedback message
When I add *devicesGroup*, nothing is repainted, including the
*feedbackpanel*.
I tried to add only the *userDevicesListView *for repaint, but there
is an error saying that it's not possible to add a repeater and to
add its parent... which is devicesGroup.
There's probably a flaw in the devicesGroup design. Basically it
contains a list of items w/ two possible ajax action : "check" and
"delete".
"Check" will only gives a result in the feedback panel and is
working fine.
"Delete" will, you guessed, delete the item and repaint the list.
The item is truly deleted, in the database and /userDevices /list is
reloaded.
it is designed as follow (worked fined w/ Wicket 1.4)
/
private class UserDevicesLoadableDetachableModel extends
LoadableDetachableModel {
private List userDevices ;
...
}
private class UserDevicesListView extends ListView {
public UserDevicesListView(String id,
UserDevicesLoadableDetachableModel imodel) {
super(id, imodel);
}
...
}
/
/userDevicesListView = new
UserDevicesListView("userDevicesListView",
userDevicesLoadableDetachableModel);//
/
/devicesGroup = new CheckGroup<Device>("devicesGroup", new
ArrayList<>()){//
// public boolean isVisible() {...}//
//} /
/devicesGroup.setOutputMarkupId(true);//
//devicesGroup.setOutputMarkupPlaceholderTag(true);//
//devicesGroup.setRenderBodyOnly(false);//
//devicesGroup.add(new CheckGroupSelector("devicesGroupSelector"));//
//devicesGroup.add(userDevicesListView);//
//
//
/
*Laurent Duparchy
ESRF - The European Synchrotron
MIS Unit
04 76 88 22 56*
Ernesto Reinaldo Barreiro wrote on 29/10/2022 04:06:
Hi,
is devicesGroup initially visible? if not you need to
setOutputMarkupplaceHolder(true) in it. Because otherwise wicket
will not
output anything for it and AJAX replacement will fail at client side.
On Fri, Oct 28, 2022 at 4:27 PM Martin Grigorov<mgrigo...@apache.org>
wrote:
Hi Laurent,
Few questions:
1) is the Ajax call actually executed ?
Set a breakpoint inside #onClick() and see whether it breaks
2) Is there any error (Java or JavaScript) ?
Check both the server logs and the browser console
On Fri, Oct 28, 2022 at 10:45 AM Laurent Duparchy<dupar...@esrf.fr>
wrote:
Hi,
Sorry for the basic question.... If this is the wrong place to ask,
please
tell me.
If there is a relevant documentation to read, tell me as well.
I'm upgrading a very old & small app from Wicket 1.4 to Wicket 9.
Following an Ajax call, one component is not refreshed as it was
before.
This is the "userDevicesListView" which is inside the "devicesGroup"
component. See below.
<div id="wakeUpForm">
<form wicket:id = "wakeUpForm">
<div wicket:id="devicesGroup">
<table class="wakeUptable" >
<th><wicket:message key="selectMessage"/></th>
<th><wicket:message key="hostNameMessage"/></th>
<th><wicket:message key="macMessage"/></th>
<th><wicket:message key="reachable"/></th>
<th><wicket:message key="removeMessage"/></th>
<tbody>
<tr wicket:id="userDevicesListView">
...
</div>
Upon the Ajax call the userDevicesListView is changed and
devicesGroup is
added to the target and should be rendered / repainted but it is
not.
public void onClick(Optional<AjaxRequestTarget> target) {
Device deviceToRemove = (Device) getModelObject();
try {
removeDevice(deviceToRemove, user);
info(deviceToRemove.getHostName() + " " +
getString("device.removed"));
} catch (Exception e) {
LOG.error("error while deleting" +
deviceToRemove.getHostName(), e);
error(e);
}
target.get().add(devicesGroup);
target.get().add(feedbackPanel);
}
---------------------------------------------------------------------
To unsubscribe, e-mail:users-unsubscr...@wicket.apache.org
For additional commands, e-mail:users-h...@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org