JSF :: Printing Only Part Of Prime-faces Page?

Jan 15, 2014

I have a print button as below

<p:commandButton id="printit" value="Print" type="button" icon="icn-print">
<p:printer target=":topForm:data" />
</p:commandButton>

when i click print button only top half of the page is getting printed and bottom half is pushed to next page. How do i fix this issue.

View Replies


ADVERTISEMENT

JSF :: Unable To Set Prime-faces Data Table Column FilterMatchMode In Managed Bean

Nov 13, 2014

I have a requirement where in my primefaces datatable ,the filterMatchMode attribute(like any part of field,whole field) needs to be selected by the user by select menu .

To achieve this i have declared a variable in my viewscoped managed bean as filterCriteria and set the filterMatchMode attribute as filterMatchMode="#{beanName.filterCriteria}".The bean variable is getting set in the managed bean on submit but the filtering is not happening,i am getting empty message.

Also when i remove the keyed in value from filter box the data table is not restored which otherwise must be restored in normal situations. I have used and modified the example code given in primefaces showcase here.The code snippet is as below

<h:form id="tblFrm">
<h:selectOneMenu id="filterOptions"
value="#{dtFilterView.filterOption}" required="true"
requiredMessage="You must select an option!">
<f:selectItem id="hd1" itemLabel="Select" itemValue="#{null}" />

[code]....

View Replies View Related

JSF :: Loading Part Of Page Using AJAX - How To Handle CommandButtons

Jun 25, 2014

I have a page which lists items using a ui:repeat. The repeat is surrounded by my h:form tag.

Now I have made it so that when click an item, then I load some item details - render them in their own xhtml file and inject the result into the dom tree.

This is causing some problems.

* My injected content has commandButtons and commandLinks which do not work because I don't have a form in my injected page - since this would cause nested forms :-(
* tried to replace commandButtons and commandLinks and instead create unique url's that I can call to get my work done - but how to I then re-render a panelGroup on then page? tried using jsf.ajax.request but I'm not able to get part of the page (a shoppingcart) to update

Basic outline

<h:form>
<table>
<ui:repeat ...>
<tr><td onclick="...">Click here to load item details</td></tr><tr><td id="itemDetailPlaceholder"></td></tr>
</ui:repeat>
</table>
</h:form>

View Replies View Related

Printing Number Of Prime Numbers In A Range?

Feb 13, 2015

The assignment is to make a program that prints the number of prime numbers in a range. This is what i have so far. The output is a list of 2s. I created the for loop to cycle through the range of 17-53 and nested a while loop within to test each incident of the for loop to check for divisors starting with 2 until the modulus result is 0 resulting in a false for being a prime number. Then the loop should increment to the next i value. The last part is an if statement that i had intended to add counters to the k variable that would keep track of the number of prime numbers.

