JSF :: How To Force Refresh Screen

Oct 9, 2014

in my JSF2 app I have ​​screens composed with :

- Header
- Body

In the header I have a combo list. At each change in value in the combo list I have an Ajax request that updates the data in the Body. So far everything is working properly. Now the home screen's structure should be change when the value of combo list change. To do this I have :

- 1 ManagedBean HomeBean that manage the home
- 1 ManagedBean HeaderBean that manage the header
- 2 object HomeScreen1.java and HomeScreen2.java that allows me to valued data from each screen
- 2 services HomeScreen1Loader.java and HomeScreen2Loader.java that manage loading of each type of screen
- 1 template home.xhtml
- 2 fichier home1.xhtml et home2.xhtml

When I log in to the application, I get the good page corresponding (Element type 1 => home page 1). But when I select a type 2 item, the actionListener methode is execute, ManagedBean's data was updated (for type 2 screen) , but the page does not updated. What do you do ?

HeaderBean.java :

package com.omb.view;
import java.io.Serializable;
import java.util.List;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;

[Code] .....

View Replies


ADVERTISEMENT

Cardlayout Format - Change Main Menu Screen Into Game Screen On Button Click

Mar 16, 2015

I'm making a game of checkers for my A2 Computing coursework which is due in within a week. I have completely finished the game, and only thing I have left to do is connect the two JPanels together via a CardLayout that I have made. However I am unsure how to do so

Here is the code from my CardLayout:

import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.JButton;

[Code] ....

I have kept the code I am displaying to a minimal, hence I have removed all the action listeners for my buttons, anyway the problem I have is that, I would like it so that when the user clicks on the 'Multiplayer' button which is the array button ourButtons[1], it will then transition into my main game screen so that the user can then play a game of checkers.

Here is the main important GUI from my CheckerBoard class:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
  public class CheckerBoard extends JPanel implements ActionListener, MouseListener {
// Main routine that opens an Applet that shows a CheckerBoard
public static void main(String[] args) {
new CLayout();
 
[Code] ....

Once again kept to a minimal.

View Replies View Related

Brute Force On Variables

Jan 26, 2015

I have this code:

int[] X = new int[5];//X array declaration of 5 , might go higher to 10000~
for(int x_position=0;x_position<5;x_position++){//Starting X values
X[x_position]=1;
}
for(int x_value=1;x_value<=9;x_value++){
System.out.println();
for(int x_position=0;x_position<5;x_position++){
X[x_position]=x_value;
System.out.print("X["+x_position+"] = "+x_value+"; ");

[code]....

Each X[x_position] after a single cycle will be then put into char[x][y] at needed coordinates. x and y may have values from 9 to 4096;

View Replies View Related

Force JRE Installation In JNLP

Jul 17, 2014

Whether it is possible to force the installation of JRE when trying to open JNLP file. It is quite often case when users try to run JWS application without JRE installed. The best option would be to force the installation or at least display some message with instructions. Perhaps there are different ways to handle this problem.

View Replies View Related

Why Does Compiler / IDE Force To Use Static In Code

Oct 24, 2014

I'm a beginner fiddling around classes in Java. I noticed on this particular code, Eclipse will give me an error and suggest I put the static keyword in front of the variable.

public class test {
//the following line is where Eclipse puts the static keyword
static FileAccess hello = new FileAccess("D:" + '\', ".mp3");
public static void main(String[] args) {
for (int i = 0; i < hello.getTotalNumberOfFiles(); i++) {

[Code] .....

The FileAccess class is just a class I made while trying to retrieve filenames from my hard drive.

As far as I can tell, it works correctly after I put the static keyword there. I just want to know why it is required in this particular code, considering it didn't need to do that when I made a simpler class while I was getting my feet wet at creating classes in Java.

View Replies View Related

How To Force Outdated Java To Run Regardless Of Security

Jun 3, 2015

I wanna run apps using an outdated version of Java and not have it stop me for security certificates.

View Replies View Related

JavaFX 2.0 :: How To Force The Row To Construct All Cells

May 20, 2014

In other words in a table view with several editable columns, when a new row is added this row does not contain any column cells yet. Cells are added on demand once a column gains focus and starts editing. Is this the case? Is there any way to force the row to construct all cells eagerly?

View Replies View Related

JavaFX 2.0 :: How To Force Layout Of Components

Mar 13, 2015

I noticed that when building a UI programmatically in several steps the width/height of the Pane I use for layout is -1/-1. I read that this is the case until the actual rendering happens. Is there a way to force that earlier? Suppose I wanted to size other UI components (which are not visible initially) according to the size of another pane. How do I do that? Binding the properties does not do the job in the case that those components are not necessarily visible at the same time. Is there a trick to achieve that?

View Replies View Related

JRE :: Java DeploymentRuleSet - Force Attribute

Oct 27, 2014

We've implemented the Whitelist and there's an application I need to use the Force attribute with, however, I'm unable to get this to work.  As I read it, this code says use Java 1.6_24 for Example.com and any other applications are blocked from running.  There are three versions of Java installed - 1.6_24, 1.7_65 & 1.8_25.  The Java console shows 1.8_25 being called.
 
Here's the ruleset.
 
<ruleset version="1.1+">  <rule>    <id location=https://example.com />   
<action permission="run" version="1.6_24" force="true" />  </rule>
<rule>    <id />    <action permission="block">     
<message> This application is blocked due to Java restrictions, please contact the Service Desk for assistance.</message> </action>  </rule></ruleset>
 
I also tried

<action force="true" permission="run" version="1.6.0_24" />
and also
<action force="true" version="1.6.0_24" permission="run" />. 

The Java console is still showing version 1.8.0_25.

View Replies View Related

Java Into Executable Jar Force Horizontal Scrollbar

Apr 14, 2015

I have made a simple h2 db viewer using jdbc and in eclipse it has a horizontal scrollbar so it works and displays correctly.

When I run the jar from cmd it works as it should but the results all go onto new lines so all formatting is lost and it looks.. ugly...

somehow make it so the console has a forced horizontal scrollbar but dunno how.

View Replies View Related

JavaFX 2.0 :: Force Prism To Use OpenGL Version 4.1

Jun 25, 2014

Setting VM argument prism.verbose=true gives some insight of what happens.

There i see an old openGL version is used on OSX 10.9:
 
Graphics Vendor: ATI Technologies Inc.
Renderer: AMD Radeon HD 6630M OpenGL Engine
Version: 2.1 ATI-1.22.28
 
How do i force prism to a newer openGL version?

View Replies View Related

How To Refresh Page

Feb 27, 2015

I have 3 issues -

1-I'd to be able to refresh my page. currently I've set it so it doesn't refresh so I can draw but I want to introduce timed refreshment for example after 30 seconds of drawing the page goes blank and starts again.

2- I'd like to introduce a maximum amount you can draw per each refreshment. E.g the page reloads every 30 seconds and each 30 seconds you have 100 ellipses you can draw, when it refreshes you have a new 100 ellipses

My code below...

PImage bg;

int cNum = 1;
void setup() {
// Images must be in the "data" directory to load correctly
size(1200, 800);
bg = loadImage("User_T_1.jpg");

[code]...

View Replies View Related

How To Get JPanel To Refresh

Mar 18, 2015

I have tried to get my JPanel to refresh and show a new combo box, labels and fields but I can't get it working with revalidate or repaint.

package Part4; 
import javax.swing.*;
 import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
 public class AddressGUI extends JFrame implements ActionListener{
 Address address = new Address();

[code]...

View Replies View Related

JSF :: How To Refresh Whole Application

Feb 5, 2014

I want to know the how to refresh the jsf application after doing something like Faceboook... i.e if i comment or post in my application so automatically the whole application have refresh.

View Replies View Related

How To Refresh JTextArea

Apr 21, 2014

I created this JTextArea with some text in it. And it also has few variables.

Sth like that:

Java Code:

protected JTextArea textLog;
textLog = new JTextArea();
textLog.append("test: "+variable); mh_sh_highlight_all('java');

And now while I use button that changes variable value, in textLog variable still shows old value.

Tried to use remove(textLog); textLog.validate(); etc(remove, validate, revalidate, add, repaint), because it works fine with JButtons, but still, in textLog variable gives me old value.

like "you should use somethingvalidate(); while clickin button and it will works", not some shit for 3032 lines with 99% of code that I don't need to do what I want.

View Replies View Related

JSP :: Cannot Get Correct Path On Refresh

Feb 10, 2014

I want to use the bit of code below to re-write the page to tell the user of a successful registration and then redirect them to another page. My problem is that I can't figure out how to get the path right for the login page. As can see, my first choice was to have the use click to the login page and when I use href it works fine.

I tried to use the entire file page starting at C and that didn't work. I also tried

${pageContext.request.contextPath}/Login

which is what I had to do for the action in the form for the login servlet page.

My question is what is the URL I need to use. By the way, if I jut put in google's URL, or any other for that matter, it works fine.

out.println(docType +
"<html>
" +
"<head><title>" + "Already Registered" + "</title>" +
"<meta http-equiv='refresh' content='3; URL='Login.jsp'></head>

[Code] .....

View Replies View Related

JSP :: How To Delete Previous Data After Refresh

Nov 6, 2014

If I am refreshing JSP page the old data is remaining as it is with new data.what can be done to remove previous data from that JSP?

View Replies View Related

Swing/AWT/SWT :: JGoodies JTable Refresh

Jul 11, 2014

I have designed a form using JGoodies. In my From I have a Jtable.

FormLayout layout = new FormLayout(…) ;
CellConstraints cc = new CellConstraints() ;
PanelBuilder builder = new PanelBuilder(layout);
String[] columnNames = {"name","code"};
Object[][] data = null ;

[Code] ....

When the table's content changes, I have to refresh the screen to show the new table. How can I do this?

View Replies View Related

JavaFX 2.0 :: Refresh Included Tab Page

May 17, 2014

I have an fxml page with a TabPane element with two tabs tabOne and tabTwo:
 
<BorderPane  fx:controller="lc.controllers.ControllerOne"  xmlns:fx="http://javafx.com/fxml">
    <center>
                <TabPane fx:id="tabPane">
                    <tabs>
                        <Tab fx:id="tabOne" closable="false">
                            <text >ONE</text>

[Code] ....
 
As you can see above tabTwo has a separate fxml included within.
 
Now some of the tab content in tabTwo needs to be refreshed based on the actions performed in tabOne. But however initialize method of included tab action class is called only once for the first time when the fxml page loads. How the initialize method of tabActions.fxml can be forced to execute every time the tab loads?

View Replies View Related

Servlets :: Website Loads Correctly Only After A Refresh?

Jan 16, 2015

find out why when I access the site for the first time, it loads a blank white page, but when I reload it, it forwards me to the home page as it should.

I doubt that the reason is nothing else than the code below (in the doGet method):

String email = (String) request.getSession().getAttribute("email");
String cookieValue = null;
System.out.println(email);
// first, checking the session
if (email != null) {
request.getRequestDispatcher("/homelogged").forward(request, response);

[code].....

I suppose it's something with the session... because after I reload it, it works. But! When I close the browser and start all over again, the main page is white-blank again... And after a reload it works.

The exception:

SEVERE: Servlet.service() for servlet [first] in context with path [/MYSITE] threw exception
java.lang.NullPointerException
at controller.Controller.doGet(Controller.java:42)
Line 42 of the Controller is "for (int i = 0; i < cookies.length; i++) {"

P.S. I cleared all the cookies, but the problem persists.Also, the first it loads, it prints in console:

"null
been here 4!"

But, if I reload further, it prints:

"null
been here 4!
been here 2!
No Email! Literally, doGet!"

View Replies View Related

Swing/AWT/SWT :: How To Refresh JFrame When Close JDialog

Jun 5, 2014

I have JFrame and when I click a button which is in frame JDialog is opened. Now,how can I refresh JFrame when close JDoalog?

View Replies View Related

How To Get JList To Update When Refresh Button Pressed

Mar 15, 2015

I am able to update the array holding the items but I don't know how to refresh the JList to include all the new items in the array.

Code for GUI:

import java.awt.ScrollPane;
import java.awt.event.ActionListener;
import javax.swing.*;
public class ListView extends JFrame{
HobbyList stuff = new HobbyList();

[Code] .....

View Replies View Related

How To Update / Refresh JPanel On JButton Click

Apr 13, 2015

I am trying to plot a graph and graph should display when JButton is clicked. To create data set, I am taking some value through JTextField and then created a chart and plotted it. I've got a problems: the chart doesn't refresh when I change the text field value.URL....Here is my program:

public class Test2 extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
private JPanel contentPane;
private ChartPanel chartPanel;
private JTextField textField_1;
double a;

[code]....

View Replies View Related

Label Refresh Function Does Not Work With ACM Package

Feb 8, 2014

I'm trying to setup a function that takes input from a user and prints it onto a label and updates it per entry. The updating would occur through removing the old label and then adding a label with the updated value. The text would be center-aligned. While I'm able to get the label to print the current value of "entry", it does so without removing the label with the old value.

I tried reversing the add(label) and remove(label) to see if there is a syntax error with remove, and I determined from the label not being there at all that remove was called correctly. I have kept the loop infinite for debugging purposes to work with various test cases as they come to me.

Java Code:

import acm.graphics.*;
import acm.program.*;
public class testCanvas extends ConsoleProgram {
public void run() {
GCanvas canvas = new GCanvas();
add(canvas);
String entry ="";

[Code] .....

View Replies View Related

Swing/AWT/SWT :: Adding Button To Refresh Tree

Apr 6, 2015

I want to add a button who refresh the tree the problem that i have not "DefaultTreeModel" in my class to do this ((DefaultTreeModel) jTree1.getModel()).reload(); and i try this jtree.updateUI(); but not work ....

View Replies View Related

Java Servlet :: How To Force Browser To Open / Save / Save As File From Server

Sep 25, 2012

How to force browser to open/save/save as the file from server instead of browser cache.

I am creating a csv file through a pl/sql procedure and forwarding the link to user once user clicks on link he downloads the file, however if the same thing is repeated then browser returns the old cached file instead of new file generated on server.

View Replies View Related







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