Hi, iam totally stuck and get confused at all.
In my DB-based application i want to use the common data-table-lists (this
works) with linked action (edit, delete, create what ever)
But i want to edit a clicked "entity" under my form. So i think i have to
use a panel for this form i want to update ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.sourceforge.net/"
xml:lang="en"
lang="en">
<body>
<wicket:panel>
<table>
<tr>
<td>Name</td>
<td wicket:id="panel_name">[Name]</td>
</tr>
</table>
</wicket:panel>
</body>
</html>
But i cant figure out how to Fill this Panel right. Actual i tried it this
way:
public class MyPanel extends Panel {
public final String LABEL_NAME = "panel_name";
public MyPanel (String id) {
super(id);
add(new Label(LABEL_NAME));
// TODO Auto-generated constructor stub
}
public MyPanel (String id, Functionsbereich bo){
this(id);
this.setOutputMarkupId(true);
add(new Label(LABEL_NAME, bo.getLabel()));
}
}
and in my page
item.add(
new AjaxLink<Functionsbereich>(
"action",
(IModel<Functionsbereich>)
new LoadableDetachableModel<Functionsbereich>() {
@Override
protected Functionsbereich load() {
return el;
}
}){
@Override
public void onClick(AjaxRequestTarget target) {
target.appendJavascript((String)
dialog.open().render());
target.addComponent(new FunctionsbereichPanel("content",
el));
}
});
but this don't work.. it always tell me that markup with ID "panel_name" is
still registered and has to be unique,
cause i have to define the panel initially as Member in my Page, else wise
the "No definition for markup 'panel_name' markup found" raises.
//Empty Panel
final FunctionsbereichPanel panel = new FunctionsbereichPanel("content");
I hope anyone understood my problem.
Thanks in Advance and apologise for my English, its not my mothers tongue.