New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messages could inform if there are error messages added #157

Closed
ramonchiara opened this Issue Aug 8, 2015 · 5 comments

Comments

Projects
None yet
2 participants
@ramonchiara

ramonchiara commented Aug 8, 2015

Sometimes I have to do some validation in action method.
So, after validations, I'd like to know if there were any messages added.
The feature could check globally or for some specific cliendId.

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Aug 10, 2015

Member

The <o:messages> already supports it.

Check the "Displaying single message" case in http://showcase.omnifaces.org/components/messages

Note that the client ID can be the form itself for a "global" check.

Member

BalusC commented Aug 10, 2015

The <o:messages> already supports it.

Check the "Displaying single message" case in http://showcase.omnifaces.org/components/messages

Note that the client ID can be the form itself for a "global" check.

@BalusC BalusC closed this Aug 10, 2015

@ramonchiara

This comment has been minimized.

Show comment
Hide comment
@ramonchiara

ramonchiara Aug 11, 2015

Probably I didn't make myself clear...
The problem is when I have to test if there were some message added in the action method of a back bean.
Example:

pubic void action() {
   if (...) {
      Messages.add...
   }
   if (...) {
      Messages.add...
   }
   ...

   // problem is here
   if (!Faces.getContext().getMessageList().isEmpty()) {
      return null;
   }

  ...
}

I would like to do something like:

if (Messages.isNotEmpty()) {
    return null;
}

ramonchiara commented Aug 11, 2015

Probably I didn't make myself clear...
The problem is when I have to test if there were some message added in the action method of a back bean.
Example:

pubic void action() {
   if (...) {
      Messages.add...
   }
   if (...) {
      Messages.add...
   }
   ...

   // problem is here
   if (!Faces.getContext().getMessageList().isEmpty()) {
      return null;
   }

  ...
}

I would like to do something like:

if (Messages.isNotEmpty()) {
    return null;
}
@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Aug 12, 2015

Member

I see. Thank you for clarifying.

Member

BalusC commented Aug 12, 2015

I see. Thank you for clarifying.

@BalusC BalusC reopened this Aug 12, 2015

@BalusC BalusC closed this in 15a5705 Aug 12, 2015

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Aug 12, 2015

Member

New methods are available in today's snapshot.

Member

BalusC commented Aug 12, 2015

New methods are available in today's snapshot.

@ramonchiara

This comment has been minimized.

Show comment
Hide comment
@ramonchiara

ramonchiara commented Aug 12, 2015

Cool!!! :-)

@BalusC BalusC added the question label Oct 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment