Re: user interface design: if any error, textbox channge to red ... ...

2013-06-26 Thread always_rick
It works. Thank you very much



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/user-interface-design-if-any-error-textbox-channge-to-red-tp4659495p4659797.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



Re: user interface design: if any error, textbox channge to red ... ...

2013-06-16 Thread Martin Grigorov
Hi Joachim,


On Sat, Jun 15, 2013 at 3:15 AM, Joachim Schrod jsch...@acm.org wrote:

 Bas Gooren wrote:
 
  To only update the attribute if the component has errors, override
  method isEnabled on the behavior, cast the component to a
  FormComponent and return !formComponent.isValid().

 And remember that you must not use isValid() in onComponentTag() to
 change tag attributes. You must store the validness in a transient
 property in onConfigure() or onBeforeRender() and check that that
 property in onComponentTag().

 In fact, at least one component in 6.5.x (which we use currently in
 our production system) got this wrong as well.

 Some day, I'll write a post asking why that change was done between
 1.4 and 6.x. If it was intentional or by accident.


I'm not aware of such change.
Please create a quickstart and attach it to a ticket in Jira.
Thanks!



 Joachim

 --
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 Joachim Schrod, Roedermark, Germany
 Email: jsch...@acm.org


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




Re: user interface design: if any error, textbox channge to red ... ...

2013-06-15 Thread always_rick
Thanks a lot.

I will try it on weekend.





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/user-interface-design-if-any-error-textbox-channge-to-red-tp4659495p4659522.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



Re: user interface design: if any error, textbox channge to red ... ...

2013-06-15 Thread Andrey V. Panov
Also you can pass as second argument in AttributeModifier IModel object
which return error on if there feedback message available.

Similar to this:
new AttributeModifier(class, new Model() {
@Override
public Serializable getObject() {
if (currentBill != null  currentBill.id ==
item.getModelObject().id) {
return success;
}
return null;
}
})


user interface design: if any error, textbox channge to red ... ...

2013-06-14 Thread always_rick
I am able to do it with AttributeModifier.append( class, error ).

However, if I press F5, the feedback message disappears, the textbox
remains red. It seems that error stays there forever.

Did I missing something? 

How does the feedback message work?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/user-interface-design-if-any-error-textbox-channge-to-red-tp4659495.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



Re: user interface design: if any error, textbox channge to red ... ...

2013-06-14 Thread Bas Gooren

Hi!

Feedback messages are cleanup up (removed) after each request.

The attribute modified you added to the component, remains in place if 
the page is stateful.

That's why the field still has the error class after a reload.

You can do a number of things to make this work, but the essence is that 
the attribute should only be updated if the form component has errors.
You can then add this behavior (e.g. the attribute modifier) to all 
formcomponents when constructing the form. This can also be automated 
with a component instantiation listener.


To only update the attribute if the component has errors, override 
method isEnabled on the behavior, cast the component to a FormComponent 
and return !formComponent.isValid().


Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 14-6-2013 15:03, schreef always_rick:

I am able to do it with AttributeModifier.append( class, error ).

However, if I press F5, the feedback message disappears, the textbox
remains red. It seems that error stays there forever.

Did I missing something?

How does the feedback message work?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/user-interface-design-if-any-error-textbox-channge-to-red-tp4659495.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





Re: user interface design: if any error, textbox channge to red ... ...

2013-06-14 Thread Joachim Schrod
Bas Gooren wrote:
 
 To only update the attribute if the component has errors, override
 method isEnabled on the behavior, cast the component to a
 FormComponent and return !formComponent.isValid().

And remember that you must not use isValid() in onComponentTag() to
change tag attributes. You must store the validness in a transient
property in onConfigure() or onBeforeRender() and check that that
property in onComponentTag().

In fact, at least one component in 6.5.x (which we use currently in
our production system) got this wrong as well.

Some day, I'll write a post asking why that change was done between
1.4 and 6.x. If it was intentional or by accident.

Joachim

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Joachim Schrod, Roedermark, Germany
Email: jsch...@acm.org


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