JSF :: Move Datatable Rows Up And Down?

May 22, 2014

I have a requirement like in a Rich datatable, and i have placed two links up and down in one of the column of each row, here i wanted to swap rows (move up/ down ) the rows when i click the link on a perticular row. is it possible with jsf/ java script?

View Replies


ADVERTISEMENT

JSF :: XML Schema Into Datatable

Apr 21, 2014

I have an xml schema.. I need to display it as JSF datatable.This is my xml schema

XML FILE
<?xml version="1.0" encoding="UTF-8"?>
<shiporder orderid="889923" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Shiporder.xsd">
<orderperson>John Smith</orderperson>
<shipto>
<name>Ola Nordmann</name>
<address>Langgt 23</address>

[code]....

View Replies View Related

JSF :: Nested Table Without Using Datatable

Apr 11, 2014

Need to create a nested table without using datatable. I am using jsp and jsf but using datatable is not allowed.

View Replies View Related

JSF :: Edit / Update Row Of Datatable

Jan 23, 2014

I am implementing code of edit/update row of datatable in jsf.

package org.demo;
import java.util.ArrayList;
import java.util.Arrays;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@ManagedBean(name="order")
@SessionScoped

[Code] .....

View Replies View Related

JSF :: Datatable Not Editable Inside Of A Form

Oct 11, 2014

When I have a datatable of primefaces with paginator and its only readable and not editable, its not needed to be inside of a form, right? although I have seen it many times inside of it

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 :: Populating A Datatable From Onetomany Collection

Apr 9, 2015

I am having a hard time trying to wrap my head around trying to get a couple of columns in a datatable populated with values from a @OneToMany collection. The concept is simple but my brain refuses to grasp it!! I will try to make this brief...

I have several forms built with primefaces 3.5 using NetBeans 8 IDE on a JBoss EAP 6.21 server, and JPA 2.1 annotations. Data is extracted from an Oracle 11 database, which consists of several lookup tables, as well as a primary table and secondary table. Using the EntityManager createQuery method I query the database, which of course returns a resultset. The query grabs all records from the primary, as well as values from 2 specific columns of the secondary database, based on search criteria entered by the user on a primefaces search form. The returned results are then iterated through, this is where I am trying to get the values from the secondary table to populate specific fields in the datatable.Here is the applicable code from the list.xhtml form containing the datatable:

<p:dataTable id="datalist" value="#{foreignPartyController.returnedSearchResults}" var="item"
selectionMode="single" selection="#{foreignPartyController.selected}"
paginator="true"
rowKey="#{item.foreignPartyId}"
rows="30"
rowsPerPageTemplate="10,20,30,40,50"
sortOrder="ascending"
resizableColumns="true"
style="overflow: auto"

[code]....

As odd as the code may look (and I will completely understand anyone cringing as to some of the coding methods I use), specifically with the ui:repeat tags nested inside the datatable tag of the list.xhtml form, I strangely do see the values from the secondary table showing up in the form showing the results in a datatable. However, when the user clicks on a specific record in the returned resultset listed in the datatable, another form is opened and populated with the values from the datatable, but the 2 fields on that form that should be populated with the 2 values I referred to before from the secondary table (i.e. policy1Num and totalPayoutAmt) do not have the values in them.

This is partly because I have those 2 fields in the editable form pointing to the managed bean of the secondary table (code from that bean not shown here), rather than the same "polNum. policy1 Num" and "totPayout.totalPayoutAmt" var I am using in the list.xhtml form. How those values are being successfully returned into the datatable of the list.xhtml form - I happened to "stumble" across the use of the "polNum" and "totPayout" vars with the "policy Payment Collection" list. I do not know how to do the same thing for those 2 fields in the editable form.how a datatable gets populated, specifically with values in a @OneToMany collection,

View Replies View Related

JSF :: Selected Checkboxes Does Not Change To Unselected In Datatable

Jul 8, 2014

I used Primefaces 4.0.7.I has trouble with checkboxes, which are not change,with unselected checkboxes when I press . I mean, i selected someone from selectone menu in my bsPanel(first panel) and then the datatable fills with his/her duty.Then I select all the duties in the datatable to assign to someone else in bilgiPanel. Then duties assign this person and then i choose same person in the top panel(bsPanel),then datable seems with selected sutiesHere xhtml file;

<p:panel id="bsPanel" header="#{etiketler.personel}" collapsed="false" toggleable="true" >
<h:panelGrid id="grid" columns="2" columnClasses="colclass1,colclass2" rowClasses="rowclass1, rowclass2">
<h:outputText value="#{etiketler.personel}: " />
<p:selectOneMenu id="personel" value="#{bsView.kullanici}"
effect="fade" converter="#{entityConverter}">
<f:selectItems value="#{bsView.kullanicilar}" var="s"
itemLabel="#{s.adiSoyadi}" itemValue="#{s}"
/>

[code]....

View Replies View Related

JSF :: Enable / Disable Columns In DataTable PrimeFaces

Jul 21, 2014

I have created one dataTable in page and shown some columns but I want to show only those columns which have entries ( if any column doesn't have record then it should not be displayed on the page.) . How should I put validation on this and display table.

View Replies View Related

JSF :: How To Update Datatable After Registering User In Database

Apr 11, 2014

I have requirement, in that I am showing a Datatable, above that table i have form in that i can register a employee, after clicking on submit employee data have to be saved in the database aswell as i have to update datable, so that I can see that registered employee in that Datatable, how can i full fill this requirement. I am using jsf 2.0, ejb3.0,jpa 2.0.

@Override
public List<Employees> getallEmployees() {
System.out.println("all employee fetched");
return (List<Employees>) em.createNamedQuery("Employees.findAll").getResultList();
}

In managed bean I am calling this service as fallow in init method, and i am binding same this. employee list to UI

public String getAllEmployeesfronHr() {
this.employees = customerservice.getallEmployees();
System.out.println(this.employees.size() + "=================size of employee");
return "";
}

For every submit button click i have to query database or is there any mechanism to update List / can we use entity manager in anyway so that we can update Employee List....

View Replies View Related

JSF :: Dialog Box Data Show In Primefaces Datatable When Click On CommandButton

Aug 5, 2014

When i click on 'Add Invoice' button open a dialog box. input data in dialog box. After click on 'Save Invoice' all the data of dialog box is render in primfaces datatable. After that click on 'Save Invoices' all data of primefaces datatable and HTML table data are store in ipsDetail and Invoice object of Managed Bean class.

XHTML file :

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets">

[Code] .....

Here, Problem is ipsDetail elements NULL when click on 'Save Invoice' button in addRow() so that primefaces datatable not updated. So that i can not insert new invoice data in database table.

View Replies View Related

JSF :: Dialog Inside Datatable With Button Displays Wrong Variable Value

Nov 27, 2014

I have a bookings table where customers can view their bookings and in the table there is a button with a command button that onclick goes to the dialogue to display the variable petUpdate value but if you have 2 bookings then all the update buttons display the value of the last petUpdate in the arrayList.

DataTable with the button

<p:dataTable
id="bookingTable"
var="customerBooking"
value="#{booking.sessionBookingList}"
editable="true"
style="margin:0px 0px 20px 100px;font-size:15px;width:600px;"
>

Code in the above datatable.......The commented out output label displays the correct value for each but when the button is clicked the dialog only displays the last ones value

<p:column headerText="Check Updates" style ="width:50px;">
<!-- <h:outputLabel value="#{customerBooking.petUpdate}"></h:outputLabel> -->
<p:dialog header="#{customerBooking.petName}'s Status" widgetVar="dlg1" minHeight="60" minWidth="60" maxWidth="60">
<h:outputText value="#{customerBooking.getPetUpdate()}" />
</p:dialog>
<p:commandButton value="?" onclick="PF('dlg1').show();" style ="width:40px;">
</p:commandButton>
</p:column>

View Replies View Related

How To Move JLabel In JPanel

Jan 9, 2014

I am trying to move a JLabel in a JPanel, but can't seem to make it work. I can't provide a compiling code, but a few fragments. I have a JLabel [] array. i want to move with the mouse elements of this array. Let's say i want to move JLabel[i]. I implemented this:

Java Code:

static int labelY;
static Point labelX;
static Boolean flag = false;
jLabel[i].addMouseListener(new MouseAdapter(){
public void mousePressed(MouseEvent evt){
labelY=evt.getY();

[Code]...

I used the bool flag because i can't make changes to the label when it is inside an anonymous class. I also tried using setLocation but that did not work also. I don't get any errors when compiling. But when i run it and try to drag the JLabel[i] i get a long list of errors:

Java Code:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at puzzle.hw$1$2.mouseDragged(hw.java:276)
at java.awt.Component.processMouseMotionEvent(Unknown Source)
at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)

[Code]...

View Replies View Related

Trying To Make The Image Move

Oct 27, 2014

I am having trouble making my image move to a certain position in a certain amount of time which is set inside a text file. I was wondering what I'm doing wrong and what I'm missing.

import java.io.*;
import java.util.*;
import java.io.FileReader;
public class Animator {
EZImage HP;

[code]....

View Replies View Related

How To Keep Character In Place With Up And Down To Move

Jan 30, 2014

I noticed it is a huge success to have the backgrounds of games move and the character just move up and down and dodge obstacles.How Do I make a background that scrolls horizontally to the left? I know how to keep the character in place with up and down to move, but not sure how to go about making the background move with obstacles.

View Replies View Related

Character Won't Move When Key Is Held

May 29, 2014

I was just trying to figure out why when I hold down a movement key, that my character doesn't move. It only moves if I continuously press the movement key. Here is my code:

package game;
import java.awt.*;
import TileMap.TileMap;
import Handlers.Keys;
public class Player {
private double x;
private double y;

[Code] .....

View Replies View Related

How To Move Multiple Objects At Once

Oct 8, 2014

I am new to Java programming and i am using BLUEJ to create some basic objects etc.

I have 3 circle objects (individual) and i am wanting to use "slowMoveHorizontal" method to move these 3 objects about 50px to the right.

So far, everything works BUT the issue is that they do NOT move together simultaneously. They move on a ONE BY ONE basis.

View Replies View Related

Servlets :: How To Move To Another JSP Page

Mar 27, 2014

I have created a authentication servlet as follows :

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

// TODO Auto-generated method stub
/* Connexion la base de donnees */
try {
Class.forName("org.postgresql.Driver");
System.out.println("Driver O.K.");

[code]...

I just want to know how can i move to another jsp page from my servlet.

View Replies View Related

Move A Methods To A New Class

Feb 5, 2015

there are two classes here. I need to put the max and min methods should be in the tester class, but I have tried moving it to the tester class and it will not comply. When I run I get a list of errors of "Error:(43, 9) java: illegal start of expression

Error:(43, 16) java: illegal start of expression
Error:(43, 22) java: ';' expected
Error:(43, 41) java: '.class' expected
Error:(43, 52) java: illegal start of expression
Error:(43, 51) java: not a statement
Error:(43, 53) java: ';' expected
Error:(57, 9) java: illegal start of expression
Error:(57, 16) java: illegal start of expression
Error:(57, 22) java: ';' expected
Error:(57, 41) java: '.class' expected
Error:(57, 52) java: illegal start of expression
Error:(57, 51) java: not a statement
Error:(57, 53) java: ';' expected"

package A808;
public class FuleTesterV1
{
public static void main(String[] args)
{
String titleLines;
titleLines = "Yearly Gas Mi Calc | Assignment 8.08";
String TitleLines;
TitleLines = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";

[code]....

View Replies View Related

How To Move Along A Doubly Linked List

Dec 11, 2014

I'm having some trouble with figuring out how to move along a doubly linked list for an assignment. The program is supposed to be a simple board game simulation. Here is what I have so far:

Space.java:

public class Space
{
private String name;
public Space next;
public Space previous;
public Space(String name)
{
this.name = name;

[Code]...

I seem to have been able to get all the other methods working properly, but I am pretty stuck on how to do the movePlayer. Specifically because it is passing an integer, but my objects are of type Space and Boardgame.

View Replies View Related

Move Object During Drag And Drop

Jan 23, 2014

I am just trying to understand during a drag and drop how can I transfer the actual object instead of just creating a new one. I believe I am close but I cannot nail down where I am going wrong. Here is my code I am using to test this.

First/Main:

Java Code:

package main;
import javax.swing.SwingUtilities;
public class Main {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable(){

[Code] ......

When I drag the JPanels it just copies and makes a new one. I tested this by having a sysout send to the console a private int that I set during the initial creation of the object.

View Replies View Related

Code To Move Object In Grid

Aug 22, 2014

Working with some code that displays the random movement of an object such as Move 1: (0,1) Move 2: (10,99)?

I need these methods in the class

void initialize( int xPos, int yPos)
void moveLeft()
void moveRight()
void moveUp()
void moveDown()
int getXPosition()
int getYPosition()

View Replies View Related

Move Two Objects Across JFrame With Threads

Jun 25, 2014

Below are three classes. The first and second create car objects and the third is the main method. My goal is to move two cars across the window. When I compile and run the program both cars are generated however they will not animate. I am moving them with threads but I cannot seem to find why the cars will not move.

import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.JComponent;
public class CarComponent extends JComponent {
private Car car1;
private Car car2;

[Code] ....

View Replies View Related

Move All Of Number 7 To Front Of Array

Jan 24, 2015

I'm using Dr.Java and doing a numbershifter lab. I have to create a random array of number from 1-10. Then move all of the 7s to the front of the array. The order of the other numbers is not important as long as all numbers follow the group of Lucky 7s. Files needed Numbershifter.java and numbershifterrunner.java. All data is random.I have done the following:

public class NumberShifter
{
public static int[]makeLucky7Array( int size)
{
int [] newRay = new int[size];
for( int i=0;i<newRay.length; i++)
{
newRay[i] = (int)Math.round(Math.random()*10+1);

[code]....

It's adding to many 7s in the front of the array.

View Replies View Related

How To Move Objects In Java Using Buttons

Aug 17, 2014

I have a program which require to navigate a circle with for buttons, Up, Down, Right, and Left. How can i do that?

Here's my code:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

package moveobject;
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class MoveObject extends Applet implements ActionListener

[Code] .....

View Replies View Related

How To Make Green Selection Box To Move Around

Feb 16, 2014

I'm making a simple game where there's a 10x10 grid and you can move around a selection box and you can move around. I've been trying to make the green selection box to move around but it won't move! I only have right movement in the code but it won't work so far. Here are the classes that have to do greatly with each other.

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.image.BufferStrategy;
import java.util.Random;
 
public class Game extends Canvas implements Runnable{
private static final long serialVersionUID = 1L;
 
[Code] ....

I also tried an approach where you click with the move and it snaps to a tile grid but that didn't work either.

View Replies View Related







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