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

  • Home
  • SEARCH
  • 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 4627510
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:34:40+00:00 2026-05-22T03:34:40+00:00

The following works but when create button is hit is clicked it commits a

  • 0

The following works but when create button is hit is clicked it commits a record with all null filds

<f:view>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>New Movie</title>
        <link rel="stylesheet" type="text/css" href="/diamondfilms.com.ar/faces/jsfcrud.css" />
    </head>
    <body>
    <h:panelGroup id="messagePanel" layout="block">
        <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
    </h:panelGroup>
    <h1>New Movie</h1>
            <h:form>
        <h:inputHidden id="validateCreateField" validator="#{movie.validateCreate}" value="value"/>
        <h:panelGrid columns="2">
            <h:outputText value="Name:"/>
            <h:inputText id="name" value="#{movie.movie.name}" title="Name" />
            <h:outputText value="Sinopsis:"/>
            <h:inputText id="sinopsis" value="#{movie.movie.sinopsis}" title="Sinopsis" />
            <h:outputText value="Cast:"/>
            <h:inputText id="cast" value="#{movie.movie.cast}" title="Cast" />
            <h:outputText value="Trailer:"/>
            <h:inputText id="trailer" value="#{movie.movie.trailer}" title="Trailer" />
            <h:outputText value="Release:"/>
            <h:selectOneRadio id="release" value="#{movie.movie.release}" title="Release">
                <f:selectItem itemLabel="YES" itemValue="S" />
                <f:selectItem itemLabel="NO" itemValue="N" />
            </h:selectOneRadio>
            <h:outputText value="Facebook Button:"/>
            <h:inputText id="imagen6" value="#{movie.movie.facebookButton}" title="Image6" />       
         <h:form id="calendarForm2">
            <h:outputLabel for="releaseDate" value="Date (MM/dd/yyyy HH:mm:ss): "/>
            <t:inputCalendar id="releaseDate" monthYearRowClass="yearMonthHeader" weekRowClass="weekHeader" popupButtonStyleClass="standard_bold"
                currentDayCellClass="currentDayCell" value="#{movie.movie.releaseDate}" renderAsPopup="true"
                popupTodayString="Hoy :"
                popupDateFormat="MM/dd/yyyy" popupWeekString="Semana :"
                helpText="MM/DD/YYYY"
                forceId="true">
              <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
            </t:inputCalendar>
         </h:form>
      </h:panelGrid>
     </h:form>                
            <h:form id="uploadForm1" enctype="multipart/form-data" >
                <h:outputText value="Image1:"/>
                <t:inputFileUpload id="file" value="#{movie.upLoad.upFile}" required="true" />
                <h:commandButton value="Upload" action="#{movie.upLoadFile}" />
           </h:form>
        <h:form>
        <br />
        <h:commandLink action="#{movie.create}" value="Create"/>
        <br />
        <br />
        <h:commandLink action="#{movie.listSetup}" value="Show All Movie Items" immediate="true"/>
        <br />
        <br />
        <h:commandLink value="Index" action="welcome" immediate="true" />
    </h:form>
    </body>
</html>

where:

private MovieFacade jpaController = null;

@Resource
private UserTransaction utx = null;

    public String create() {
    try {
        utx.begin();
    } catch (Exception ex) {
    }
    try {
        Exception transactionException = null;
        jpaController.create(pelicula);
        try {
            utx.commit();
        } catch (javax.transaction.RollbackException ex) {
            transactionException = ex;
        } catch (Exception ex) {
        }
        if (transactionException == null) {
            JsfUtil.addSuccessMessage("Movie was successfully created.");
        } else {
            JsfUtil.ensureAddErrorMessage(transactionException, "A persistence error occurred.");
        }
    } catch (Exception e) {
        try {
            utx.rollback();
        } catch (Exception ex) {
        }
        JsfUtil.ensureAddErrorMessage(e, "A persistence error occurred.");
        return null;
    }
    return listSetup();
}

It even validates
Thank you very much!!

  • 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-05-22T03:34:41+00:00Added an answer on May 22, 2026 at 3:34 am

    Your create button is not in the same form as the input values. You need to put the input of interest in the same form as the command link/button.

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

Sidebar

Related Questions

It seems that the following piece of HTML is ignored in IE7 but works
The following html code works in Firefox, but for some reason fails in IE
Given the following code,the hover function works correctly, but when clicked, loses the clicked_no_event_box
I am using following code to create a list dynamically. It works fine but
The following works in Firefox, but breaks in IE7 & 8: $(#my-first-div, #my-second-div).hide(); so
the following js works fine in FF2 but in IE6 the dropdown always selects
The following code works great in IE, but not in FF or Safari. I
The following code works for 90+ % of global security groups, but for one
I have the following query which works fine with MySQL but refuses to work
Using the following model, I expect that when the Submit button is hit, the

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.