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 8998471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:02:09+00:00 2026-06-16T00:02:09+00:00

I want to use the arquillian warp test framework for a JSF project I

  • 0

I want to use the arquillian warp test framework for a JSF project I am developing. I understand that I need to use the CDI annotations instead of the JSF ones to get this to work. I am using @ViewScoped beans so I have included seam-faces in my project to deal with this (i am running on JBoss 7). I have modified my beans to use @Named and where I was using @PostConstruct I have put this into the constructor which all seems to be okay.

When I access a view with a selectOneMenu it never has any list items. Here is the code form the view and the bean.

View:

<h:selectOneMenu value="#{ngoBean.ngo.country}" >
    <f:selectItems value="#{ngoBean.countryValues}" />
</h:selectOneMenu>

Bean:

import com.a.Facade;
import com.a.CountryEnum;
import com.a.GoverningBody;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ViewScoped;
import javax.faces.model.SelectItem;
import javax.inject.Named;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 */
@Named("ngoBean")
@ViewScoped
public class NgoBean implements Serializable {

    private GoverningBody ngo = new GoverningBody();
    private List<GoverningBody> ngoList;
    private boolean edit;

    private List<SelectItem> countryValues;

    @EJB(beanName = "NgoFacadeImpl")
    private Facade<GoverningBody> ngoController;

    public NgoBean(){
    }

    @PostConstruct
    public void init(){
        //TODO this is a bad way of loading db data i should change it
        ngoList = ngoController.findAll();

        countryValues = initCountryValues();
    }

    public void add(){
        ngoList.add(ngoController.save(ngo));

        //reset the variable
        ngo = new GoverningBody();
    }

    public void edit(GoverningBody item) {
        this.ngo = item;
        edit = true;
    }

    public void save() {
        ngo = ngoController.update(ngo);
        edit = false;
    }

    public void delete(GoverningBody item) {
        ngoController.delete(item);
        ngoList.remove(item);
    }

    public List<GoverningBody> getNgoList() {
        return ngoList;
    }

    public GoverningBody getNgo() {
        return ngo;
    }

    public boolean isEdit() {
        return edit;
    }

    public List<SelectItem> getCountryValues() {
        return countryValues;
    }

    public void setCountryValues(List<SelectItem> countryValues) {
        this.countryValues = countryValues;
    }

    public List<SelectItem> initCountryValues() {
        List<SelectItem> items = new ArrayList<>(CountryEnum.values().length);
        int i = 0;
        for(CountryEnum g: CountryEnum.values()) {
            items.add(new SelectItem(g, g.getName()));
        }

        System.out.println("items = " + items);
        return items;
    }
}

I tried annotating the method with @Factory("countryValues") but this didn’t seem to help.

  • 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-16T00:02:10+00:00Added an answer on June 16, 2026 at 12:02 am

    This problem was unrelated to the symptom. The root cause of the problem was an incorrectly located beans.xml this should have be in the WEB-INF directory of the war not the META-INF directory of the ear.

    I also changed the seam-faces dependency to use apache CODI, this is not necessary but this uses @ViewAccessScoped instead of @ViewScoped the different name is less ambiguous I think.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want use spring security taglibs in my jsf project,so I've made ​​the following
I want use a Linq IQueryable Toolkit in project on .NET Compact Framework. The
I want use BYTE_ORDER macro in my Xcode project but i can't because i
I want use jQuery in my project. I know the javascript_include_tag calls the jQuery
I want use page that has this form: <form method=post action=modules.php?name=search> <input onkeypress=FKeyPress(this); onkeydown=FKeyDown(this);
I want to use private drawable from android. for that i have downloade androi-8.jar
i want use XmlSampleGenerator API in my project. i don't know how to add
I want to use Arquillian's Drone extension to configure WebDriver for some functional tests,
i want use single quotations inside a transact sql statement, then execute that statement.
I want use regex to find something in string (or QString) that is between

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.