Hi,
You haven't showed the MerchantEditPanel, so first make sure it uses an
ajax component to submit the form. Then, in its submit method, you
should use the following code :
// Closes modal window
edit.close(ajaxRequestTarget);
// Refreshes the <form wicket:id="UpdateForm"> element and all its children
ajaxRequestTarget.add(editModalContainer);
On 20/03/2012 10:37 AM, Ilkemdk wrote:
I want to make a form table with a "update" button. After clicking "update "
button it will open a new small panel, and I can do some changes in it then
submit this panel. Now what I need is after clicking "submit" button on
panel, the panel be closed and the form table can refresh and update. I have
read some article about WebMarkupContainer, but still dont know how to do
it.
My code:
*Page.html*
<div class="container">
<form wicket:id="UpdateForm">
<table>
<tr>
<td>xxx</td><td>xxx</td><td>xxx</td>
</tr>
<tr>
<td>xxx</td><td>...</td><td>...</td>
<tr>
</table>
</form>
</div>
<wicket:child></wicket:child>
<div style="display:none;">
<form wicket:id="editModalContainer">
<div wicket:id="edit">
</div>
</form>
</div>
*Page.Java*
final ModalWindow edit = new ModalWindow("edit");
linkEdit = new AjaxFallbackLink<String>("linkEdit") {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget)
edit.setContent(new
MerchantEditPanel(edit.getContentId(),
edit, refreshables));
edit.setTitle("Merchant Eidt");
edit.setAutoSize(true);
edit.show(ajaxRequestTarget);
}
add(linkEdit);
Form<xxx> editModalContainer = new Form<xxxx>("editModalContainer");
editModalContainer.setOutputMarkupId(true);
add(editModalContainer);
editModalContainer.add(edit);
Thank you very much!
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/New-guy-s-question-about-component-refresh-tp4489029p4489029.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
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