From users-return-13932-apmail-tomee-users-archive=tomee.apache.org@tomee.apache.org Sun Oct 20 08:01:10 2013 Return-Path: X-Original-To: apmail-tomee-users-archive@www.apache.org Delivered-To: apmail-tomee-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3EF8E10E87 for ; Sun, 20 Oct 2013 08:01:10 +0000 (UTC) Received: (qmail 50050 invoked by uid 500); 20 Oct 2013 08:01:08 -0000 Delivered-To: apmail-tomee-users-archive@tomee.apache.org Received: (qmail 49773 invoked by uid 500); 20 Oct 2013 08:01:08 -0000 Mailing-List: contact users-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@tomee.apache.org Delivered-To: mailing list users@tomee.apache.org Received: (qmail 49764 invoked by uid 99); 20 Oct 2013 08:01:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Oct 2013 08:01:05 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rmannibucau@gmail.com designates 209.85.128.53 as permitted sender) Received: from [209.85.128.53] (HELO mail-qe0-f53.google.com) (209.85.128.53) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Oct 2013 08:01:01 +0000 Received: by mail-qe0-f53.google.com with SMTP id cy11so3043008qeb.12 for ; Sun, 20 Oct 2013 01:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=wb/2MJEDgcXWO+sNrbcKhbabKBNK6Nw3f2NwCb7VDsE=; b=h8jvFwV20jdwnnnAiKFsjUZh58G2A9OCe9Q9rPCdnk8Cpuk/+OQJZPwV/HVghxRR1Z u1JV5nSEVaH+kFeCCO6bJWTJQzRBc6BdVkscc4coeZoDuZhOCik1leQ7w1w5eauFBF3+ 70IESZ1AC2aAU9pfJY4VHKSuNNJkDhpa53sq2bQqRn3lwGFdY2G5q6Bl1MmU7V6LVgYZ LqHbyJC7W1opj+Q4iBAPW7qx92a7tDz8hKW04O/UCFIT4D/gJbMx5Bcw6fp+1KykfUZ0 6kSOcaQ7O4ailk8wksgw5GicVNNYvwuOJiWEfin7CtcNqOrmz5C4Ajvg0m82g284Yh4I xYSw== MIME-Version: 1.0 X-Received: by 10.224.120.199 with SMTP id e7mr15747270qar.50.1382256040336; Sun, 20 Oct 2013 01:00:40 -0700 (PDT) Received: by 10.96.41.99 with HTTP; Sun, 20 Oct 2013 01:00:40 -0700 (PDT) Received: by 10.96.41.99 with HTTP; Sun, 20 Oct 2013 01:00:40 -0700 (PDT) In-Reply-To: References: <1382167015.36881.YahooMailNeo@web28901.mail.ir2.yahoo.com> <1382194175.59249.YahooMailNeo@web28902.mail.ir2.yahoo.com> <1382211989.70533.YahooMailNeo@web28905.mail.ir2.yahoo.com> Date: Sun, 20 Oct 2013 10:00:40 +0200 Message-ID: Subject: Re: Entity cant be refreshed with new list values From: Romain Manni-Bucau To: users@tomee.apache.org Content-Type: multipart/alternative; boundary=001a11c3329c45e43a04e92790ec X-Virus-Checked: Checked by ClamAV on apache.org --001a11c3329c45e43a04e92790ec Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Not really. An entity handles a state which can prevent it. Nothing mandates it to work Le 20 oct. 2013 09:50, "Jos=E9 Luis Cetina" a =E9cri= t : > What about using a detached entity?? The detached entity will work like a > DTO? > > From Real World Java EE Patterns (Adam Biem) 2009 > Problem > The origin problem statement was: =93You want to transfer multiple data > elements over a tier=94 > ( > > http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.h= tml > ). > This particular problem was elegantly solved in Java EE 5 with detachment > of persistent entities. There is > no need for the introduction of another class just for transferring the > entities data. JPA entities can > implement a java.io.Serializable interface and be transferred between > tiers, even remote ones. > CMP 2.x entities weren=92t Serializable, the developer was forced to copy > their states to a remotely > transferable structure=97the Transfer Object. > > > > 2013/10/19 Howard W. Smith, Jr. > > > responses below... > > > > On Sat, Oct 19, 2013 at 3:46 PM, Mark Struberg > wrote: > > > > > be careful with immediate=3Dtrue. You get all sorts of nasty side > effects. > > > > > > see page 92 in > > > > > > http://people.apache.org/~struberg/eesummit2013/Java%20EE%20Summit%20-%20= pitfalls%20in%20EE.pdf > > > > > > > > I definitely agree and understand about immediate=3Dtrue, and guess wha= t, i > > found it very useful to disable validation as instructed on page 92 of > the > > PDF file. > > > > clarification of my use/understanding: > > > > i am 'not' using immediate=3Dtrue, when i user is to select a row on > > datatable, and then click commandbutton/link/menuitem, which does a POS= T > of > > the selected row on the datatable, and bean uses the selected row to > > prepare the UI for the next view that is 'rendered' via > > ui:include=3D#{bean.page}. see below and keep reading, please. > > > > > > > actionListener=3D"#{pf_pointOfContactController.prepareCreate()}" > > update=3D"#{pf_pointOfContactController.getAjaxUpdate()= }"/> > > > > > actionListener=3D"#{pf_pointOfContactController.prepareEdit()}" > > update=3D"#{pf_pointOfContactController.getAjaxUpdate()= }"/> > > > > > actionListener=3D"#{pf_pointOfContactController.prepareView()}" > > update=3D"#{pf_pointOfContactController.getAjaxUpdate()= }"/> > > > > > > > actionListener=3D"#{pf_pointOfContactController.copySelectedRows()}" > > update=3D"#{pf_pointOfContactController.getAjaxUpdate()= }"/> > > > > > > actionListener=3D"#{pf_pointOfContactController.confirmDeleteSelectedRows= ()}" > > update=3D"#{pf_pointOfContactController.getAjaxUpdate()= }"/> > > > > but, for a readonly page that has commandbutton/links to render a new > view, > > based on the current @Entity that is held in the JSF controller/bean > class, > > i use immediate=3Dtrue without issue and I think it fits/meets the > > occasion/requirement, because there is no need to do validation phase o= r > > update model values. see below. :) > > > > immediate=3D"true" > > update=3D"#{pf_pointOfContactController.getAjaxUpdate()}" > > > > actionListener=3D"#{pf_pointOfContactController.prepareList()}"/> > > > immediate=3D"true" update=3D"#{pf_pointOfContactController.getAjaxUpdat= e()}" > > > > actionListener=3D"#{pf_pointOfContactController.confirmDelete()}"/> > > > immediate=3D"true" update=3D"#{pf_pointOfContactController.getAjaxUpdat= e()}" > > > > actionListener=3D"#{pf_pointOfContactController.prepareEdit()}"/> > > > > > > -- > ------------------------------------------------------------------- > *SCJA. Jos=E9 Luis Cetina* > ------------------------------------------------------------------- > --001a11c3329c45e43a04e92790ec--