rich:calendar : Icon hidden by an other component - jsf

How can I keep icon shown for rich:calendar component?
I need to add another rich:calendar component, but the outputLabel hide the icon.
Code (edited) :
<h:panelGrid columns="4" styleClass="criteresSaisie"
rowClasses="critereLigne"
columnClasses="titreColonne,,titreCourtColonne,">
<h:outputLabel for="dateDeb" value="Période du" />
<rich:calendar id="dateDeb" inputSize="8"
value="#{criteresDecRgltBacking.dtDebDecRglt}"
enableManualInput="true" datePattern="dd/MM/yyyy"
showInput="true" converterMessage="la date de début doit être au format dd/MM/yyyy">
<rich:validator/>
</rich:calendar>
<h:outputLabel for="dateFin" value="au" style="margin-left:20px;"/>
<rich:calendar id="dateFin" inputSize="8"
value="#{criteresDecRgltBacking.dtFinDecRglt}"
enableManualInput="true" datePattern="dd/MM/yyyy"
showInput="true" converterMessage="la date de fin doit être au format dd/MM/yyyy" >
<rich:validator/>
</rich:calendar>
<f:event type="postValidate"
listener="#{rechercheDecRgltCtrl.validationPeriode}" />
</h:panelGrid>
CSS
div.rf-ac-itm {
height: auto !important;
overflow: visible;
}
div.rf-ac-itm-cnt {
height: auto !important;
overflow: visible;
}
.critereLigneAugmente td {
padding-bottom: 0px;
}
.espaceVideCalendar {
width: 10px;
}
.espaceVide {
width: 20px;
}
.espaceColonne {
width: 30px;
}
.titreColonne {
text-align: right;
white-space: nowrap;
width: 180px;
}
.titreCourtColonne {
text-align: right;
white-space: nowrap;
width: 40px;
}
.titreColonne .libelle,.titreColonne label {
padding-right: 10px;
}
.titreColonne .libelle label {
padding-right: 0px;
}
.largeurFixeCriteres{
width: 120px;
overflow: visible;
}
.criteresSaisie {
margin: 10px;
}
.largeurFixeCriteresTiers {
width: 120px;
overflow: visible;
}
.critereLigneAugmente td {
padding-bottom: 0px;
}
.finDeLigne {
width: 0px;
}

The only thing I could see that have a chance to cause problem is the classes order in columnClasses that was "titreColonne,,,titreCourtColonne,," and you changed now to "titreColonne,,titreCourtColonne,".
Previously you where trying to apply a 40px width on a rich:calendar column (titreCourtColonne was on the second rich:calendar column instead of the au column).
I recommand to change this CSS for better styling :
.titreCourtColonne {
text-align: center;
white-space: nowrap;
width: 20px;
}

Related

Flexbox text alignment on mobile

