JSF :: How To Pass A Value Inside Rich Element
Mar 3, 2014using richface 4.
#{rich:element('detailsTable'#{id.No})})
showing syntax error.How to pass the value #{id.No} inside rich:element
using richface 4.
#{rich:element('detailsTable'#{id.No})})
showing syntax error.How to pass the value #{id.No} inside rich:element
I want to run a program to add an element as the third element of stack without changing rankings, I am trying to use two stack and I don't know how to push the top of first stack in the second: push(top(); this line
public void ADD(int element,int i ){
if(isEmpty(true)){
push(element);}
else{ makeNull();
while((i<=3) && (isEmpty(false))){
push(top();
}
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] ....
<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".
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
I'm creating a simple login screen and I need to focus on the first field "login" after I click a submit button, so when the page return. I tryed using JS :
window.onload = function() {document.forms[0].elements[0].focus();};
but it not worked. I need a solution if possible without using JS. I'm using raw JSF implementation without PrimeFaces or anything else like this.
Im working on my homework and it mentioned element for one exercise and an index in another, what is the difference, If Any, Between An Element And An Index?
View Replies View RelatedI have been working on this assignment for a bit now. I seem to have most of the logic of it down, as far as I can tell, but I seem to have fallen into a bit of a brain lapse when it comes to invoking methods I've made in my main method. Here's the code:
package Module5;
import java.util.Scanner;
public class Exercise6Nine {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter 10 numbers.");
double[] numbers = new double[10];
[Code] .....
My question is, in my main method, I have code in there to attempt to call my method "min" from below, and to use the result of the min's calculations and print them via my main. Only, I can't seem to properly invoke the method from my main method!
Also, if you could check over my min method and see if anything blatantly wrong is there and let me know, that would be great.
Looking over my question, and it seems there is no EDIT button, but I may as well put the assignment parameters here, since I asked for double checking on my method. Write a method that finds the smallest element in an array of double values using the following header:
public static double min( double[ ] array )
Write a test program that prompts the user to enter 10 numbers, invokes this method to return the minimum value, and displays the minimum value.
I am just studying over ArrayLists and i have encountered a problem, i'm trying to get the index of an element but it keeps returning -1. Here's the code
Java Code:
import java.util.ArrayList;
public class PhoneEntry {
String name;
String phone;
public PhoneEntry(String name, String phone) {
[Code] ...
I know the list is not empty because it returns a size.
I have been trying to space out output on a Java console window so that I have three columns with 6 rows of data from three different arrays. The code I have so far outputs the data with no problem however the spacing between the columns is uneven. My loop so far is made up as follows
for (int i = 0; i < printVotes.length; i++) {
System.out.println(printNames[i] + "
" + printVotes[i] + "
" + printPrecent[i] + "%");
}
As you can see I have been manually adding the space between each element of the array but this means that the space between each element is different because the size of each element is different if work out a loop that works out an even amount of space between the elements and then print this along with the elements ....
I don't know how to read the attribute maxLenth. The way in the image I have done drive me to the error below.!
Piece of XSL:
<?xml version="1.0" encoding="UTF-8"?>
<c:message xmlns:c="ictt"><c:de format="B" lengthField="0" name="BIT MAP, PRIMARY" number="000"/>
<c:de format="B" lengthField="0" maxLength="008" minLength="008" name="BIT MAP, SECONDARY" number="001" subFields="00"/>
Piece of Java Code:
int length = Integer.parseInt(spec.getAttribute("maxLength"));
[5/13/14 14:52:19:497 CDT] 00000028 SystemErr R java.lang.NumberFormatException: For input string: ""
[5/13/14 14:52:19:497 CDT] 00000028 SystemErr R at java.lang.NumberFormatException.forInputString(Num berFormatException.java:63)
[5/13/14 14:52:19:497 CDT] 00000028 SystemErr R at java.lang.Integer.parseInt(Integer.java:502)
[5/13/14 14:52:19:497 CDT] 00000028 SystemErr R at java.lang.Integer.parseInt(Integer.java:531)
maxlenth.jpg
So I'm trying to write a method which returns the number of vowel characters in arraylist. My idea is to convert the arraylist element by element to array each time iterating through the array counting the vowels of that element. When I started I immediately got an error(surprise, surprise). Excuse me if the problem is too simple, but I am very new to programming.
At line 9 I get the following error "Type mismatch: cannot convert from String to int". I want to get the element at this position, not to convert to int..
ublic class One {
public static void main(String[] args) {
ArrayList<String> bla = new ArrayList<String>();
bla.add("aaa");
bla.add("brr");
bla.add("unn");
}
public static ArrayList<String> averageVowels (ArrayList<String> list){
String[] arrListWord = list.toArray(new String[list.get(0)]);
return list;
}
}
I m trying to migrate JSF 1.2 project with myfaces to JSF 2.0 with myfaces 2.0 jars on weblogic10.3 server. Found some problem related build and publishing after resolving them when i hitting my application all JSF html tags are coming in browser as it is they are parsed to html tags. all h: tages are coming as it is on my browser they are not converted to html tags for browser display.
View Replies View RelatedSo I have an array which holds 19 elements, each element represents a value of 'income'. I'm trying to code the graph so that each bar will represent the value of each element of the array (income). I have been given the code ' for (int Bar = 0; Bar < array of values.length; bar++);' however i'm unsure if this is how to do it, or what to add to this code to make it work.
View Replies View RelatedSo I just finished up my term project and have everything working but I wanted to make one slight adjustment to the code and Im not exactly sure what I'm doing wrong - it involves retrieving a set element from an array from a different class so to some what show what I have going on:
public class example1 {
private example2 Examp;
public example1() {
Examp = new example2();
} public void getArray() {
if(Var >= 10 && Var <= 20) {
[Code] ....
I have an if statement that looks at a sum of numbers, and predetermined upon the set of numbers I want it to output a message by calling the index number in the array and returning the string. I currently just have the message in the if statements but would be nicer to just pull them from a different class to keep it consolidated.
While shuffling an array, if I use Collections.shuffle(), there is a chance that an element in a particular index in the input array can be present in the same index in the output array. Is there an existing method that handles that too? If not, how can I best handle it? After shuffling, will swapping every element with the last element work?
View Replies View RelatedI have the following code:
Java Code:
public class Equals {
String[] s1 = {"red", "white", "black", "blue"};
String[] s2 = {"red", "black", "green"};
String[] s3 = {"red", "green"}; mh_sh_highlight_all('java');
What I need is to give me the following output:
Select Strings: s1,s2,s3
Comparing String s1, s2, s3
red 3 matches.
black 2 matches.
green 2 matches.
This code is not best way to find the duplicate elements in a given array. Any alternative method for an optimized code.
Java Code:
import java.util.Arrays;
public class Find_Dupliicate_ArrayElement {
public static void main(String[] args) {
int[] Array1 = {1, 9,8,1,2,8,9,7,10, -1, 1, 2, 3, 10, 8, -1};
// Store the array length
int size = Array1.length;
//Sort the array
Arrays.sort(Array1);
[code]....
Im new to jsp. I have the following html in my jsp
<select name="job" id="job">
<option value="Booked">Booked</option>
<option value="Assigned">Assigned</option>
<option value="In Process">In Process</option>
<option value="Completed">Completed</option>
</select>
How do I assign job in the scriplet like how we do <% String job = request.getParameter("job")%> but on the same page? <% String job = request. getParameter("job")%> returns null value.
I have the following code:
public class Equals {
String[] s1 = {"red", "white", "black", "blue"};
String[] s2 = {"red", "black", "green"};
String[] s3 = {"red", "green"};
What I need is to give me the following output:
Comparing String s1, s2, s3
red 3 matches.
black 2 matches.
green 2 matches.
Ive set up a list to when a user creates an element it will be added to the entire list, but when i return to the main menu the Element isnt added.
Here is the code
public void setElement(int atomicNum, Element e){
if (ElementHasData(atomicNum) == false) {
if(atomicNum < MAX){
list[atomicNum] = e;
atomicNum++;
[Code] ...
Here is what the code intiates
~MAIN MENU~
Please select an option you wish to activate
1) Print All Elements
2) Print One Specific Element
3) Add an Element
4) Edit an Element
3
What is the atomic number of the Element you would like to add
Numbers only valid 1-113
1
Enter element name
Hydrogen
Enter element Symbol
H
What is the Elements weight
1.01
NEW ELEMENT ADDED!
[Code] ....
~MAIN MENU~
Please select an option you wish to activate
1) Print All Elements
2) Print One Specific Element
3) Add an Element
4) Edit an Element
But then after i try to print the specific element
~MAIN MENU~
Please select an option you wish to activate
1) Print All Elements
2) Print One Specific Element
3) Add an Element
4) Edit an Element
2
What is the atomic number of the Element
1
that element does not exist would u like to create this element Enter yes or no
How do you extract first int digit from an int array element (java)?
if a[3] = 45, how do I extract 4 out of 45?
I have to make a method called search that goes through the linked list and checks to see if whatever String the user entered matches a String in the linked list. With this code, every time I enter an existing String it outputs "There is no element that contains that information". How come?
public class LinkedListExample {
List InfoList = new LinkedList();
public void doLinkedListExample()
{ // add original data to linked list
InfoList.add("Computer"); // string (original 3 elements)
InfoList.add("Programs");
InfoList.add("in Java");
[code]....
I'm trying to iterate through an array of integers and find the start position of the part of the array containing the most consecutive 1s.
For example given the array {1,3,1,1,1,1,5,3,2,1,1}, the method should return 2 and given {1,4,5,1,1,1,5,1} the method should return 3.
So far, I've managed to retrieve the element where the consecutive 1s begin. However, I'm unsure how to get the index of this element and this implementation doesn't work if there is more than one set of consecutive 1s.
public class GetIndex {
public static int getPosition(int[] myArray) {
int index = 0;
int tracker = 0;
int mostOnes = 0;
for(int i = 0; i < myArray.length; i++) {
[Code] .....
the problem I'm having is I want to use a mutator method to set data for an array element. The code I have so far is:
public void addProduct(String productName)
//Goes through and sets the name of a product and assigns it to the array
{
int index;
for (index = 0; index < product.length(); index++)
{
product[index].setName(productName);
numberOfProducts++;
}
}
The array was initialised like this:
Product[] product = new Product[3];
And the setName(String) method is just your typical mutator method.However, in Eclipse, I have an error messages. It is:
"-The method setName(String[]) is undefined for the type String" .....
package test2;
import java.util.LinkedList;
public class Q {
public static void main(String[] args) {
LinkedList link = new LinkedList();
[Code] ....
So how to delete an element in the middle of the linked list?