Issues arise when using the "placeholder" attribute within a <p:inputText tag while the inputText is devoid of any value

A current project involves implementing JSF Mojarra 2.3.9.SP02 alongside PrimeFaces 7.0 on Wildfly 17 using the Sapphire template provided by PrimeFaces. However, I've encountered a significant issue with a specific <p:inputText element within my form. This input field has a specified placeholder and an initial empty value. It is situated as the first input field below the panel group labeled "Kontaktperson" (refer to attached image)

https://i.stack.imgur.com/j7CzZ.png

Below you can find a concise example of the code:

=========== .xhtml file ==================

<!DOCTYPE html>
<h:head>
    <f:facet name="first">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
        <meta name="apple-mobile-web-app-capable" content="yes" />
    </f:facet>
    <title>Hello</title>
    <h:outputScript name="js/nanoscroller.js" library="sapphire-layout" />
    <h:outputScript name="js/layout.js" library="sapphire-layout" />
    <h:outputScript name="js/ripple.js" library="sapphire-layout" />
</h:head>

<h:body>
    <style>
        .md-inputfield_marg_top{
            margin-top: 10px;
        }
    </style>          
                
  <div class="ui-g ui-fluid">   
        <div class="card card-w-title">
            <h:form id="resultsFormId">
                    
                        <div class="card-title">Edit Company Details</div> 
                              <p:fieldset legend="Contact Person" toggleable="true" toggleSpeed="500">
                              <div class="ui-g-12 ui-md-2">
                                   <div class="ui-inputgroup">
                                      <span class="ui-inputgroup-addon">
                                          <i class="material-icons">account_circle</i>
                                      </span>
                                      <h:panelGroup styleClass="md-inputfield md-inputfield_marg_top">
                                          <p:inputText value="#{fdTestBean.titel}" placeholder="Mr."/>
                                          <label>Title</label>
                                      </h:panelGroup>     
                                    </div>
                              </div>
                              <div class="ui-g-12 ui-md-2"/>
                              <div class="ui-g-12 ui-md-8">
                                   <div class="ui-inputgroup">
                                      <span class="ui-inputgroup-addon">
                                          <i class="material-icons">account_circle</i>
                                      </span>
                                      <h:panelGroup styleClass="md-inputfield md-inputfield_marg_top">
                                          <p:inputText value="#{fdTestBean.qualifikation}" />
                                          <label>Qualification</label>
                                      </h:panelGroup>     
                                    </div>
                              </div>
                              <div class="ui-g-12 ui-md-6">
                                   <div class="ui-inputgroup">
                                      <span class="ui-inputgroup-addon">
                                          <i class="material-icons">account_circle</i>
                                      </span>
                                      <h:panelGroup styleClass="md-inputfield md-inputfield_marg_top">
                                          <p:inputText value="#{fdTestBean.vorname}"/>
                                          <label>First Name</label>
                                      </h:panelGroup>     
                                    </div>
                              </div>
                              <div class="ui-g-12 ui-md-6">
                                   <div class="ui-inputgroup">
                                      <span class="ui-inputgroup-addon">
                                          <i class="material-icons">account_circle</i>
                                      </span>
                                      <h:panelGroup styleClass="md-inputfield md-inputfield_marg_top">
                                          <p:inputText value="#{fdTestBean.nachname}"/>
                                          <label>Last Name</label>
                                      </h:panelGroup>     
                                    </div>
                              </div>
                          </p:fieldset>
           </h:form>
      </div>
   </div>
    
    <h:outputStylesheet name="css/nanoscroller.css" library="sapphire-layout" />
    <h:outputStylesheet name="css/ripple.css" library="sapphire-layout" />
    <h:outputStylesheet name="css/grid.css" library="sapphire-layout" />
    <h:outputStylesheet name="css/layout-#{guestPreferences.layout}.css" library="sapphire-layout" />
   </h:body>
</html>

For reference, here is the associated backing bean code:

package at.home.digest.web.ave.makler.firma;

import java.io.Serializable;

import javax.inject.Named;

@Named("fdTestBean")
@javax.faces.view.ViewScoped
public class FDTestBean implements Serializable {

    private String titel;

    private String qualifikation;

    private String vorname;

    private String nachname;

    public String getTitel() {
        return titel;
    }

    public void setTitel(String titel) {
        this.titel = titel;
    }

    public String getQualifikation() {
        return qualifikation;
    }

    public void setQualifikation(String qualifikation) {
        this.qualifikation = qualifikation;
    }

    public String getVorname() {
        return vorname;
    }

    public void setVorname(String vorname) {
        this.vorname = vorname;
    }

    public String getNachname() {
        return nachname;
    }

    public void setNachname(String nachname) {
        this.nachname = nachname;
    }

}

Answer №1

Is it necessary for all of those inputs to contain either a placeholder OR a value? Currently, both are posted if your value is set, or you can interchange placeholders with values.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for adding additional rows or cells to a table with jQuery

