Wicket: Submit Form in a Panel from another Panel

monti

I got a Page with 2 Panels (panel a and panel b). I use one of those panels (panel b) for showing some data in a table. I added a form and some checkboxes to this table. My second panel (panal a) is used for showing buttons. I want to submit the form of panel b by pushing a button of panel a, so I can do some stuff with the checked ones.

I searched a little bit and I think I have to use an ajax submit link. But I dont get how I get my checked rows.

Page Markup:

<wicket:extend xmlns:wicket="http://wicket.apache.org">
   <div style="margin-top: 60px">
       <h2><span wicket:id="header"></span></h2>
       <div wicket:id="categoryButtonPanel"></div>
       <div wicket:id="categoryTablePanel"></div>
   </div>
</wicket:extend>

this is how I add my checkboxes in panel b (categoryTablePanel):

Form form = new Form("form");
final List<Category> selectedCategorys = new ArrayList<Category>(); //my list where my selected rows are in
CheckGroup group = new CheckGroup("group", selectedCategorys);

DataView dv = new DataView("categoryList", dataProvider) {

      @Override
      protected void populateItem(Item item) {
          final Category category = (Category) item.getModelObject();
          final CompoundPropertyModel<Category> categoryModel = new CompoundPropertyModel<Category>(category);

          item.add(new Check("checkBox", item.getModel()));
          // some more binded rows
 }
};

Markup:

<wicket:panel xmlns:wicket="http://wicket.apache.org">
<form wicket:id="form">
<span wicket:id="group">
<div class="table table-striped table-hover table-condensed" style="overflow: auto !important;" wicket:id="categoryTable">
        <table class="table table-striped">
            <thead>
                <th><input type="checkbox" wicket:id="selector">check/uncheck all</input></th>
            </thead>
            <tbody>
                <tr wicket:id="categoryList">
                    <td>
                        <input type="checkbox" wicket:id="checkBox" />
                    </td>
                </tr>
            </tbody>
        </table>
        <div wicket:id="paginator"></div>
    </div>
    </span>
</form>
</wicket:panel>

I can actually check every row, and if I create a normal button inside the form I can use the list selectedCategorys to do some stuff with the data.

Now I want to add one or two buttons in my second panel (categoryButtonPanel) to do some things with my data. But how?

RobAu

Just creating the AjaxSubmitLink using this constructor should work:

AjaxSubmitLink(String id, Form<?> form)

So you need to somehow pass the form to the other panel to add it to the submitlink. Personally, I would add both the panels to a big form.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Wicket: Submit Form in a Panel from another Panel

From Dev

Update one Wicket Panel from clicking an item in another Wicket Panel

From Dev

open a form in a panel from a form inside that panel

From Dev

ExtJs 4 - Form panel submit without params

From Dev

Wicket Panel inside of a Fragment

From Dev

Refresh panel in Wicket with BootstrapDownloadLink

From Dev

Title for Tabbed Panel in wicket

From Dev

passing parameters to wicket panel

From Dev

Unchecked all checkbox in a form inside a groupbox inside a panel and another panel

From Dev

Submit posts from users without wordpress panel

From Dev

Call method from a panel at another class(the method) that terminats current panel

From Dev

Set same panel height from another panel height

From Dev

Draw a rectangle in a panel of a form when a button click event is fired from another form

From Dev

Wicket: add TextField / Panel dynamically

From Dev

Ext.form.Panel submit() timeout not being enforced

From Dev

JAVA Swing - tabbed panel setSelectedIndex() on a card panel from another card panel

From Dev

How to capture values from panel placed on a form

From Dev

NullPointerException when trying to getText from another panel

From Dev

SenchaTouch - Move items from one panel to another

From Dev

CardLayout changing panel from another class

From Dev

How to open form from Child Form and show in main form panel

From Dev

Displaying a panel in another windows form on button click c#

From Dev

how to change the content of a panel using another panel from another classe in java

From Dev

Reshaping Data into panel form

From Dev

Panel directly proportional with form

From Dev

Reshaping Data into panel form

From Dev

wicket refresh listView in different panel using ajax

From Dev

Docking form in panel and then un-dock It from same form

From Dev

Switch to another panel wxpython

Related Related

  1. 1

    Wicket: Submit Form in a Panel from another Panel

  2. 2

    Update one Wicket Panel from clicking an item in another Wicket Panel

  3. 3

    open a form in a panel from a form inside that panel

  4. 4

    ExtJs 4 - Form panel submit without params

  5. 5

    Wicket Panel inside of a Fragment

  6. 6

    Refresh panel in Wicket with BootstrapDownloadLink

  7. 7

    Title for Tabbed Panel in wicket

  8. 8

    passing parameters to wicket panel

  9. 9

    Unchecked all checkbox in a form inside a groupbox inside a panel and another panel

  10. 10

    Submit posts from users without wordpress panel

  11. 11

    Call method from a panel at another class(the method) that terminats current panel

  12. 12

    Set same panel height from another panel height

  13. 13

    Draw a rectangle in a panel of a form when a button click event is fired from another form

  14. 14

    Wicket: add TextField / Panel dynamically

  15. 15

    Ext.form.Panel submit() timeout not being enforced

  16. 16

    JAVA Swing - tabbed panel setSelectedIndex() on a card panel from another card panel

  17. 17

    How to capture values from panel placed on a form

  18. 18

    NullPointerException when trying to getText from another panel

  19. 19

    SenchaTouch - Move items from one panel to another

  20. 20

    CardLayout changing panel from another class

  21. 21

    How to open form from Child Form and show in main form panel

  22. 22

    Displaying a panel in another windows form on button click c#

  23. 23

    how to change the content of a panel using another panel from another classe in java

  24. 24

    Reshaping Data into panel form

  25. 25

    Panel directly proportional with form

  26. 26

    Reshaping Data into panel form

  27. 27

    wicket refresh listView in different panel using ajax

  28. 28

    Docking form in panel and then un-dock It from same form

  29. 29

    Switch to another panel wxpython

HotTag

Archive