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

Adjusting height in Google Maps to fill the remaining space

Currently, I am developing a map application where I want the Google Maps DIV to occupy the remaining height under the header. Here is the code snippet: <!DOCTYPE html> <head> <title>Map Application</title> <style type ...

Searchbox aligned to the right using Bootstrap

Looking to place a searchbox on the right next to another container aligned left: <div> <div class="pull-left"><span>SOME TEXT</span></div> <div class="pull-right"> <div class="row"> ...

Using ng-repeat in Angular causes the style of a div to become hidden

Utilizing angular ng-repeat to generate multiple divs, the original template html code is as follows: <div class="span5 noMarginLeft"> <div class="dark"> <h1>Timeline</h1> <div class="timeline"> <div c ...

The background color of the body is being utilized by Div in Internet Explorer version 7

Within my HTML document, I have created a container div that holds several nested divs for a slideshow effect. This "container" div is positioned over the background image of the body element. The CSS styling for the body element is as follows: body { ba ...

Positioning of CSS elements: Distributing and arranging 4 divs evenly within a single parent div

Is there a more efficient method? div { border: 2px solid black; } #main { width: 107px; height: 107px; padding: 0; text-align: center; font-size: 10px; } #tl, #tr, #bl, #br { position: relative; width: 45px; height: 45px; } #tl { t ...

Having trouble getting PHP to display an image on the webpage

When attempting to output a simple image using PHP, I noticed that it only displayed a white square. This led me to believe that the IMG file could not be found. However, when I used a basic HTML IMG tag, the file was located without any issues. Even try ...

CSS: Stack elements vertically based on their height (column-wise)

Looking for some help with designing a menu where the list items float in columns instead of rows. For example, This is how my current menu looks like: I want to change the layout to look like this: My code for the list items is as follows: .mnu-third ...

Transforming the initial character of a label element into uppercase

When I receive an external HTML page, all the data comes in lowercase. I attempted to capitalize the first letter of each label tag using CSS, but it ended up making the entire text uppercase instead. Here is what I tried: .fontmodal { text-transform ...

What is the best method for obtaining table structure using Bootstrap dropdowns?

[Using span instead of table element][1] [Using the table element][2] Currently working with Bootstrap 5, my goal is to have a fixed-width table in place of dropdown menu items. I aim to position the text in the 3rd column all the way to the right. The da ...

Excessive form inputs extend beyond the modal when utilizing Bootstrap 3

Having an issue loading a modal with Angular and populating it with a template. The main problem I'm facing is that the inputs are extending beyond the boundaries of the modal - attached below is a screenshot illustrating the problem: Below is the c ...

Problems Arising from Bootstrap Label and Input Field Alignment

I'm encountering an issue with my Angular app that uses Bootstrap 4. I'm trying to have my form label and input text box appear on the same line, but instead, they are displaying on separate lines. I've tried searching for a solution, but ha ...

The webkitTransitionEnd event fires prior to a repaint or reflow occurring

My goal is to create a progressBar that changes its width when an ajax request is made. I want the ajax callback to only execute after the animation of the progressBar is complete. Here is the code I am using: CSS: #progressBar{ position: fixed; ...

Left-aligned collapsible navigation menu built with Bootstrap

Looking for a unique template or code snippet to implement the same menu as the one on this website: I want the menu to slide in from the left while darkening the rest of the screen, just like the site I referenced. Is there a bootstrap template that can ...

Why is it that the default theme of Material UI lacks any stylization at all?

After experimenting with both Carbon Design for React (@carbon/react) and Material UI (@mui/material) in conjunction with Next.js, I encountered styling issues with the components. While they functioned correctly to some extent, there were noticeable discr ...

Tips for aligning hyperlinks in the navigation bar using CSS3 and HTML5

Struggling to center the links in the navigation bar has been a challenge. I really want those buttons smack dab in the middle of the header bar, but despite trying everything, they stubbornly remain on the left-hand side. .header { overflow: ...

Error: The function 'document.getsElementsByClassName()' is not defined when evaluating 'undefined'

Actual Error TypeError: undefined is not a function (evaluating 'ActiveElem[i].hasClass('active'); HTML <div class = 'Carousel-Inner'> <div class="morningSlide active"> <img src="/Users/KO527/Sites/TarasDeli ...

Searching for and replacing text that spans across multiple nodes in HTML can be accomplished using C# programming language

Here is the HTML code to consider. The term 'response' was modified to 'reason', by removing 'sp' (<del> tag) and adding 'as' (<ins> tag), while also removing 'se' (<del> tag). <div &g ...

Incorporate hover and click functionality to the dropdown button using JQuery

Recently, I implemented hover and click events to trigger the opening of a dropdown content The functionality is mostly working as expected but there is a slight issue When hovering over the element, the content opens and closes properly However, on the ...

Wrapping Text around an Image in HTML

I am currently in the process of designing a website using the flexible box model. My main challenge right now is trying to align text to the right of an image, and then below it. I've attempted using float:right/left along with align="left/right", bu ...

Show the WooCommerce checkout shipping fields and eliminate the "Choose a different delivery address?" checkbox

Is there a method to eliminate the checkbox labeled "Ship to a different address?" on the woocommerce checkout page while still displaying the shipping fields? I have attempted the following: add_filter( 'woocommerce_cart_needs_shipping_address', ...