So, I am using flexbox for some columns. Basically column 1 is left-aligned, column two i centered, and column three is right-aligned. No big deal, or so I thought. In Chrome, everything looks fine, even when looking at things through Chrome's Inspect tool...but on my iPhone I can't get the right column to justify-content.
My code looks like:
<div id="nav">
<div class="wrap">
<div>
<p><i class="far fa-dot-circle"></i> Watch</p>
</div>
<div>
<p><img src="<?php bloginfo('template_directory'); ?>/images/logo.png" alt="" title="" /></p>
</div>
<div>
<p><i class="fas fa-donate"></i> Give</p>
</div>
</div>
</div>
The css looks like:
#nav div {
align-items: center;
display: flex;
flex: 1;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
letter-spacing: 2px;
line-height: 18px;
padding: 10px 20px 0;
text-transform: uppercase;
}
#nav > .wrap > div:nth-child(1) {
background: #00ff00;
justify-content: left;
}
#nav > .wrap > div:nth-child(2) {
background: #ff0000;
justify-content: center;
}
#nav > .wrap > div:nth-child(3) {
background: #0000ff;
justify-content: right;
}
#nav img {
max-width: 175px;
width: 100%;
}
#nav i {
color: #fff;
margin-right: 5px;
}
#nav a {
color: #fff;
text-decoration: none;
}
Here is the Fiddle: https://jsfiddle.net/1kw5g3h7/
I added the following code this morning and this works:
#nav > .wrap > div:nth-child(3) p {
text-align: right;
width: 100%;
}
I don't like this approach, it seems like to me the justify-content just isn't working is there a way to fix this using flexbox? I'm trying to understand why my original code isn't working on my iPhone? Maybe it's because I have Font Awesome icons in front of the text, I just don't know. Any ideas?
Thanks,
Josh
I didn't realize until now that I hadn't ever posted my final code. This is what I ended up with: https://jsfiddle.net/tc36e24s/2/
HTML:
<div id="head">
<div id="nav">
<i class="ion-android-close"></i>
<ul>
<li>Watch</li>
<li>Give</li>
<li><img src="images/logo.png" alt="Logo" title="Logo" /></li>
<li>Visitors</li>
<li>Contact</li>
</ul>
</div>
<div id="logo">
<p><img src="images/logo.png" alt="Logo" title="Logo" /></p>
<div onclick="openNav()" class="open">
<i class="ion-android-menu"></i>
</div>
</div>
</div>
CSS
body {
background: #009151;
}
#head {
display: flex;
flex-flow: column;
height: 100vh;
}
#nav ul {
flex: 0 1 auto;
}
#nav ul img {
max-width: 175px;
width: 100%;
}
#nav ul i {
color: #9ac2e7;
margin-right: 5px;
}
#nav li {
font-family: 'Open Sans', sans-serif;
letter-spacing: 2px;
line-height: 18px;
padding: 10px 20px 0;
text-align: center;
text-transform: uppercase;
}
#logo {
display: flex;
}
#logo img {
max-width: 200px;
margin: 20px 30px;
width: 100%;
}
#media screen and (max-width: 800px) {
#head .open {
color: #9ac2e7;
font-size: 30px;
margin: 20px 30px;
text-align: right;
width: 100%;
}
#head .open:hover {
cursor: pointer;
}
#nav {
background: #9ac2e7;
display: none;
height: 100%;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 1;
}
#nav ul {
align-items: center;
display: flex;
flex-flow: column;
height: 100%;
justify-content: center;
width: 100%;
}
#nav ul a {
color: #000;
text-decoration: none;
}
#nav li {
font-size: 20px;
padding: 10px 0;
}
#nav li:nth-child(3) {
display: none;
}
#nav .close {
color: #000;
font-size: 30px;
position: absolute;
right: 30px;
top: 20px;
}
}
#media screen and (min-width: 801px) {
#nav .close {
display: none;
}
#nav[style] {
display: block !important;
}
#nav ul {
align-items: center;
display: flex;
}
#nav ul a {
color: #9ac2e7;
text-decoration: none;
}
#nav li {
flex: 1;
font-size: 14px;
}
#logo {
display: none;
}
}
JS
function openNav() {
document.body.style.overflow="hidden";
document.getElementById("nav").style.display = "block";
}
function closeNav() {
document.body.style.overflow="scroll";
document.getElementById("nav").style.display = "none";
}
I added some JS to make my menu work on mobile, but other than that this is code I went with...which is pretty much the same as before except I added two additional links (one on each side of the logo).
Thanks,
Josh

PrimeFaces <p:steps component's style is not getting displayed as expected

I just wanted to try out the basic prime faces component <p:steps> from the prime faces showcase page:
https://www.primefaces.org/showcase/ui/menu/steps.xhtml
however, it does not work as expected. I copied the example from the page in my project into a separate facelets file.
But, instead of blue circles, as shown on the showcase page, I see grey rectangles:
My facelet:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui">
<h:head></h:head>
<h:body>
<f:facet name="first">
<style type="text/css">
body .ui-steps .ui-steps-item {
width: 25%;
}
body .ui-state-highlight {
text-shadow: none !important;
}
body .ui-steps.custom {
margin-bottom: 30px;
}
body .ui-steps.custom .ui-steps-item .ui-menuitem-link {
height: 10px;
padding: 0 1em;
overflow: visible;
border: 1px solid #c8c8c8;
display: block;
background-color: #FFFFFF;
}
body .ui-steps.custom .ui-steps-item .ui-menuitem-link .ui-steps-number
{
background-color: #0081c2;
color: #FFFFFF;
display: inline-block;
width: 30px;
border-radius: 10px;
margin-top: -10px;
margin-bottom: 10px;
position: relative;
top: -3px;
}
body .ui-steps.custom .ui-steps-item .ui-menuitem-link .ui-steps-title {
margin-top: -6px;
}
body .ui-steps.custom .ui-steps-item.ui-state-highlight .ui-menuitem-link .ui-steps-title
{
color: #555;
}
</style>
</f:facet>
<h3 style="margin-top: 0">Basic</h3>
<p:steps>
<p:menuitem value="Personal" />
<p:menuitem value="Seat Selection" />
<p:menuitem value="Payment" />
<p:menuitem value="Confirmation" />
</p:steps>
</h:body>
</html>
What I see in my browser is shown below:
What I am supposed to see accoroding to the PrimeFaces documentation is also shown below:
Try using the Interactive menu steps:
<p:steps activeIndex="1" styleClass="custom" readonly="false">
<p:menuitem value="Personal" url="#"/>
<p:menuitem value="Seat Selection" url="#"/>
<p:menuitem value="Payment" url="#"/>
<p:menuitem value="Confirmation" url="#"/>
</p:steps>
And place the CSS inside h:head(not compulsory) as:
<h:head>
<style type="text/css">
body .ui-steps .ui-steps-item {
width: 25%;
}
body .ui-state-highlight {
text-shadow: none !important;
}
body .ui-steps.custom {
margin-bottom: 30px;
}
body .ui-steps.custom .ui-steps-item .ui-menuitem-link {
height: 10px;
padding: 0 1em;
overflow: visible;
border: 1px solid #c8c8c8;
display: block;
background-color: #FFFFFF;
}
body .ui-steps.custom .ui-steps-item .ui-menuitem-link .ui-steps-number
{
background-color: #0081c2;
color: #FFFFFF;
display: inline-block;
width: 30px;
border-radius: 10px;
margin-top: -10px;
margin-bottom: 10px;
position: relative;
top: -3px;
}
body .ui-steps.custom .ui-steps-item .ui-menuitem-link .ui-steps-title {
margin-top: -6px;
}
body .ui-steps.custom .ui-steps-item.ui-state-highlight .ui-menuitem-link .ui-steps-title
{
color: #555;
}
</style>
</h:head>
This approach should work.

submit a parameter with PrimeFaces onClick?

I have this Table:
.divTable{
display: table;
width: 50%;
padding-top: 100px;
padding-left: 100px;
margin-left: auto;
margin-right: auto;
}
.divTableRow {
display: table-row;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
}
.divTableCell, .divTableHead {
border: 1px solid #999999;
display: table-cell;
padding: 3px 10px;
background-color: #ffffff;
width: 50%;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
font-weight: bold;
width: 100%;
}
.divTableFoot {
background-color: #EEE;
display: table-footer-group;
font-weight: bold;
}
.divTableBody {
display: table-row-group;
}
<div class="divTable">
<div class="divTableBody">
<ui:repeat var="customerInList" value="#{customerListController.resultMap.currentPositionResultList}"> <div class="divTableRow">
<div class="divTableCell">#{customerInList.lastName} #{customerInList.firstName}</div>
<div class="divTableCell">#{customerInList.postalStreet}
<p:commandButton id="editCustomerButton" label="+" iconPos="center" onclick="PF('editCustomerDialog').show()"/>
<br/>#{customerInList.postalCode} #{customerInList.postalCity}
<br/>#{customerInList.phoneNumber}
<br/>#{customerInList.email}
</div>
</div>
</ui:repeat>
</div>
</div>
<p:dialog widgetVar="editCustomerDialog">
</p:dialog>
And this Method
public void parseParameter(int ID){
this.ID = ID;
}
so here comes my problem.
As you can maybe already see I am trying to create a Popup to show more details about the customer. My Idea was that I could parse the Id of the customer from an Invisible div or something like this so I can get the remaining data from my database with this ID but that did not work for me.
Is there any other way to do this ?
You can use a f:setPropertyActionListener to set values to your bean from your p:commandButton then use the action event of your button to get any extra data from your DB and you can show your dialog on the oncomplete event instead of onclick so it get execute after your bean method.
<p:commandButton id="editCustomerButton" label="+" iconPos="center" action="#{customerListController.methodToGetYourRemainingData}" oncomplete="PF('editCustomerDialog').show()">
<f:setPropertyActionListener target="#{customerListController.ID}" value="#{customerInList.ID}" />
</p:commandButton>

FlipSwitch style in Xpages

I would like to create a checkbox that looks like flipswitch.
I used this CSS classes. and I used this design elements. But I could not succeded. There is something that i missed. I do not know how to manage that?
Codes in XPages:
<div class="onoffswitch">
<xp:checkBox text="Label" id="onoffswitch"
defaultChecked="true">
<span class="onoffswitch-inner"></span> <span class="onoffswitch-switch"></span>
</xp:checkBox>
</div>
CSS Class: Resources\Style Sheets
.onoffswitch {
position: relative; width: 90px;
-webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;
}
.onoffswitch-checkbox {
display: none;
}
.onoffswitch-label {
display: block; overflow: hidden; cursor: pointer;
border: 2px solid #999999; border-radius: 20px;
}
.onoffswitch-inner {
display: block; width: 200%; margin-left: -100%;
transition: margin 0.3s ease-in 0s;
}
.onoffswitch-inner:before, .onoffswitch-inner:after {
display: block; float: left; width: 50%; height: 30px; padding: 0; line-height: 30px;
font-size: 14px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold;
box-sizing: border-box;
}
.onoffswitch-inner:before {
content: "ON";
padding-left: 10px;
background-color: #34A7C1; color: #FFFFFF;
}
.onoffswitch-inner:after {
content: "OFF";
padding-right: 10px;
background-color: #EEEEEE; color: #999999;
text-align: right;
}
.onoffswitch-switch {
display: block; width: 18px; margin: 6px;
background: #FFFFFF;
position: absolute; top: 0; bottom: 0;
right: 56px;
border: 2px solid #999999; border-radius: 20px;
transition: all 0.3s ease-in 0s;
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner {
margin-left: 0;
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
right: 0px;
}
I find that when you need to put markup inside a control it mostly won't work because the XPages rendering will change or ignore it. To get around this I use plain markup with a hidden control located outside of the markup. I manage the state of the hidden control with JQuery.
Here is a working example for your FlipSwitch:
<xp:checkBox text="Label" id="checkBox1"></xp:checkBox>
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch"
onclick="x$('#{id:checkBox1}').prop('checked', !(x$('#{id:checkBox1}').prop('checked')) )" />
<label class="onoffswitch-label" for="myonoffswitch">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
The x$() function is a handly utility from Mark Roden:
function x$(idTag, param){ //Updated 18 Feb 2012
idTag=idTag.replace(/:/gi, "\\:")+(param ? param : "");
return($("#"+idTag));
}

Flexbox Ordering. Splitting a column

I want to achieve the following, changing my page layout for mobile/desktop using Flexbox.
I am trying to achieve the following using Flexbox ordering:
http://i.stack.imgur.com/iBXpJ.jpg
Hope this makes sense?
Here is a way of doing this using flexbox. Here is the working demo.
<div class="main-container">
<div class="item menu">Menu</div>
<div class="item sidebar">Sidebar</div>
<div class="item content">Content</div>
</div>
.main-container {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
flex-wrap: wrap;
}
.item {
border: 5px solid gray;
}
.menu {
flex-basis: 200px;
width: 200px;
}
.sidebar {
flex-grow: 1;
width: 200px;
}
.content {
flex-basis: 100%;
width: calc(100% - 200px);
}
#media (max-width: 600px) {
.main-container {
flex-wrap: no-wrap;
height: 100%;
}
.item {
width: 100%;
}
.sidebar, .content {
flex-basis: auto;
}
}

Resources