There is a problem with p:inputMask that I could not understand. I gave nine required area to p:inputMask by putting mask="aaaaaaaaa" . It works fine the problem happens when I write only three letters (below nine letters) and click other fields at screen , the text that I wrote at p:inputMask disappears :( . It works fine when I write nine letters (required letters) at p:inputMask and click other field of the screen, text does not disappear at p:inputMask.
It took a lot time of mine. It should have a simple solution that I could not fine. I would be glad if you can help me.
Here is the Sample Code :
<p:inputMask mask="999" style="width: 25px;text-align: left" readonly="true" value="# {gercekKrediBasvuruDetayGirisKefilView.evTel1Ilk}" />
Try
<p:inputMask mask="?999" style="width: 25px;text-align: left" readonly="true" value="# {gercekKrediBasvuruDetayGirisKefilView.evTel1Ilk}" />
mask="999" requires exactly 3 digits input.
mask="?999" requires 3 digits at most.
Related
I got on my website a Image that has to be clickable. Everything works fine, but only in cases on the current website a URL is provided for the Image. If there is URL, there appears a error message that ruins the content of the website.
How can I make the error message not display.
Here is code. Thank you!
<content:link link="#{cc.attrs.teaser.teaserLinkModel}" value="">
<content:graphicImage graphic="#{cc.attrs.teaser.graphic}"
renderDimensions="false" />
</content:link>
Well, I got a solution.. The thing is, I'm working on someone elses code and didn't know what of options (functions) there already exist. After analysing the code, a saw there is the "rendered" attribute that behaves just like a "if" condition checker.
Anyways, here is my solution to this problem, maybe it helps someone.
<!-- Image is link -->
<h:outputLink rendered="#{cc.attrs.teaser.hasTeaserLink}">
<content:link link="#{cc.attrs.teaser.teaserLinkModel}" value="">
<content:graphicImage graphic="#{cc.attrs.teaser.graphic}" renderDimensions="false" />
</content:link>
</h:outputLink>
<!-- Image is no link -->
<ui:fragment rendered="#{not cc.attrs.teaser.hasTeaserLink}" value="#" >
<content:graphicImage graphic="#{cc.attrs.teaser.graphic}" renderDimensions="false" />
</ui:fragment>
For "Image is no link" I didn't use the "h:outputLink" tag, because it puts a ">" char in front the image and ruins the page content.
This maybe not the best solution, but it did work for me.
I am using Primefaces 4.0. I have a requirement to generate Bar charts depending on the number of results of a query.The Title and color of Bar charts should also be able to set dynamically for all using the query results. Example of bar chart as follows:-
<p:barChart id="barStats"
value="#{Bean.categoryModel}" legendPosition="ne"
style="width:300px;height:250px;"
title="Break Down(Barchart)" barMargin="10" min="0"
barPadding="10" max="40" animate="true" />
In the above example of bar chart the value attribute will load only 1 category model with fixed title.So i was figuring out how can i solve this problem. Further i also need a different color for each bar chart generated.
The query results could be any number from starting from 0(no data).
The solution is to use p:barchart into a p:datagrid. This datagrid will be loaded through a list of barcharts.
Further create the list with a class type which contains barchart,title and color as attributes.And this perfectly solves your problem.
Solution:
<p:dataGrid id="chartdataGrid" var="list" value="#{Bean.chartList}" columns="2" style="border:none;">
<p:barChart
value="#{list.chart}" title="#{list.title}"
style="height:190px;width:350px"
barMargin="20" min="0" barPadding="10" animate="true" seriesColors="#{list.barColor}" />
</p:dataGrid>
if any you need any further clarification for this problem and its detail solution then i will love to provide it.
Hope my Solution helps you.
I am developing a JSF page where I have to place two radio buttons in different locations. First one will have two calendar components, and the next one will have an input text.
The components will be as follows (All components in a single row).
The problem is that the 2 radio buttons are not near each other but having components in between(if they were near each other I could use h:selectOneRadio).
Is there any way to achieve this in JSF or Richfaces?
Any suggestion is appreciated!!!
You could use CSS and position the buttons where they need to be, but if you need to style each one individually that's not going to work.
Or you can use basic radio buttons with <a4j:jsFunction>, something like this:
<input type="radio" onclick="changeValue(1)">
<calendar> …
<input type="radio" onclick="changeValue(2)">
<h:input… >
<a4j:jsFunction name="changeValue" >
<a4j:param assignTo="#{bean.value}" name="value" />
</a4j:jsFunction>
My question regards the display of h:graphicImage within a h:panelGrid
<h:panelGrid border="0" cellspacing="0" cellpadding="0" >
<h:graphicImage height="63" width="270" value="images/NewAOnly.PNG" />
<h:graphicImage height="60" width="270" value="images/NewABottom.PNG" />
</h:panelGrid>
The top .PNG file is 270 x 63 with no border area. The bottom .PNG is 270 x 60 with no border area.
My question is, with border="0", cellspacing="0" and cellpadding="0", why do the two images not sit one on top of the other with no space between them?
This will happen when you use a strict doctype. Long story short, check the article on Mozilla Developer Network: Images, Tables, and Mysterious Gaps. As to the doctype, you can fix this by using a quirks or transitional doctype (as a quick test, remove the DOCTYPE line altogether). This is however not recommended these days.
If you're absolutely positive that the table is the right tool for your concrete functional requirement of displaying images this way and e.g. a div is for some dubious reason absolutely not an option (and you're fully aware of the importance of "Semantic HTML"), then you can fix this by making the images in table cells block level elements.
td img {
display: block;
}
Please note that this problem is completely unrelated to JSF. JSF is in the context of this question merely a HTML code generator.
Deceptively simple question, but I'm at my wits' end here.
I have a document. It contains a form. Which contains a subform. Which contains a read-only text field. Here's the relevant part of the structure:
<tr:document ...>
<tr:form ....>
<tr:subform ...>
<div ...><div ...>
<tr:panelGroupLayout>
<tr:panelFormLayout>
<tr:inputText id="selectedAmount"
label="#{...}"
value="#{...}"
disabled="true" />
</tr:panelFormLayout>
</tr:panelGroupLayout>
</div></div>
</tr:subform>
</tr:form>
</tr:document>
(none of the attributes on the ... are setting style information.)
Why is it that MyFaces produces for the innermost element a div rather than input type="text"? I've seen forms with (apparently) this exact same structure that didn't have this problem.
The reason why this is silly and unacceptable is because the div, when empty, doesn't show as a box but as a single line (the border collapses since there is no content and no height style). Manually setting a height via css isn't acceptable either, because the font may vary from computer to computer. I really just wanted it to always render an input tag.
Any ideas? Feel free to ask for details if you want to confirm any suspicion. There's too many data for me to just dump everything in here.