JSF :: Dynamic Loading Of Sections And Mandatory / Non-Mandatory UI Fields
Mar 27, 2014
I am working on RichFaces 3.x/ JSF 1.2.I am currently working on a requirement to load dynamic sections and Mandatory/Non-Mandatory UI fields in a form?i.e. Based on one type of operation field selected in the form. I have to load the sections and fields with mandatory/non mandatory UI fields.
Is it possible to load the mandatory/Non-Mandatory fields in entire form(Around 200 elements) after selection of operation type dynamically? Note once operation type is selected it will be non-editable and subsequently, I need to load the whole page with different sets of mandatory/Non-Mandatory fields ?
View Replies
ADVERTISEMENT
Feb 2, 2015
Understanding the difference between static and dynamic class loading.
It will be more useful if examples are given , especially for dynamic class loading(without using reflection).
View Replies
View Related
Jan 9, 2015
I'm trying to troubleshoot on some existing code that is causing some confusion for me. The code is a snippet from a navigation display that displays Sections of an image. Each section is actually a total of 75 pages and I have an image that is being returned with over 3000 pages. Depending on other images being returned, I won't always know how many total pages or total sections will be returned.
The issue is that when the section numbers are being returned on the screen (strSectionURL = "Section "+ strSectionNumber; ) they are not in numeric order on the display. For example, instead of being 1 - 10 as they are returned (the XML response shows me the section numbers are being retrieved in numerical order), they come back "Section 4, Section 1, Section 10, etc when the URLs are displayed.
Why do they not show in numerical order on the navigation display?
Copy of the class:
NavDisplay.txt
String strInvocationId = null;
String strStatusString = ImageDisplayHelperBean.IMG_STAT_ERROR;
StringBuffer sbfStatus = new StringBuffer();
String strStatus = null;
String strCSSClass = "IMAGE_ERROR";
String strSectionURL = null;
[Code] ....
View Replies
View Related
Dec 7, 2014
how to differ between fields that are not exists to fields that are null? because in my api when someone wants to delete a field he sends null instead of a value. and if he doesnt want to effect this feild he doesnt send it.
{
"a" : {"1","2"},
"b" : "hello"
}
{
"a" : null,
"b" : "hello"
}
{
"b" : "hello"
}
View Replies
View Related
Nov 15, 2011
I usually code in PHP, C++ and ActionScript.I'm trying to follow an example of how to add images to a full screen application. What he does is that he adds a JPG background image, and then 4 PNG images. I tried to do it like I always do, by writing the code by myself looking at the book. It didn't work. I searched for errors in the code, changed some things, tried different things, but it didn't work. Then I tried to use his own code, that I downloaded from his website. That didn't work either.. I tried to find another way to add an image, and I can't seem to figure out a way to implement images in any other way into this class that's written in this book.. My Java programming level isn't just high enough.
Here's the code for the file where the images load, downloaded from the authors website (I've modified the brackets and some spaces so that it becomes easier to read):
Java Code:
import java.awt.*;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
public class ImageTest extends JFrame {
public static void main(String[] args) {
DisplayMode displayMode;
[code]....
View Replies
View Related
Mar 24, 2015
how I can change my code so that somebody can actually input the specified file path, rather than having it fixed in the code. I previously used
Scanner in = new Scanner(System.in);
System.out.println("What is the filename?");
String input = in.nextLine();
File file = new File(input);
But then the program would not display the frequencies.
import java.io.File;
import java.util.*;
/*
This program will allow the user to enter in a text file name, when prompted the program will anaylser the text and display the frequencies
*/
public class AssP {
public static void main(String[] args ) {
Scanner scan;
try {
Scanner scanner = scan = new Scanner(new File("C:/Users/Mary/workspace/Assingment/src/test.txt"));
[code]....
This is my current code and I need to so the user can load their own files.
View Replies
View Related
Feb 11, 2014
I have to show a loading image which should tell some proper loading message in jsp.
View Replies
View Related
Jun 20, 2014
I have added the image in the src and bin directories and cross-checked that the name of the image file is correct..Here is the main class
import javax.swing.*;
public class apples
{
public static void main(String args[])
{
JFrame frame = new JFrame();
MyDrawPanel wid = new MyDrawPanel();
frame.add(wid);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.setSize(300,300);
}
}
and here is the class that does the image adding part
import java.awt.*;
import javax.swing.*;
public class MyDrawPanel extends JPanel
{
public void paintComponent(Graphics g)
{
Image image = new ImageIcon("b.png").getImage();
g.drawImage(image,20, 20, this);
}
}
View Replies
View Related
Sep 18, 2014
So I would like to get information out of a web-API. But my question is how I do this. I guess I need to read the URL first. And parse it after but what is the best way?
For example : [URL] .....
View Replies
View Related
Jan 31, 2014
We are using an applet in our web application. The applet of our application is dependent on bouncycastle jar,bcprov-jdk15.jar and few other jar's whose size comes around 4 mb. When using the appliaction on jre7, the applet is taking too long time to load than usual time. Is there any way to place these jar's in client machine? Will it improve the performance? Is there any other way to reduce the loading time of applet apart from placing jars in client machine?
View Replies
View Related
Apr 9, 2015
I want to load image in java using Html. it works in neatbeans. But if i create a jar file it not load
URL url = getClass().getClassLoader().getResource("http://www.javaprogrammingforums.com/images/sms.png");
String tab= "<html><table style='width:100%; table-layout:fixed'><tr><td style='width: 30px' rowspan=2 >
<img src='"+ url+ "' width=36 height=36/></td><td font color='#ffffff' style='width: 110px'><font size='4'>
"+namePerson+"</font></td><td font color='#ffffff'>"+myDate+"</td></tr> <tr>
<td font color='#ffffff' style='width: 110px'>"+str1+"</td></tr></table></html>";
jLabel1.setIcon(new ImageIcon(url));// it works
tmodel.addRow(new Object[] {tab}); // not works why
not work in jar file..
View Replies
View Related
Dec 26, 2014
How load dynamically load jars? Is it possible to load updated jar in my application by code? My application has to use new and modified class files but application should not be restarted.
View Replies
View Related
Oct 27, 2014
I have an assignment where I need to add an interface to an already-created program. I have an array of objects, where each object has a name, price, and priority.
In my original program (which worked), I had all of the objects in 1 class. The professor said that I should split up the name/price/priority into 3 different classes. So what I have is an array that belongs to an interface, and name/price/priority implements. But I am having trouble loading the data into the array (from another class) once I am done with loading name.
Here is what I have so far.
public class Main {
public static void main (String[] args){
Interface[] arr = new Interface[7];
Scanner keyboard = new Scanner(System.in);
System.out.println
[code]....
Line 18 in the ItemName class is giving me an error, and I know it is because arr is of type Interface, and I am trying to assign is a String. But I don't know how to do this. In my original program I was able to do arr[x].getName(); but when I do that in Main, I get errors.
how to assign to an interface array from multiple classes.
View Replies
View Related
Nov 29, 2014
At startup, the class containing your main method is loaded. It loads all classes that it needs. Each of those loaded classes loads the classes that it needs, and so on. That can take a long time for a big application, frustrating the user. You can give users of your program the illusion of a faster start with the following trick. Make sure that the class containing the main method does not explicitly refer to other classes. In it, display a splash screen. Then manually force the loading of other classes by calling Class.forName.
I'm not sure if I got this right - the tip amounts to suggesting to load all the classes altogether in the main method while displaying the splash screen?
Second, how can the main method not refer explicitly to other classes? It has to create some objects after all...
View Replies
View Related
Aug 17, 2014
import java.awt.*;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import javax.swing.JFrame;
public class Golf extends JFrame
{
boolean isRunning = true;
[Code] ....
It loads and draws fine when I am using one image. But if I un-comment the others are try to draw the background of my game as intended, nothing gets drawn. I've played around with a number of different solutions but nothing works, I've had multiple images work in previous programs doing exactly the same thing and I really don't understand whats up.
View Replies
View Related
Jun 22, 2014
package com.mkyong.persistence;
import java.util.Date;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
[Code] ....
Everything is working fine but in my case One customer has Many orders but when i do customer.getOrders() the child objects are not loading . I dont know why.am i missing something here im using MYSQL database
View Replies
View Related
Oct 22, 2014
We have a custom authorization in our application login page, authorization by using eToken and java (signed jar classes) and applet as login button on page. It's work fine on older and current java versions like 7u67, 7u71 but it's not work on new java version 8u25.
We write a test class named AuthControl without package, we found that problem is in .jar file path, for example:
&APPLET_VERSION. is a jar file name, uploaded using "Shared Components / Static Files - Create"
<script src="https://www.java.com/js/deployJava.js"></script>
<script>
var attributes = {code:'AuthControl',
archive:'#WORKSPACE_IMAGES#&APPLET_VERSION.', width:132, height:37}; // problem in the path to the .jar file
var parameters = { scriptable:true, mode:'login' };
var version = '1.6';
deployJava.runApplet(attributes, parameters, version);
</script>
Error is:
...
java.lang.ClassNotFoundException: AuthControl
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
basic: load: class AuthControl not found.
...
But if we use a direct path to the jar file, it's work fine without errors, example:
<script src="https://www.java.com/js/deployJava.js"></script>
<script>
var attributes = {code:'AuthControl',
archive:'http://example.com/myapplet.jar', width:132, height:37};
var parameters = { scriptable:true, mode:'login' };
var version = '1.6';
deployJava.runApplet(attributes, parameters, version);
</script>
Why this is happens on 8 java version?
View Replies
View Related
May 20, 2014
This is the link [URL] and it says One significant difference between classes and interfaces is that classes can have fields whereas interfaces cannot.How can this be possible?
View Replies
View Related
Oct 18, 2014
At the end of my main method, I want it to print out the input given that should have been stored in my sandwich class fields, but it didn't.
import java.util.*;
import java.lang.*;
public class SandwichBuilder {
public static void main(String[] args) {
Scanner inputDevice = new Scanner(System.in);
[Code] .....
View Replies
View Related
Nov 20, 2014
I am unsure of something. In the following class, which is read first; the static field or the main method?
class Test{
static int a = 3;
public static void main(String args []) {
//some code}
}
I put some code in Eclipse and have tried to look at the hierarchy. It would point to all static fields being initialized in order from top to bottom, including the main method.I had thought that the main method was always the first thing in a public class to be initialized, regardless of where in the code it resides. Am I reading the Eclipse hierarchy wrong? I find Eclipse very difficult, especially since I typically code in Textmate. I just want to see how my code is operated upon,
View Replies
View Related
Apr 17, 2014
If I define a class which contains a few static fields, and then have a few classes who inherit this class, then all these classes would have the static field as well. Now my question is the following: would all those sub classes (and the base class itself) share the same object, or would each class have one object for all it's instances?
View Replies
View Related
Jul 9, 2014
I have a simple class, called InputManager, which has methods that communicate with another class DatabaseManager which has access to Database which is actually object that contains information about actual database.
My JFrame has Navigation class (extends JPanel). There I put all needed JButtons, JLists and so on.. This class has instance of InputManager and when user interacts with GUI components inside of it, Navigation calls InputManager methods, it then analyses the call and calls needed methods on DeviceManager, which then sends queries to Database and etc.
The problem is, that at the beginning (when user runs a program), I want to get information (which is actually values for my GUI components ) from Database. It could, for example, create another DatabaseManager and connect to the Database to get information, but it is okay to have two objects?
I was also thinking about sending same DatabaseManager object through InputManager to Navigation, but it seems strange for me to have two objects, which can interact with each other in both directions(Class A has instance of Class B, and Class B has instance of Class A). Is there anything bad this can do?
Also what I noticed that it seems odd that GUI class would have to get information from database. (Logic in GUI class).
View Replies
View Related
Apr 6, 2015
I am trying to make a program where a user can enter guests name for a hotel, the JTable includes rows for the name of the tenant, the room number, month etc.
I've made the table, however I am having some trouble in saving the data that I put into the table. I used jtextfield and a jbutton to but data into the jtable. I am trying to save the data, and load it just buy clicking a button.
table.setModel(new DefaultTableModel(
new Object[][] {
},
new String[] {
"Room", "Name", "Month", "Payment"//table rows
}
));
This is my basic table. And what I'm trying to do to save the data is:
DefaultTableModel model = new DefaultTableModel();
private JFileChooser myJFileChooser = new JFileChooser(new File("."));
private void saveTable() {
if (myJFileChooser.showSaveDialog(null) ==
JFileChooser.APPROVE_OPTION ) {
saveTable(myJFileChooser.getSelectedFile());
[Code] ....
When I run my program, I'm able to click on a button, and the dialog box will appear, I'm also able to save the data to a file. However when I click on the retieve data button I made the dialog box opens, the file is there, however when I click it, nothing happens.
View Replies
View Related
May 6, 2013
I am new to JSF and when i try to implement a sample application im getting this wierd error of page not found(.xhtml). Here is the code i have created..
Bean class :
package com.trail.beans;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@ManagedBean
@SessionScoped
public class UserLoginBean {
[Code] .....
These are the jars ive used :
commons-logging 1.1.1
myfaces-api 2.0.7
myfaces-impl 2.0.7
View Replies
View Related
Oct 20, 2014
I am new to Java, and last week had an assignment to create a shopping list. I made it so that I have one class use a ProductData class to load an array of objects (description, price, priority). This week I need to take that program and change it so that it includes an Interface and Abstract Class. I need to also split one class up into at least 2 others.
I am having trouble getting my thoughts together and figuring out what to put in the interface and what to put in the abstract class. I'm thinking that it might be best to split up the ProductData class up into 3 different classes: description, price, and priority. Then have an interface with a print method. Each of those 3 classes will implement the interface.
As for the abstract class, have the price and priority extend the abstract class. The abstract class will be at the same level as the interface and contain the set and get methods. Right now they are of 2 different data types: int, double. Should I make both of them Double, and then use a method to change the priority to an int?
Should price and priority inherit from description, or should they all be at the same level? I am thinking that they should be at the same level because they all describe the item in the array.
My most confusing part is that I have no clue at all on how I can load that array when each object is split up in a different class. My professor went over ArayLists last week, and we can now use them if we want, but the assignment doesn't explicitly say that we should change it to an Array List. Where does the constructor for the ProductData() go? Do I split it up into 3 different constructors?
View Replies
View Related
Mar 15, 2015
All I want to do is load an image into a swing JLabel and display it, but I'm going to have to make a JAR of the program and submit it for grading, so I need to be able to get the path of the image file relative to the JAR (at least I think that's how it works - I've never made a JAR before. Right now I'm just trying to load it from a path relative to my netbeans project). I've tried at least 20 different combinations of paths, file locations within the project, etc., but nothing works.
Anyways, here's the test class I've been using to try to figure this out in its current iteration. Right now the image I want to load is in src/resources and the class is in
src/imagedisplaytest
package imagedisplaytest;
import javax.swing.*;
import java.awt.*;
public class ImageDisplayTest extends JFrame {
private JLabel testLabel;
public ImageDisplayTest()
[Code]...
What's the best way to do this?
View Replies
View Related