Hi all;

 username.add(new AjaxFormComponentUpdatingBehavior("onblur") {
            @Override
            public void onUpdate(AjaxRequestTarget target) {
                String thisUsername = username.getModelObject();
                username.add(new SimpleAttributeModifier("class",
"thinking")); // I need repaint
                target.addComponent(username); // It doesn't work

                // long process
                 try {
                    Thread.sleep(2000);
                } catch (Exception ex) {

                }

                // the result so i need to repaint and send to user again
                if (ArrayUtils.contains(takenUsernames, thisUsername)) {
                    username.add(new SimpleAttributeModifier("class",
"approved"));
                } else {
                    username.add(new SimpleAttributeModifier("class",
"denied"));
                }
                target.addComponent(username);
            }
        });

How can i send Ajax response part by part; before long process i want to
change css and send it to user, after process i again want to send Ajax
response in one method.

Is it possible ?

Thanks.

Reply via email to