Hello,

(I have been unable to locate a current and working
wicketstuff mailing list, so I am sending to
wicket mailing list instead. I searched for quite
some time. This is really confusing with the old
SF list still accepting subscribe requests etc etc)

We are using wicket, wicketstuff and a colletion of
wicket best pratices found on the net. Thus, we use
DataTable with sorting and filtering.

This works great, but I noticed a few days ago, that as
soon as you have 2 or more TextFilteredPropertyColumn
in your FilterToolbar, the browser will not submit the
form upon pressing enter.

Of course this is standard behaviour for a browser, but
there must be a solution for this situation, must it not ?

I found the Form.setDefaultButton(), but this requires an
explicit (and visible) defaultSubmittingComponent, which I
don't have or want.

I also found the GoFilter / GoAndClearFilter, but these seem
to me to be for usage within a form, but not within a DataTable
FilterToolbar. (potentially, every column is occupied by a
filter - where would I put the GoFilter ?)

To submit the filters, probably some JavaScript magic is
required, BUT - the Javascript is (already) in the
Form.appendDefaultButtonField() / .onComponentTagBody(),
at least partially, is it not ?

To make it worse, we have a SubmittingOrderByLink as found
on the net, which has another "funky javascript submit
magic" like

    protected final String getTriggerJavaScript() {
        if (getForm() != null) {
            // find the root form - the one we are really going to submit
            Form<?> root = getForm().getRootForm();
            StringBuffer sb = new StringBuffer(100);
            sb.append("var e=document.getElementById('");
            sb.append(root.getHiddenFieldId());
            sb.append("'); e.name=\'");
            sb.append(getInputName());
            sb.append("'; e.value='x';");
            sb.append("var f=document.getElementById('");
            sb.append(root.getMarkupId());
            sb.append("');");
            if (getForm() != root) {
                sb.append("var ff=document.getElementById('");
                sb.append(getForm().getMarkupId());
                sb.append("');");
            } else {
                sb.append("var ff=f;");
            }
sb.append("if (ff.onsubmit != undefined) { if (ff.onsubmit()==false) return false; }");
            sb.append("f.submit();e.value='';e.name='';return false;");
            return sb.toString();
        } else {
            return null;
        }
    }

Actually, I should not add a 3rd magic submit solution to the page,
should I ? I'm not happy with all that, and very confused.
I hope you can point me in the right direction.

Thanks in advance,
Cheers, Tom.


PS: I could not find a single place of Documentation for DataTable
& related. If there were a definite correct place in the wiki, I would
add some findings and examples later...



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to