Hi all,
I have the problem related to showing the button on the page. There are two buttons called “Upload” and “Save”. On the beginning “Upload” button is visible, while Save button has .setVisible(false).
…
<tr>
<td width="35%" align="right">
<input type="submit" wicket:id="createUploadButton" value="Upload" class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all"/>
</td>
<td width="30%" align="right">
</td>
<td width="35%" align="left">
<input type="submit" wicket:id="createCancelButton" value="Cancel" class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all"/>
</td>
</tr>
During the AjaxRequest of Upload button it is necessary to show “Save” button and to hide Upload button, but there is the error. Code snippet is shown below:
AjaxButton createSaveButton=new IndicatingAjaxButton("createSaveButton"){
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
// TODO Auto-generated method stub
}
};
createSaveButton.setVisible(uploaded);
createSaveButton.setOutputMarkupId(true);
form.add(createSaveButton);
AjaxButton createUploadButton=new IndicatingAjaxButton("createUploadButton"){
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
…
createUploadButton.setVisible(false);
createSaveButton.setVisible(true);
target.addComponent(createUploadButton);
target.addComponent(createSaveButton);
}
createUploadButton.setOutputMarkupId(true);
form.add(createUploadButton);
Does somebody know where the problem is?
Thanks! Sonja