Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8335073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:33:16+00:00 2026-06-09T03:33:16+00:00

i have an enum in my data-class as follows public enum ProcStat { NOT_READY

  • 0

i have an enum in my data-class as follows

public enum ProcStat
{

    NOT_READY               ((byte)-1, "Not Ready For Processing"),
    READY_FOR_PROCESSING    ((byte)0,  "Ready For Processing"),
    BEING_PROCESSED         ((byte)1,  "Being Processed"),
    PROCESSED_SUCCESSFULLY  ((byte)2,  "Processed Successfully"),
    MSG_SUPPRESSED          ((byte)98, "Msg suppressed before processing"),
    PROCESSED_ERROR         ((byte)99, "Processed With Error");

    private final Byte statByte; 
    private final String  statusDesc;
    ProcStat(Byte statByte, String statusDesc)
    {
        this.statByte = statByte;
        this.statusDesc = statusDesc;
    }
    @Override
    public String toString()
    {
        return statusDesc;
    }
    protected static ProcStat getProcStat(Byte procStat)
    {
        if (READY_FOR_PROCESSING.statByte.equals(procStat))             
        {
            return READY_FOR_PROCESSING;
        }           
        else if (BEING_PROCESSED.statByte.equals(procStat))             
        {
            return BEING_PROCESSED;
        }
        else if (PROCESSED_SUCCESSFULLY.statByte.equals(procStat))
        {   
            return PROCESSED_SUCCESSFULLY;
        }
        else if (MSG_SUPPRESSED.statByte.equals(procStat))
        {   
            return MSG_SUPPRESSED;
        }           
        else if (PROCESSED_ERROR.statByte.equals(procStat))
        {
            return PROCESSED_ERROR;                 
        }
        else
        {
            return NOT_READY;
        }
    }
    public Byte getStatByte()
    {
        return this.statByte;
    }
};

The Proc_Stat refers to a Number field in a DataBase table and i need to show a column on the page where it shows the corresponding String of the numeric proc_stat for each row.
This is how i render any other field of the same data-class on the xhtml page:

id=”dataTable” name=”dataTable” var=”data”

How do i give output value for enum type?
do i give like this : value=”#{data.procstat.toString()}” ??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:33:18+00:00Added an answer on June 9, 2026 at 3:33 am

    I think you need to create method in one of your managed bean that does the same as getProcStat method. Something like:

    public String getProcStat(Byte byte) {
        return ProcState.getProcState(byte).toString();
    }
    

    In xhtml:

    value="#{yourBean.getProcState(data)}"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an example class containing two data points: public enum Sort { First,
I have a data access class with an Enum called Salutation: public enum Salutation
I have an enum class named Status as follows public enum Status { PENDING(0),
I have the following data structure: public class Difference { public Difference() { }
I have a large enum declared in my class public enum CarMaker{ Honda, Toyota,
Does SQL Server 2008 have a a data-type like MySQL's enum ?
I have enum like this [Flags] public enum Key { None = 0, A
i have enum public enum TypeImage { Img=0, Thumb=1 } i want in view
I have enum like this: public enum ObectTypes { TypeOne, TypeTwo, TypeThree, ... TypeTwenty
I have a enum: [Flags] public enum EmailType { PasswordRecovery = 1, Activation =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.