Similar Questions: How to Add Table Rows with jQuery Adding Rows Dynamically using jQuery. I am currently working with a table that contains one row and five editable cells for user input. My goal is to implement an "Add Row" feature using jQuery ...

Ways to prevent a div containing a lengthy content string from extending beyond other divs

Check out my Codepen project here Here is the HTML code for my personal website: <div id="splash" class="divider"> <h1 class="text-center text-uppercase">vincent/rodomista</h1> <p class="text-center text uppercase">Full Stack ...

Use CSS to insert a solid rectangle into the contents of a table cell

Struggling with the HTML code that defines a table? Here is an example: <table> <th> <td style="width:200px"> col1 </td> </th> <tr> <td id="a1"> text1 </td> </t ...

How can we stop the constant fluctuation of the last number on a number input field with a maxLength restriction

In my ReactJS code, I have an input field that looks like this: <input type="number" onKeyPress={handleKeyPress} maxLength={3} min="0" max="999" step=".1" onPaste={handlePaste} /> Below are the functions associated w ...

PHP's $_SESSION variable for passing data between pages

Every time I visit a new page, whether it's a login page or any other, I want to store the name of that page in a $_SESSION variable. For example, on the login page: <?php session_start(); $_SESSION['page'] = 'login.htm&apo ...

Having trouble getting Tailwind CSS to work with React components?

I'm having trouble getting Tailwind CSS to work properly. I've made sure to update to the latest version, but for some reason Tailwind is not functioning and there are no errors showing up in the console. Here is a link to my header component an ...

`Enhancing Navigation Links with Scroll-Activated Styling`

I'm attempting to recreate a visual effect that is similar to: Specifically, I am trying to achieve a style where the links in the navigation bar change color when the corresponding section is displayed, such as having the gallery link in the navbar ...

Role-based dynamic layout

I am currently working on a website that requires user login functionality. To achieve this, I am utilizing materialise-css and Angularjs for the front-end development, while the back-end is powered by Java-Hibernate (as Spring is not an option in my case) ...

A dynamic 2-column website design featuring a mobile-friendly layout and an adaptable image

After searching through numerous resources on the topic, I have yet to find a solution to this particular challenge. Is it feasible to create a webpage layout with a text column on the left and an image column on the right that will seamlessly transition i ...

Display a particular frame upon the initial loading of a Lottie animation

I've successfully integrated a lottie animation into my code. On the initial load, I'd like to display a specific frame. When the user hovers over it, I want the animation to start from the beginning and play through in its entirety. Here's ...

Double f span causing unusual behavior in Chrome browser

Why does the highlight focus on "ort" instead of "fort"? It appears this occurs when there are two f's. When I substitute f with other letters, like d, it shows correctly. Could this be a bug in Chrome? Chrome version is chrome83. add: It seems to be ...

Modify the background color based on the length of the input in Vue

Can you change the background color of the initial input field to green if the value of the Fullname input field is greater than 3 characters? See below for the code: <div id="app"> <input type="text" v-model="fullname" placeholder="Enter Full ...

Ways to perfectly align three images side by side using CSS

I am trying to align 3 pictures horizontally, but they keep ending up on separate lines. Here is the code I have been using: HTML <section class="features"> <figure> <img src="....jpg" alt="..."> ...

Using JQUERY, CodeMirror adds elements to the HTML editor

I have been utilizing CodeMirror for my project, specifically the "HTML Editor With Preview" module. To test its functionality, I created a fiddle: --> http://jsfiddle.net/Vu33n/6/ While I successfully got the editor to work, I am currently facing an iss ...

The CSS for the UI Grid is malfunctioning

I have been working on creating a grid using UI Grid (recent version of ngGrid) within my current project. However, I am facing some issues with the display. The icons like angle down and row selected icon are not showing up correctly when I include the CS ...

What is the method for modifying the text color of P tags within a div element?

I'm having trouble changing the text color of the P tags in the card-header section for some reason dashboard.html <div class="container"> <div class="card"> <div class="card-header"> <p& ...

Ensuring that the initial column of a table remains in place while scrolling horizontally

Thank you for taking the time to read this. I am currently working on a table within a div container (div0) where the data is dynamically generated, resulting in a table with unpredictable height and width. The outer div allows for both vertical and horizo ...

Leveraging property values in Angular 2 to dynamically generate HTML elements as tag names

Is it feasible to use a property as an HTML tag name? For instance, something along the lines of: <{{property.name}}>Hello world</{{property.name}}> ...

The structure of the figure tag for HTML5 validation

Could you please confirm if the Figure tag is correctly used in the html structure? Regarding html5 validation, can I use this structure? <a href="#"> <figure> <img src="" class="img-responsive" alt=""> <figcaption> ...

CSS-only: Align items in flexbox column with equal width and centered position, without the need for a wrapper

https://i.stack.imgur.com/vAJv2.png This particular challenge involves creating a responsive mobile menu. In this design, the width of all children is determined by the longest child element. The CSS should ensure that the .index class spans the full wi ...