Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting parameters from another class in Java
    primarykey
    data
    text
    <p>I Have a simple problem but i can't solve it.. I'm using wicket. On the web application i have a button (load). When i click that button, some data loads from the web, saves in the DataBase and then loads to the on the web application (StartPage.html). I have another button for correction that data (edit), and when i click it, EditPage.html loads. So i have just 2 pages. After some corrections on the EditPage.html I click save-button and new data updates in the DataBase and then should be loaded in the on the web application(StartPage.html).</p> <p>It's simple, but before i click the "load" button, the should be clean. So if i'll clean the table before the "load"-click it will be cleaned up every time i click the "edit"-button. i've tried to make some flags, or send parameters to the StartPage, but it seems like a circle.</p> <p>StartPage should every time loads data but 1st time cleans table but then not. The problem is to send parameters somehow..</p> <p>I hope it's clear, any suggestions?</p> <p><strong>Updated:</strong></p> <p>EditPage</p> <pre><code>public class EditPage extends WebPage { public EditPage(final PageParameters parameters) { Form&lt;?&gt; form = new Form&lt;Void&gt;("form") { @Override protected void onSubmit() { // if button "save" clicked PageParameters params = new PageParameters(); params.add("flag", "true"); setResponsePage(StartPage.class, params); } }; } } </code></pre> <p>StartPage</p> <pre><code>public class StartPage extends WebPage { public StartPage(final PageParameters parameters) { String flag = parameters.getString("flag") if (flag=="false") // Delete from DB Form&lt;?&gt; form = new Form&lt;Void&gt;("form") { @Override protected void onSubmit() { // Load from web to DB } }; // Load from DB } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload