Strange issue, I have read through various posts, but have yet to find a working answer.
When I have a h:commandButton, where I want an icon to display instead of text, I have tried.
<h:commandButton value=" " image="UpArrow.png" style="position: absolute; left: 36px; top: 17px; width: 18px; height: 18px; cursor: pointer;" title="Pan up" actionListener="#{SarWindsImagesBean.panUp('testImage.jpg')}">
<f:ajax render="imagePan2"/>
</h:commandButton>
<h:commandButton image="UpArrow.png" style="position: absolute; left: 36px; top: 17px; width: 18px; height: 18px; cursor: pointer;" title="Pan up" actionListener="#{SarWindsImagesBean.panUp('testImage.jpg')}">
<f:ajax render="imagePan2"/>
</h:commandButton>
In the first, the size is correct, but instead of the image, I get "Submit Query".
In the second, I get the same problem.
Why is it rendering "Submit Query"? and If I add value=" ", it will not display the icon, just an empty box.
Dan
That's the browser-default value of the HTML <input type="submit"> element when the value attribute is omitted. This is not generated by JSF. Try it out yourself with such a HTML element in a plain HTML page.
As to why adding the value attribute when the image attribute is present results in an empty box, that's likely MyFaces specific. I can't reproduce it in Mojarra.
As to (ab)using the image attribute in order to present a background image, this after all not entirely right. You should be using CSS background-image property instead,
<h:commandButton value=" " style="background-image: url(UpArrow.png)" />
or just a <h:commandLink><h:graphicImage> if you don't want to have the appearance of a button at all:
<h:commandLink ...>
<h:graphicImage value="UpArrow.png" />
</h:commandLink>
Related
I am working on a asp.net mvc framework application. I am trying to simply display a radio button with the help of Html helper like this
Male: #Html.RadioButton("Gender", "Male")
But the problem is that it is not displaying this radio button although there is an input element being generated
<input id="Gender" name="Gender" type="radio" value="Male" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; border: 0px; opacity: 0; background: rgb(255, 255, 255);">
I googled and found some possible solutions , however none of them are working in my case.I tried to find input[type="radio"] in all the css files in my project and find if display property has been set to none . I commented out a few lines relating to input[type="radio"] in the _print.cshtml file as well.
The radio button is shown when the page loads and then disappears.only the label is visible.I have spent 7 productive hours on this issue.I think some css is hiding my radio button but where i couldnt find
Try Changing opacity:0 to opacity: 100
I am trying to get an anchor in jquery to line up horizontally right next to a checkbox in a list structure. I previously had the checkbox inside of the anchor object, and this produced the result I wanted but now I want the checkbox to have a separate functionality then the anchor element, thus I wish to separate them. The CSS I am using is as follows, and as you can see from Jsfidle, it looks horrible with the checkbox floating to the top right spot of the button. Answers on here have noted that using field contain or display:inline would fix the problem but I have been unable to get it to work.
<div data-role="main" class="ui-content">
<h3>Some header</h3>
<ul data-role="listview" id = "tasklistTasks">
<li>
<div data-role="fieldcontain" style=" display:inline" >
<input type="checkbox">
Go here
</div>
</li>
<li>
<div data-role="fieldcontain" style=" display:inline" >
<input type="checkbox">
Go here
</div>
</li>
</ul>
</div>
I am using Jquery 2.1 and Jquery mobile 1.4.2. Thanks for any help
The reason for this behavior is that the checkbox is getting the CSS from the jquery mobile CSS you have applied. Inside that particular CSS, your checkbox class' CSS is getting overridden and it has :
margin: -11px 0 0 0;
due to which it is coming to the top left corner of your parent div.
If you are not using CDN of that CSS and you have that downloaded version, you can modify this with :
.ui-checkbox input, .ui-radio input {
position: absolute;
left: .466em;
width: 22px;
height: 22px;
margin: 12px 0 0 0;
outline: 0!important;
z-index: 1;
display: inline-block;
}
You can also see yourself by debugging it in your browser.
Here is how it looks now and i guess this is what you wanted:
http://jsfiddle.net/appleBud/bWFYv/2/
Hope this helps.
I have a input box placed in the header data-role="header" of a jQuery Mobile page.
<form id="form-search" class="form-search" style="display: none; background-color: #fff; border-bottom: 1px solid #ccc;">
<input type="search"** placeholder="Enter your search query" name="search-query" id="search-query" value="" data-mini="true" />
</form>
When this form gets submitted, page is changed $.mobile.changePage() but there is still an outline for that search box. How is it possible?
I tried using blur() on inputbox after form is submitted but it doesn't work. Also this is the only place where any inputbox leaves its trace on other page.
In order to get the styling I want on Chrome in OS X, I have to use the -webkit-appearance: none; attribute.
See this question and this answer.
The issue is, now when I select an answer, it doesn't show up. The field just remains blank.
This is how it looks without that attribute:
This is how it looks WITH the attribute:
For what it's worth, this is how I am creating this select menu - with Simple Form:
<%= f.input_field :country_id, collection: Piggybak::Country.send(type), class: "required" %>
This is the HTML it generates:
<select class="select required required valid" id="piggybak_order_billing_address_attributes_country_id" name="piggybak_order[billing_address_attributes][country_id]"><option value=""></option>
<option value="231" selected="selected">United States</option></select>
How do I fix this?
Edit 1
This is the CSS:
form.simple_form select {
padding: 20px;
-webkit-appearance: none;
}
I had this problem and it turned out to be the height property causing it.
select {
padding: 20px;
height: 20px; /* suddenly invisible text! */
-webkit-appearance: none;
}
Check out this fiddle
http://jsfiddle.net/bpYGv/2/
Test in Chrome for OSX (10.8.2) and this works fine:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Testing Select</title>
<style>
form.simple_form select {
padding: 20px;
-webkit-appearance: none;
}
</style>
</head>
<body>
<form class="simple_form">
<select class="select required required valid" id="piggybak_order_billing_address_attributes_country_id" name="piggybak_order[billing_address_attributes][country_id]">
<option value="">test</option>
<option value="231" selected="selected">United States</option>
</select>
</form>
</body>
</html>
You have an empty option as the first one. That's why you get the blank select.
The issue is not reproducible if I start a fresh HTML page (on Mac Chrome and Safari). To me, this sound like a clashing CSS rules issue. Is color: #fff; style defined in one of the classes used by select? You might want to try inspecting the select or option element in Chrome/Safari to see if there are any classes applying that style.
The padding is pushing the contents of the select out of view, try decreasing the padding in Chrome's web inspector to make it appear again.
A solution might be to hard set the padding AND height, ie.
-webkit-appearance: none;
-moz-appearance: none;
border: 1px solid #aaa;
padding: 20px;
font: 12px/12px Arial;
height: 57px;
But bottom pixels from letters still tend to fall off in different browsers, a 53px height should be sufficient (2*border + 2*padding + 1*line-height), but Chrome 34 needs 55px, IE11 56px and FF28 57px to completely display letters.
See my fiddle at http://jsfiddle.net/lmeurs/tLkAR/.
Also see Formalize to "teach your forms some manners" and Select for "styleable select elements".
for me I have to set this:
padding-top: 0;
padding-bottom: 0;
I am trying to refresh Prime faces charts which reside in tabs on an accordion. When I click the button to update it only updates the chart which is in the currently open tab???
I am using Primefaces 3.0
<h:form id="content">
<p:accordionPanel style="margin-top: 30px; background-color: white;">
<p:tab title="Microsite and Multibrand">
<p:lineChart id="dropoffChart1" value="#{gvBean.dropoffChart1.chart}"/>
</p:tab>
<p:tab title="Microsite and Multibrand">
<p:lineChart id="dropoffChart2" value="#{gvBean.dropoffChart2.chart}"/>
</p:tab>
</p:accordionPanel>
<p:commandLink actionListener="#{gVController.day}" update="content" title="day">
<h:graphicImage styleClass="timeSetButton" value="day.png"/>
</p:commandLink>
</h:form>
I resolved this by adding the attribute dynamic="true" to the accordian tag.