Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 4831 invoked from network); 3 Mar 2011 17:00:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Mar 2011 17:00:58 -0000 Received: (qmail 11742 invoked by uid 500); 3 Mar 2011 17:00:57 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 11685 invoked by uid 500); 3 Mar 2011 17:00:57 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 11677 invoked by uid 99); 3 Mar 2011 17:00:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 17:00:57 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of richard.k.yee@gmail.com designates 209.85.214.181 as permitted sender) Received: from [209.85.214.181] (HELO mail-iw0-f181.google.com) (209.85.214.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 17:00:49 +0000 Received: by iwn2 with SMTP id 2so1224040iwn.12 for ; Thu, 03 Mar 2011 09:00:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=OQm+2qsk+JOKGv1RzBI1T163i3VK9K9hbjnG15FT1N4=; b=QCaDYNZw65OrKs/3+pn4SpKur1ABv2e3kKBzUALZUyN/JnYGtBoUTtEVitFs558oih U1uJs5+5bOMfBvKNCjeEawe8gBGjzrYp7FXnVb3kIpjP4eyNRvK3rAuvgmJtOWsfXRNG Oh9kxDX9JTSY/hkG3rmmyrlSQVnwvYqEews+I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=R2Wt7b4/otykgZPCR0uWD7Y0/eDAS6mBShyiuv8Crzp9jyX5rEcg6wxXX6I6uNuNKi bjEdaidJPFVSlv+uWglQEhtHlP4S9as+G6KpuuWbMzxv5U/dzSazwccr0iuWd7+Jql3P nXoQVM+auqsfT9K4+zu5V6ahg3kQfy0yg4eMk= MIME-Version: 1.0 Received: by 10.231.61.201 with SMTP id u9mr1087236ibh.128.1299171628378; Thu, 03 Mar 2011 09:00:28 -0800 (PST) Received: by 10.231.39.204 with HTTP; Thu, 3 Mar 2011 09:00:28 -0800 (PST) In-Reply-To: References: <3150623219871629127@unknownmsgid> <6819536426873199730@unknownmsgid> <-1240845642059190982@unknownmsgid> Date: Thu, 3 Mar 2011 09:00:28 -0800 Message-ID: Subject: Re: Using statusIndicator From: Richard Yee To: MyFaces Discussion Content-Type: multipart/alternative; boundary=001517740f90696ab9049d96f788 X-Virus-Checked: Checked by ClamAV on apache.org --001517740f90696ab9049d96f788 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable what is the initial value of pollText in your backing bean? If it is "", yo= u should set it to something else, ie. "Processing". The outputText inside statusIndicator will only show during the time the Ajax request is being made. Once the response is returned, it will disappear. -Richard 2011/3/3 H=E5kon Sagehaug > Hi > > I now have my login page like this > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > xmlns:f=3D"http://java.sun.com/jsf/core" > xmlns:h=3D"http://java.sun.com/jsf/html" > xmlns:tr=3D"http://myfaces.apache.org/trinidad"> > > > > > > > > > > > > value=3D"#{helloWorldBacking.username}" > required=3D"true" /> > > value=3D"#{helloWorldBacking.password}" > required=3D"true" secret=3D"true" /> > > > partialSubmit=3D"true" > actionListener=3D"#{helloWorldBacking.send}" /> > > > > partialTriggers=3D"loginButton" /> > > > > > > > > But then I got nothing in the outPutText field. Any other hint/tips or > tricks. I really appreciate the help > > Cheers, H=E5kon > > On 3 March 2011 17:25, Scott O'Bryan wrote: > > > That doesn't seem to make any sense to me Richard. The poll component > > does not replace statusIndicator, they simply do two different things. > > The purpose of the poll component is to initiate a request based on a > > clock instead of a user click. You still need some way to display the > > information.. > > > > Hakon, > > > > The partial trigger in this case should be on the output text although > > having it on the status indicator should also work (you'll just get a > > larger payload). > > > > Try this. Remove the status indicator and only have the output text. > > Make sure your outputText is located inside the form (possible your > > getting a scoping issue). > > > > Does that work? It should. > > > > On Mar 3, 2011, at 9:06 AM, Richard Yee wrote= : > > > > > You don't want statusIndicator, use tr:poll instead > > > > > > Richard > > > > > > Sent from my iPhone > > > > > > On Mar 3, 2011, at 7:48 AM, H=E5kon Sagehaug > > wrote: > > > > > >> Hi > > >> > > >> Yes, that was an old cut and past mistake, I've got loginButton as i= d > > for > > >> the button. The latest test are with loginButton, not button2. So th= is > > way > > >> of doing it should normally work? > > >> > > >> cheers, H=E5kon > > >> > > >> On 3 March 2011 16:35, Scott O'Bryan wrote: > > >> > > >>> Umm. Considering the id of your button is button2, I'm not sure wh= y > > >>> your partialTrigger is loginButton. Can you explain? > > >>> > > >>> On Mar 3, 2011, at 6:46 AM, "H=E5kon Sagehaug" > > >>> wrote: > > >>> > > >>>> Hi all, > > >>>> > > >>>> I might not get the full point here ;). Here is what I tried, put > > trigger > > >>> on > > >>>> the statusIndicator like here > > >>>> > > >>>> > > >>>> > > >>>> > >>> value=3D"#{helloWorldBacking.pollText}" > > >>>> /> > > >>>> > > >>>> > > >>>> > > >>>> And on the outputText like here > > >>>> > > >>>> > > >>>> > > >>>> > >>> value=3D"#{helloWorldBacking.pollText}" > > >>>> partialTriggers=3D"loginButton"/> > > >>>> > > >>>> > > >>>> > > >>>> Where loginButton is > > >>>> > > >>>> > > >>>> > > >>>> But nothing seems to have the wanted effect. I looks like it picks > up > > the > > >>>> initial value for the helloWorldBacking.pollText, but when this > value > > >>>> changes it's it not propagated in the UI. Maybe this can't be done > > like > > >>> I've > > >>>> sketched out. The backing code is the same as sent in a earlier > email. > > >>>> > > >>>> Other tips? > > >>>> > > >>>> Cheers, H=E5kon > > >>>> > > >>>> > > >>>> On 3 March 2011 05:23, Richard Yee wrote= : > > >>>> > > >>>>> Try putting it inside the tr:form or inside your panelPage > > >>>>> > > >>>>> > > >>>>> -Richard > > >>>>> > > >>>>> 2011/3/1 H=E5kon Sagehaug > > >>>>> > > >>>>>> Hi > > >>>>>> > > >>>>>> Thanks for the reply, here is my xhtml, with a simple login form > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> /> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > >>>>>> value=3D"#{helloWorldBacking.username}" > > required=3D"true" > > >>>>> /> > > >>>>>> > > >>>>>> > >>>>>> value=3D"#{helloWorldBacking.password}" > > required=3D"true" > > >>>>>> secret=3D"true" /> > > >>>>>> > >>>>>> partialSubmit=3D"true" > > >>>>>> action=3D"#{helloWorldBacking.send}" /> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> And parts of the backing bean > > >>>>>> > > >>>>>> public String send() { > > >>>>>> FacesContext facesContext =3D FacesContext.getCurrentInstanc= e(); > > >>>>>> > > >>>>>> System.out.println("user name " + username + " is logged in = " > > >>>>>> + userLoggedIn); > > >>>>>> > > >>>>>> try { > > >>>>>> Thread.sleep(5000); > > >>>>>> Token tok =3D tokenMgr.getToken(username, password, true= ); > > >>>>>> Thread.sleep(2000); > > >>>>>> pollText =3D "Token fetched"; > > >>>>>> if (tok !=3D null) { > > >>>>>> userLoggedIn =3D true; > > >>>>>> return ("success"); > > >>>>>> } > > >>>>>> username =3D ""; > > >>>>>> password =3D ""; > > >>>>>> } catch (TrustException e1) { > > >>>>>> e1.printStackTrace(); > > >>>>>> } catch (AxisFault e) { > > >>>>>> e.printStackTrace(); > > >>>>>> } catch (FileNotFoundException e) { > > >>>>>> e.printStackTrace(); > > >>>>>> } catch (XMLStreamException e) { > > >>>>>> e.printStackTrace(); > > >>>>>> } catch (InterruptedException e) { > > >>>>>> > > >>>>>> e.printStackTrace(); > > >>>>>> } > > >>>>>> FacesMessage message =3D new FacesMessage("Login failed"); > > >>>>>> > > >>>>>> facesContext.addMessage("username", message); > > >>>>>> > > >>>>>> username =3D ""; > > >>>>>> password =3D ""; > > >>>>>> > > >>>>>> return ("error"); > > >>>>>> > > >>>>>> } > > >>>>>> As you can see I sleep the thread to simulate the operations > needed > > to > > >>>>> log > > >>>>>> in the user, for now I'm only getting the token. After that I'll > > fetch > > >>>>> the > > >>>>>> project, data etc... > > >>>>>> > > >>>>>> So I wanted the pollText to apear dynmically in the status > > indicator, > > >>>>> but > > >>>>>> can get it to update,. > > >>>>>> > > >>>>>> Any tips? > > >>>>>> > > >>>>>> cheers, H=E5kon > > >>>>>> > > >>>>>> On 1 March 2011 23:23, Scott O'Bryan wrote= : > > >>>>>> > > >>>>>>> I see no reason why this wouldn't work.. What specifically is > > failing > > >>>>>>> for you and perhaps a code snipi might help me visualize your > > issue. > > >>>>>>> > > >>>>>>> On Mar 1, 2011, at 3:04 PM, "H=E5kon Sagehaug" < > > hakon.sagehaug@uni.no> > > >>>>>>> wrote: > > >>>>>>> > > >>>>>>>> Hi all, > > >>>>>>>> > > >>>>>>>> I've just stared using Trinidad and myFaces, and had a questio= n. > > I'm > > >>>>>>>> implementing a login in page for uses, and wanted to use the > > >>>>>>>> statusIndicator, to give back messages for the user like > > >>>>>>>> > > >>>>>>>> 1. Got user information > > >>>>>>>> 2. Loading datasets > > >>>>>>>> 3. Logged in > > >>>>>>>> > > >>>>>>>> And tried to have a tr:outputText within the statusIndicator. > The > > >>>>>> value > > >>>>>>> for > > >>>>>>>> the outPuttext would be linked to a backing bean, but I was no= t > > very > > >>>>>>>> successful, do you have any other tips? > > >>>>>>>> > > >>>>>>>> I guess one can use the progressIndicator, but I would like te= xt > > to > > >>>>> be > > >>>>>>>> returned not a procentage progress. > > >>>>>>>> > > >>>>>>>> cheers, H=E5kon > > >>>>>>> > > >>>>>> > > >>>>> > > >>> > > > --001517740f90696ab9049d96f788--