boolean isPrime = true;
int j = 2;
int k = 1;
for (int i = 17; i <= 53; i++){
{
while (i % j == 0){
isPrime = false;

[Code] .....

View Replies View Related

JSP :: Prevent Dot Matrix Printer Scrolling Entire Sheet After Printing Page As Receipt

Jul 25, 2014

i am developing a web application and uses jsp page to print a payment receipt.

everything works good, but printer scrolls complete sheet after printing first receipt. so need scroll back manually every time i print a receipt.

So, how to stop printer from scrolling entire sheet.

View Replies View Related

JSF :: 2.0 - How To Show Dialog Without Using Any Faces

Mar 19, 2014

How can I display a modal dialog in JSF 2.0 without using any faces like primefaces, icefaces...

View Replies View Related

JSF :: Rich Faces Pagination Not Working

Nov 28, 2014

I am using jsf rich faces to dispay the page. Pagination is not working in the same page.Problem here is i am able to see the first page only for the pagination functionality.

Below is the part of the code from xhtml.

<rich:dataTable value="#{selectedBean.bean.attributes}" var="attribute" iterationStatusVar="it" id="table" rows="20">
<f:facet name="caption">
<h:outputText value="#{selectedBean.bean.name}" />
</f:facet>
<f:facet name="header">
<h:outputText value="Attributes" />

[Code] ....

View Replies View Related

JSF :: Rich Faces Always Show GMT As TimeZone

Oct 31, 2014

<rich:column>
<f:facet name="header">
<h:outputText
value="#{msgs.viewErrorSearchCriteria_createDateTime}" />

[Code] .....

Above code is always showing date as "31-Oct-2014 10:28:57 AM GMT". I want to display this in "31-Oct-2014 10:28:57 AM EDT".

View Replies View Related

JSF :: Display Just A Datatable Is Faces Request?

Jun 5, 2014

1. If we have and xhtml page and we just have a datatable to show some records through a managed bean, I think there is no validation phase, apply request values phase... so it would be a faces request but not with the lifecycle of a jsf request, right?

2. In the previous case because the normal phases of a jsf request are not going to be called, the method that will be called in the backing bean to get the records, could be called more than once although its not a normal faces request?

View Replies View Related

JSF :: Rich Faces Skin Not Applied

Aug 11, 2014

I am retrieving data in <rich:datatable> , but the default skin color is not being applied in my page. My web.xaml is as below

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>richFacesApp</display-name>

[Code] ....

I am using tomcat 7.0 and Richfaces 4.0

View Replies View Related

Add A Zero For Decimal Part

Apr 19, 2015

Add the following method to the BankAccount class: public String toString()Your method should return a string that contains the account's name and balance separated by a comma and space. For example, if an account object named benben has the name "Benson" and a balance of 17.25, the call of benben.toString() should return:

Benson, $17.25

There are some special cases you should handle. If the balance is negative, put the - sign before the dollar sign. Also, always display the cents as a two-digit number. For example, if the same object had a balance of -17.5, your method should return:

Benson, -$17.50

Here is my code:

public String toString() {
String result = name + ", ";
if (balance < 0) {
result += "-";
}
return result += "$" + Math.abs(balance);
}

My code only works in case there are full two numbers for the cents part, not for the case when there's only one number. So I wonder how I can add an extra zero when needed.I can get only the decimal part and add a zero if it's less than 10, but I don't know how I can extract just the decimal part from the number. (The balance is just a double and it doesn't have any separate field for dollars and cents).

View Replies View Related

JSF :: Similarities Between Faces Flows And Spring Web Flow

Aug 8, 2014

URL....In the mentioned project in this blog I used Spring Web Flow to satisfy some requirements but now that development of the Spring Web Flow stopped I like to check what Faces Flows can present to satisfy the same requirements.From a quick look similarities between Spring Web Flow and Faces Flows are obvious but there is one specific point I like to ask.In SWF it is possible to define flowing element at the beginning of an flow.

<on-start>
<evaluate expression="CustomerSearchSM.resetStateMachine()"/>
</on-start>

which will trigger an event when you will start executing a flow, I look to the Faces Flows flow descriptors but I can see an element that fullify similar requirement.similar functionality built into the Faces Flow or not?And is there a way to configure Faces Flows that it reacts to events from the users like the following.

<transition on="onStartCustomerSearch" history="invalidate">
<evaluate expression="customerSearchInputBB.searchCustomer()"/>
</transition>
<transition on="onCustomerAuthenticated" history="invalidate">
<evaluate expression="customerSearchAuthenticationBB.customerGivesAuthentication()"></evaluate>
</transition>

View Replies View Related

Extracting Part Of A String?

Oct 13, 2014

Okay So I am creating an application but I'm not sure how to get certain parts of the string. I have read In a file as such:

*tp*|21394398437984|163600
*2*|AAA|1234567894561236|STOP|20140527|Success||Automated|DSPRN1234567
*2*|AAA|1234567894561237|STOP|20140527|Success||Automated|DPSRN1234568
*3*|2

I need to read the lines beggining with *2* so I done:

s = new Scanner(new BufferedReader(new FileReader("example.dat")));
while (s.hasNext()) {
String str1 = s.nextLine ();
if(str1.startsWith("*2*")){
System.out.print(str1);
}
}

So this will read the whole line I'm fine with that, Now my issue is I need to extract the 2nd line beggining with numbers the 4th with numbers the 5th with success and the 7th(DPSRN). I was thinking about using a String dilemeter with | how to extract them once i've used the dilemeter.

View Replies View Related

Inventory Part 2 Portion And Getting Errors

Apr 30, 2014

for my assignment I am to only add the sort and total inventory methods in the inventory class. And not create an array in the inventory class at all. My inventory class should contain all the variables needed to use with the two new methods: sort and calculate total inventory.By not creating any array in the inventory class and not touching the variables at all.For the inventoryTest class, I only need to declare an array of the inventory class by making an instance of the inventory.

public class inventory
{

private int prodNumber; // product number
private String prodName; // product name
private int unitsTotal; // total units in stock
private double unitPrice; // price per unit
private double totalInventory; // amount of total inventory

[code]...

View Replies View Related

Swing/AWT/SWT :: Extend And Retract Part Of GUI

Jul 18, 2014

I have a GUI that I've been working on for a while now. What I am trying to figure out, is a way to have the user push a button, and when they do have the GUI extend out to the right with another table to use for Filter Data. Once They are done, I want them to push that button again, and the panel with the query data retracts and is hidden again, all without changing the size of the current GUI in question. I've tried a bunch of different things with setting preferred and Minimal values to my GUI, and I've played around with different Layouts (Border Layout.East, etc), but I can't seem to find a good working solution.

Ideally it would be slick if I could make my panel SLIDE out and SLIDE back in, which would look really cool, but I'd settle for something that just worked.

View Replies View Related

How To Remove Object From Jframe As Part Of ActionPerformed

Mar 11, 2014

I currently have a program written that outputs a canvas object and adds a picture of 5 taxis to it.I have now added a jtextfield so that a user can add an interger. Ideally if the user was to enter the number 8, there would be 8 taxis added to the canvas.I am having trouble with the final part i mentioned. how to delete the old canvas and output a new one with the amount that the user wrote in the jtextfield.

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;
import javax.swing.*;

[code]....

View Replies View Related

How To Extract Specific Part Of A String In Java

Mar 1, 2014

consider this statement from a jsp file(there are many more statements like this in jsp file..) Statement -

<h:dataGrid something styleclass="styleclass1" something1
onClick="event" something2
<% this is a scriplet tag %>
something3
style="style1">

<h:output text>hello i am text</h:output text>
</h:dataGrid>

What I want is to extract(and store it somewhere) the part from "<" to ">" where:

< - is the one in "<h:dataGrid"
> - is the one in "style1>" and not the('>') one that appears in the end
of "</h:dataGrid>" or "<h:output text>" or "</h:output text>"

Problem is the text b/w && is in multi-line...&& there are scriplet tags in between them.. so i don't know how to extract this particular string.. i tried using using some regular expressions but couldn't find the exact one..

(this was just an example && instead of this "" tag it can be anything like again in this line :

<h:output text>hello i am text</h:output text>

I want to extract the string from "<" till ">" where :

< - is the one in starting of "<h:output text>"
> - is the one in ending of "<h:output text>" and not the one in "</h:output text>"

However the difference b/w this example and the above mentioned one is that this one is not multi-line and doesn't contains any scriptlet tags)....

View Replies View Related

Java API - Truncate Float Part Of Double Variable

Jan 13, 2015

Is there a method in Java API that truncate the float part of a double variable after a given number of digits?

Example: if the number of digits to be truncated is 2, so the method truncate (6.9872) to (6.98) ,

I tried to write a method that do that but it was very difficult.

View Replies View Related

Part Of Panel Missing - No Code Error (tried Changing Size)

Apr 20, 2014

import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.text.*;

public class aaa extends JFrame
{
private JPanel combinationp, np, ap, dp, surgeryp, medicationp, infop; // input = name, address, days
private JLabel namelabel, addresslabel, dayslabel, infolabel;
private JTextField nametf, addresstf, daystf, selectedsurgerytf;
private JButton calcButton;

[Code] .....

View Replies View Related

JSP :: Extracting Information About Previous Page From Where Current Page Came

Jan 31, 2015

I have to implement a system where I have to do almost same processing on a jsp page. The slight differences on the present page is based on whether the current page came from page 1 or page 2. So how can I do this?

View Replies View Related

JSF :: XHTML Page - Access To Content Of Dynamic Page?

Jan 15, 2014

I have a xhtml file that initialization it with ui:repeat tag in realtime.all tags of this page placed under ui:fragment tag.

<edges>
<ui:repeat value="#{graphInfoBean.edges}" var="edge" varStatus="indexVar">
<edge id="#{indexVar.index}" source="#{edge.source}" target="#{edge.target}"
weight="#{edge.weight}">

[Code] ....

When i access to this page and save it as xml in realtime, the tags in xml file saved is empty while it is initialized and everything is working properly.

<edges>
</edges>

How can i access to content of this xhtml page and save it on disk?

View Replies View Related

Checking Whether Int Is Prime Or Not?

Oct 25, 2014

//checks wether an int is prime or not
public static void main(String[] args) {
int n = 17;
boolean prime = true;
if (!(n==2)) {
for (int i = 2; i * i <= n; i++) {
if (n % i == 0);

[Code] .....

View Replies View Related

List Prime Number From N To M

Oct 15, 2014

I am trying to list of prime number from n to m but my program give only one number

import java.io.PrintStream;
import java.util.Scanner;
public class Check05B
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
PrintStream output = System.out;
output.print("Enter a number to test: ");

[Code] ....

View Replies View Related

JSP :: How To Open Page Inside Another Page

Apr 1, 2015

I have two jsp page one is demo1.jsp and other is demo2.jsp on a click of a particular link on demo1.jsp I want to opwn demo2.jsp inside demo1.jsp without changing layout of demo1.jsp..I tried to use <jsp;include but that doesn't work for me.But how to do this simply on a single link click on a big page?

View Replies View Related

Prime Number Generator - Range From 0 To 199

Feb 5, 2015

public class printprimes2{
 public static void main(String[] args){
  for( int i = 1 ; i <=199 ; i++ ) //iterate 1 - 199; 2 is prime {
for ( int j = 2 ; j < i ; j++ ) //iterate 2 - potential composite EXCLUSIVELY; every number can be divided by one and itself

[Code] ....

It doesn't print only prime numbers but all numbers that range from 0 to 199. What do you think I am doing wrong?

View Replies View Related

Program That Checks If Number Is Prime Or Not?

Feb 11, 2015

I am writing a program that checks if a number is prime or not. Code below.

for(int i = 2; i < P; i++){ 
if (P % i == 0) {
System.out.println(P + " Can also be divided: " + i);
return;
}
}
System.out.println("Prime number.");

It works but, if a number is not a prime. I need to print out all the numbers that it can be divided with. For example if a number would be 8: it can also be divided with 1, 2, 4, 8.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved