JSF :: Submit Values Are Not Refreshing In Firefox
Oct 27, 2014
Using JSF framework. when you select one drop down value and click on refresh before submit the initial value got selected in chrome and IE .
But getting issue in firefox. The initial value is not populating.With the text box also the same issue. when we enter something and refresh before submit values are not refreshing in Firefox
View Replies
ADVERTISEMENT
Jan 29, 2015
I have a form containing several fields, 2 of which persist to different table in a database than the rest of the fields on the form. I have no problem persisting the data into both tables of the database, and after the form is submitted I reset the form to its default values. That all works fine.
But in the same session, when I open another form (a search form) and enter search criteria, which then displays a datatable containing the search results, those 2 values that are persisted to another table are not showing up, but the rest of the data is.
Here is the method that calls the persist methods:
@ManagedBean(name = "foreignPartyController")
@SessionScoped
public class ForeignPartyController implements Serializable {
...
public void saveData() {
[Code].....
The values do show up, but the problem is, when a subsequent form is opened in the same session (e.g. a search form) the field for that value shows the actual value, instead of the field being blank.'
I am not sure why the data from the one database ("parent") is showing up, yet the data from the other database ("child") is not.
Is it something I am doing wrong? I thought by setting the setter in the child controller class back to a new instance of the Entity class (PolicyPayment) that it would reset the form to default values, but at the same time retain (or save) the inputted values in the same session.
View Replies
View Related
May 8, 2014
I am a beginner in Java and had started writing a program to read text from a file and want to output each row to JTextField.
I want to compare each row of number so I need a field where each row of data keeps refreshing.
I can do it with Visual Basic with loop, Me.refresh, and system.thread.sleep. But I need to achieve it with Java.
I use System.out.println(num); which showed all rows of the file.
When I use textArea.append(num + ""); to output it, I only got all rows displayed after it reached the end. (textArea = new JTextArea("",10,30);
If I use dataRead.setText(num); to output it, I only got the last row displayed after it reached the end. dataRead = new JTextField(7);
View Replies
View Related
May 21, 2014
I want to add a Refresh button to my frame to refresh the data from the database, but I'm not sure how to refresh the data in the jtable. The constructor below initially creates the table and displays the data. Should my button destroy/create the JPanel all over, or is there a single method within the TableModel that will redisplay the data?
class TablePanel extends JPanel {
private Connection con;
private JTable table;
TablePanel() {
try {
[code].....
View Replies
View Related
Apr 24, 2014
I have been trying to learn a bit about JTables for a project I want to undertake. I have created a new JFrame in netbeans and added a button. Onclicking the button I want add some data to a JTable model and then output the JTable with the data. When I click the button again I want the same process to happen again and overwrite the previous table being displayed.
I have written the following code below:
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
[code].....
The problem I have is that when I click the button for a second time the table stays on the screen exactly as it did following the first click. I can see that the data in the model is changing so I am not sure why a new JTable is not drawn.
View Replies
View Related
Jun 3, 2014
I have a simple application ( only 2 JSPs files and one servlet the main components the whole webapp directory is attached ), I am using security constraint to redirect the user to HTTPS instead of HTTP when he submit from first page to the second page.
The problem is when the user submit the first page I get the error HTTP Status 405 - HTTP method GET is not supported by this URL although I m using only POST.
I have traced the firefox browser using httpfox and the result was the first HTTP request was done using POST correctly but after redirect the browser send GET.
This problem appears with FireFOx and IE but doesnot appear with google chrome.
index.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="myTags" tagdir="/WEB-INF/tags" %>
<html>
<head>
<title>Welcome Page</title>
<link href="css/style.css" type = "text/css" rel="stylesheet" />
[Code] ......
View Replies
View Related
Mar 4, 2014
I'm experimenting the basic concepts of Servlet technology with my below simple setup.
I have a welcome.jsp defined under webContent in eclipse and my welcome.jsp looks like
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" [b]session="false"[/b]%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
[Code] ....
Now I have few questions based on the above setup
1) As you see session="false" in jsp, and when I used scriptlet like <%= request.getSession(false) %>, I see "null" being printed but if I use pageContext.request.session.id, the session is not null. How does session = "false" influences scriptlets and implicit objects and why the behavior is different
2) If session really exists, even when session=false is used, when I disabled cookies in FireFox browser and click on "click Me" hyperlink, the control goes to Controller, but in the servlet, I see 'No Session Created" being displayed. Which means session was not created and probably because I used false is getSession(false). But if I enable cookies, with the same setup, I get Session ID = << some value>> being printed and this is same as the session what printed through pageContext.request.session.id in the jsp.
So when cookies disabled, how can pageContext.request.session.id actually printed session id , but not in servlet and when cookies enabled, the same session id is displayed in both cases.
My question is why there is no impact in jsp, when cookies are disabled.
View Replies
View Related
Feb 25, 2014
My current URL is URL....The context rootpath is URL....In my current URL page, I upload a CSV file. This page has two buttons-- ok and Cancel and these buttons are what I'm having trouble with ( I will come to that part in a short while). The relevant JSP part is as follows.
<html:form action="importEmployee?method=save" method="POST" styleId="importEmployee" enctype="multipart/form-data">
....... some headers and title bar and stuff... and then as follows.
<div class="contentSection">
<table border="0" class="formTable">
<html:hidden property = "selectedSet" />
<tr>
[code]...
So, if I click on cancel in the second URLpage (URL...), I go back to the first URLpage, i.e to URL...But this part behaves differently in Firefox and in Chrome browsers.In Chrome, if I click on cancel in the second page, I can still see the uploaded file name( the hidden property in the first JSP is the file name ) in the first page. And if I click on ok, I can do the processing again as was done by clicking ok the first time on the first page.However when I run my application in a Firefox browser, if I click on cancel in the second page, the uploaded file name says 'no file selected' in the first page. Hence to import Employees again, I need to upload a new/same CSV file again.
I don't want the file to be present in the first page when I click on cancel in the second page even when I run my application in Chrome. Yes, I require the file name to be a hidden property. This is because depending on the data in the file, different kind of processings are done and some of them require to take additional inputs from user on another page and a third page does the processing. So the file name should be passed on to the form but I don't want the user to upload the file again.
However in the event the user clicks on cancel, I don't want the file name to be retained in the first page. But this isn't happening.So I have two questions. Why is the behaviour different in Chrome and in Firefox and is there a way I can correct the way it behaves in chrome?
View Replies
View Related
Jun 6, 2014
I have an application that displays a GUI and this GUI displays a table with several columns and rows. I have a class that extends DefaultTableModel. I wrote the code that displays the GUI. When the database table changes, how would I updated the GUI dynamically? Do you have any sample code that does that?
View Replies
View Related
Jun 15, 2014
In our currenr project we have a requirement to open a local/network driver file/folder using JSF 2.0 <h:outputLink> in Firefox browser find the below sample code & correct it, how to achieve the above requirment
Sample.xhtml
<h:form>
<h:outputLink id="linkID" value="#{demoDataBean.dataLink}" target="_blank" >
<h:outputLabel value="#{demoDataBean.dataLink}" />
</h:outputLink>
[code]...
View Replies
View Related
Feb 26, 2015
The class gets complied but when I run the program the submit button doesn't work, how do i get that to work?
/**
* Orchestration class for Account
*/
import java.awt.*; //Importing the java.awt.* class
[Code].....
View Replies
View Related
Apr 24, 2014
I have a list of objects in my bean (ex: List<Apple> applies = new ArrayList<Apple>() ).The object has several fields (ex: supplier, color, width, height, breadth, etc.)I want to show this list on the front end. However I also want to allow the user to edit the attributes of the apples.So from the front end I will have like a list of fields where a set of fields is related to a single object in the list.I would also like to add/delete apples.
What first came to my mind is to map every field in the object Apple to a List. For example if Apple has field suppliers and field color then in the bean I would create two Lists, List<String> supplier, and List<String> color.From the front end I would display the contents of these Lists rather then the List<Apple> apples.T
he name of the field would be the same for each set of attributes.On save (form submit) the Lists would be re-populated with the field values (changed or not) and then I would be my Apple objects from the bean before saving in database.However I am not sure if there is something in JSF that can achieve this in a simple way, working only with List<Apple> rather than adding additional Lists.
View Replies
View Related
Apr 30, 2014
A user can dislike/like a topic. However I have to submit buttons in my jsp file, the issue is that when a user presses like/dislike it should print out on the consile line. It does that perfectly but it prints out both when it should only print out either like or dislike.
My JSP code:
<form name = "ViewTripServlet" action="ViewTripServlet" method="post">
</br>
</br>
</br>
<input type="image" name = "like" value="submit" src=images/like.png onMouseOver="this.src='images/like.png'">
</br>
</br>
</br>
<input type="image" name = "dislike" value="submit" src=images/dislike.png onMouseOver="this.src='images/dislike.png'">
</form>
Servlet Code:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
ViewTri vT = new ViewTrip();
vT.user_like(request.getParameter("like"));
vT.user_dislike(request.getParameter("dislike"));
[code]....
View Replies
View Related
Feb 27, 2015
The class does get compiled but the submit button doesn't work?
/**
* Orchestration class for Account
*/
import java.awt.*; //Importing the java.awt.* class
import java.awt.event.*;//Importing the java.awt.event.* class
import javax.swing.*;//Importing the javax.swing. class
public class AccountDemo extends JFrame
{
/// initializes the variables in the container
[Code] ....
View Replies
View Related
Feb 18, 2015
In my web application (jsf 2.2 + prime 5), when I click the submit button, JSF says: "validation error". I think the problem is related to my equals method contract.
Debugging the equals method, the type received by this method is "Short" (my PK type) and not the object type to compare (professional type in this case). So, equals will return false always!
PK declaration in Entity Class
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Short id;
equals method:
public boolean equals(Object obj) {
if (obj == null) {
return false;
[Code] ....
Is this correct?
View Replies
View Related
Mar 24, 2014
i have this code
////////////////////////////////////////////
<form name="myform" action="http://localhost:8080/EASYPAY.COM/faces/newxhtml.xhtml"method="post">
amount
<input type="text" name="amount"value="">
<input type="submit" >
</form>
[code]...
when i submit the html form the value of amount does not appear in the second jsf page new.xhtml what might be the problem
View Replies
View Related
Nov 12, 2014
make this button:
look more like this one:
I'm using GridLayout for my main JFrame.
View Replies
View Related
Nov 17, 2014
I'm new to JSF and I'm facing a problem with displaying German umlauts correctly.
I have built a site that uses an inputText to submit text that will be displayed in a list of paragraphs (as simple html... <li><p>text</p></li> etc.). A managed bean is used as a controller to store data in backend and to retrieve it from backend for display. In backend the data is stored in a list of strings and using annotations this data is written to respectively read from file system on shutdown/startup via serialization. Sometimes when I'm sending German umlauts from my webbrowser they're not displayed correctly, other times however they are which is pretty weird to me.
I've built the project with NetBeans 8 and I made sure that under Properties -> Sources the Encoding is set to UTF-8. In the xhtml page for display the encoding is set as follwed:
<?xml version="1.0" encoding="UTF-8"?> //first line
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> //in the head
<h:form [...] acceptcharset="UTF-8"> //all forms surrounding the inputText and the paragaraph list
I'm developing on a Ubuntu 14.04 desktop. For deployment I transfer the .war file via ssh to my server which is Ubuntu server (currently not sure which version, might be 12) and there I deploy the .war file on my Glassfish server online.
An example of how the input appears when it's incorrectly displayed: ä
The same letter appears like this when it's correctly displayed: ä
Another example, incorrect: ö
correct: ö
Once the data is input its appearance won't change anymore so I assume the incorrect encoding happens already before the data is stored in backend. I'm not sure yet under which conditions the data is displayed incorrectly.
View Replies
View Related
Jul 28, 2014
i have a jsp page which contains two text areas inside two separate form tags. i want to submit unicode date in one textarea and display it in another. But nothing is working for me. i have to show basically all Indian Languages and english as well. here is the code of it
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page pageEncoding="UTF-8" %>
<%@ page language="java" %>
[Code]....
View Replies
View Related
Oct 4, 2014
Trying a simple form with a text field and a submit button; the text field should start with zero and increment by 1 every time a user clicks it.
My HTML
<html>
<body>
<h2>JSP Counter</h2>
<form method="post" action="counter.jsp">
<input type="text" name="integer" value="0"/>
<input type="submit" value="Add 1" />
</form>
</body>
</html>
My JSP<%
String param = request.getParameter("integer");
try {
int i = Integer.parseInt(param);
i ++;
} catch (Exception e) {
}
%>
View Replies
View Related
Jun 26, 2012
I want to create a online examination system.i want to know to how to get questions 1 by 1 on the same jsp page and on clicking the submit button the result should be saved in database.
View Replies
View Related
Mar 11, 2014
I have created a gui which accepts username in the text field and once clicking on submit button it fetches user details and throws it on gui via JTable.
But when i click submit for the second time using different username the background process goes well and good the vector that i pass to jtable changes with new data but the values in gui still contain the old data.
View Replies
View Related
Feb 23, 2014
In a form i used <h:commandButton> i called a Javascript function. Though the function returns false , form is submitted and action method is called. I used like this
<h:commandButton onclick="test();" action="{#bean.menthod}">
test- javascript method returns boolean value false.
Above doesn't work. Below mentioned code alone worked. I want to know why
<h:commandButton onclick="if(test) return true;else return false" action="{#bean.menthod}">
View Replies
View Related
Feb 18, 2014
I'm trying to right a GUI in swing, and as part of my program, I want to open a secondary window out of the main window when a mouse clicks on the main window. Then, once I click a button on the secondary window, I want that window to close and submit data to the main window (like an info form). I have almost figured out how to do this, except for one problem. By putting a variable inside my form window called "ready," and then in my main window running a loop that constantly checks if ready is true and doesn't proceed until its true, I can create the form window, modify the values in it (currently just one value called "difficulty" that's modified by a jSlider), and then when i click the "begin" button, ready is changed to true, the form window closes, and the main window can proceed. However, when I try to put the while loop checking the ready variable inside a mouseClicked method in the main window, the form window freezes when it opens, and you can't see any of its content or modify it in any way (you can't even close it).
Here is my code:
//form window class
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class formWindow extends JFrame {
private JTextField instructions1;
[Code]...
View Replies
View Related
Feb 19, 2014
I have written a program student record system but can not save data to view or submit record. Able to run the program but failed to submit record or view pre-submitted records.
Student.java
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
class Student extends Frame implements ActionListener {
String greeding="";
Button btnNewStudent;
[Code] .....
View Replies
View Related
Aug 29, 2014
I need a way to store the pixels values currently on the screen and compare them to the values on the first frame. Right now I'm using glreadpixels as follows:
currentBuffer= BufferTools.reserveByteData(mapSize);
glReadPixels(mapStartX, mapStartY, mapWidth, mapHeight, GL_BLUE, GL_UNSIGNED_BYTE, currentBuffer);
for (int i = 0; i < mapSize; i++) {
if (currentBuffer.get(i) != baseBuffer.get(i)) {
//Do nothing
continue;
}
//Do something
}
This works perfectly fine but turns out to be a real bottleneck, dropping the fps to a third of what it was. Is there any quicker way? All I'm after is speed, I don't even need to show it on the screen if the comparison is made "behind the scene".
View Replies
View Related