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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:08:59+00:00 2026-06-11T01:08:59+00:00

I got some troubles with some codes. Now I try to modify/delete personal information

  • 0

I got some troubles with some codes. Now I try to modify/delete personal information , but I enter an invalid value try modify/delete , it’s still pop a new window . I dont know how to modify those code for i enter an invalid value , it will not pop a window .
I have other question . When I enter a valid value , the value cant pass to pop window , like I enter a name to go grab id value , the value cant pass to pop window , how can I reslove it . Thank all !

HTML

<h:panelGrid columns="3" cellspacing="20">
     <h:outputLabel for="name" value="Modify Name"/> <p:inputText value="#{modify.enName}"/>
     <h:commandButton value="Modify System"  style="height:35px" onclick="window.open('#{modify.domodify()}','modify',
                                                      'width=500,height=400,status=yes,resizable=yes,scrollbars=yes') ; return false;"/>
</h:panelGrid>

Java Code

 public String domodify() {
    try {
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("com.mycompany_SuneCoolingSystem_war_1.0-SNAPSHOTPU");
        EmployeeJpaController jpaController = new EmployeeJpaController(null, emf);
        EntityManager e = jpaController.getEntityManager();
        Query q = e.createNamedQuery("Employee.findByEnName");
        q.setParameter("enName", getEnName());
        System.out.println(getEnName());
        List resultList = q.getResultList();
        Employee result = (Employee) resultList.get(0);

        id = result.getId();
        name = result.getName();
        idNumber = result.getIdNumber();
        constellation = result.getConstellation();
        email = result.getEmail();
        enName = result.getEnName();

        rego="CRUD/Modify.xhtml";
    } catch (Exception ex) {
        FacesContext context = FacesContext.getCurrentInstance();
        context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, "No Man", ""));
        rego = "index.xhtml";
    }
    return rego;
}
  • 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-11T01:09:01+00:00Added an answer on June 11, 2026 at 1:09 am
    onclick="window.open('#{modify.domodify()}','modify', 'width=500,height=400,status=yes,resizable=yes,scrollbars=yes')
    

    This code means when clicked, open a new window and perform the action to check what URL is returned. The windows is opened before any logic is executed.

    You should perform an ajax call to the modify with f:ajax (or your component library equivalent, if you want) and use onevent to launch the correct javascript when the ajax calls ends in success and returning the expected value.

    See JSF 2: How show different ajax status in same input? to see an example of dealing with onevent.

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

Sidebar

Related Questions

Got some solved troubles, but want to ask, maybe here is another solution. Here
I got some troubles trying to copy char to char... Here's args[] definition :
So I've got some troubles with character encoding. When I put the following two
I have just installed Delphi 2010 and got some troubles with idHTTP component. If
I am creating a MVC4 application and I have got some troubles when I
I've querying an API and I've got some troubles to display the code returned
I got some troubles using time in my code: txtDauer = new JFormattedTextField(); txtDauer.setFormatterFactory(new
I'm working on a small project and got into some troubles trying to keep
I'm trying to get started using git, but I'm having some troubles right away.
I'm sure I got this to work in the past, but for some reason

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.