Je suis nouveau à portillon incorporé, et je reçois oici erreur lorsque je tente de lancer ma demande:erreur
WicketMessage: id contenu de la fenêtre Modal est erroné. ID de composant: myPanel; ID contenu: Contenu:
dans mon AddStudent html:
<span wicket:id="InformationDialog"/>
<span wicket:id="myPanel"/>
Ce sont les premières choses après ma balise d'ouverture
dans AddStudent.java (dans le constructeur):
panel=new InformationPanel("myPanel");
message=new ModalWindow("InformationDialog");
message.setContent(panel);
message.setCssClassName(ModalWindow.CSS_CLASS_BLUE);
message.setTitle("Important Information");
où InformationPanel étend le panneau:
<html>
<wicket:panel>
<table>
<tr>
<td><span wicket:id="message"/></td>
</tr>
<tr>
<td><input type ="button" value ="OK" wicket:id="ok"/></td>
</tr>
</table>
</wicket:panel>
<html>
De toute évidence, j'ai une classe java il correspondante pourrait ne pas être pertinent, mais il est ici:
package myapp.project;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.panel.Panel;
public class InformationPanel extends Panel {
private Button ok;
private Label messageLabel;
public InformationPanel(String id){
super(id);
messageLabel=new Label("message","");
ok=new Button("ok"){
public void onSubmit(){
AddStudent student = new AddStudent();
setResponsePage(student);
}
};
add(ok);
add(messageLabel);
}
public void setSuccessful(){
messageLabel.setDefaultModelObject("You have successfully added the student");
}
public void setUnSuccessful(){
messageLabel.setDefaultModelObject("A student with that username already exists!");
}
}
Aucune idée du problème. Merci à l'avance
Merci, mais maintenant il est dit: WicketMessage: Impossible de trouver le composant avec l'ID 'InformationDialog' dans [MarkupContainer [Component id = _extend8]]. Cela signifie que vous avez déclaré wicket: id = InformationDialog dans votre balisage, mais que vous n'avez pas ajouté le composant à votre page, ou que la hiérarchie ne correspond pas. [markup = fichier:/C: /workspace/MyApp/context/WEB-INF/classes/myapp/project/AddStudent.html –
C'est une discordance entre votre balisage html et votre java. Votre classe AddStudent manque-t-elle un 'add (message)'? –
Cest juste -réalisé très peu de temps après que j'ai posté-pensé que j'ai posté que je l'ai trié, mais évidemment pas. Merci beaucoup! –