Re: h:outputScript is not being loaded when located in ui:include that is initially rendered=false

2012-05-10 Thread Daniel Reznick
Forgot to add that after I click on the show button and the script was
supposed to be loaded , it gets loaded if I click F5 / Ctrl + F5 / or hit
Enter in the URL of the browser...

Thanks again.

On Wed, May 9, 2012 at 6:11 PM, Daniel Reznick vedm...@gmail.com wrote:

 Hi

 I'm trying to load some heavy js file only after a user have clicked on
 button

 so basically when user loads the main page there is a hidden page inside
 ui:include

  h:body
 h:form
 h:commandButton value=ClickMe action=#{myBean.callme()} 
 f:ajax render=includeWrapper/f:ajax
 /h:commandButton
 h:panelGroup id=includeWrapper
 wrapper
 h:panelGroup rendered=#{myBean.show}
 ui:include src=/page2.xhtml/ui:include
 /h:panelGroup
 /h:panelGroup
 /h:form
 /h:body


 that hidden page got h:outputScript that should be rendered when  user
 will click on the commandButton


 page2.xhtml looks like this

 ui:composition xmlns=http://www.w3.org/1999/xhtml; xmlns:ui=
 http://java.sun.com/jsf/facelets;
 xmlns:h=http://java.sun.com/jsf/html; xmlns:f=
 http://java.sun.com/jsf/core;
 xmlns:c=http://java.sun.com/jsp/jstl/core;


 #{myBean.show}
 h:outputScript library=js name=myscript.js
 rendered=#{myBean.show}/
 Ww
 /ui:composition


 and my callme looks like this

 public void callme(){
 show = !show;
 System.out.println(cl me\t+show);
 }

 This works perfectly in my mojarra sandbox , but for some reason it is not
 being loaded in my Myfaces 2.0.11 application I even tried the latest 2.1.8
 snapshot

 Is there any web.xml configuration that I'm missing

 Thanks ahead,


 Daniel.



Re: h:outputScript is not being loaded when located in ui:include that is initially rendered=false

2012-05-10 Thread Werner Punz
Hi, this looks like a bug to me, can you file a bugreport with an 
example on  https://issues.apache.org/jira/browse/MYFACES, so that

the fix will make it into the next release.

Werner


Am 10.05.12 08:05, schrieb Daniel Reznick:

Forgot to add that after I click on the show button and the script was
supposed to be loaded , it gets loaded if I click F5 / Ctrl + F5 / or hit
Enter in the URL of the browser...

Thanks again.

On Wed, May 9, 2012 at 6:11 PM, Daniel Reznickvedm...@gmail.com  wrote:


Hi

I'm trying to load some heavy js file only after a user have clicked on
button

so basically when user loads the main page there is a hidden page inside
ui:include

  h:body
 h:form
 h:commandButton value=ClickMe action=#{myBean.callme()}
 f:ajax render=includeWrapper/f:ajax
 /h:commandButton
 h:panelGroup id=includeWrapper
 wrapper
 h:panelGroup rendered=#{myBean.show}
 ui:include src=/page2.xhtml/ui:include
 /h:panelGroup
 /h:panelGroup
 /h:form
 /h:body


that hidden page goth:outputScript that should be rendered when  user
will click on the commandButton


page2.xhtml looks like this

ui:composition xmlns=http://www.w3.org/1999/xhtml; xmlns:ui=
http://java.sun.com/jsf/facelets;
 xmlns:h=http://java.sun.com/jsf/html; xmlns:f=
http://java.sun.com/jsf/core;
 xmlns:c=http://java.sun.com/jsp/jstl/core;


 #{myBean.show}
 h:outputScript library=js name=myscript.js
rendered=#{myBean.show}/
 Ww
/ui:composition


and my callme looks like this

 public void callme(){
 show = !show;
 System.out.println(cl me\t+show);
 }

This works perfectly in my mojarra sandbox , but for some reason it is not
being loaded in my Myfaces 2.0.11 application I even tried the latest 2.1.8
snapshot

Is there any web.xml configuration that I'm missing

Thanks ahead,


Daniel.








t:inputCalender text box readonly

2012-05-10 Thread supriyab16

In t:inputCalender tag ,which property should i use to disable text box of
this tag.Means user should not allowed to enter any key or should not allow
to edit date.User should select a date from pop-up only.Please suggest any
property.
-- 
View this message in context: 
http://old.nabble.com/%3Ct%3AinputCalender%3E-text-box-readonly-tp33763668p33763668.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.



[CODI] ViewAccessScoped beans without windowId in URL

2012-05-10 Thread Pavel Arnošt

Hi,

I already read documentation in the wiki and several old posts, but I
don't still get it - is it possible to use ViewAccessScoped beans
without windowId in URL? When I disable
WindowContextConfig#isUrlParameterSupported, windowId is gone but AJAX
calls now creates new bean instances on requests. In javadoc, there is
a note about server-side window-handler, how can I use it?

Thanks,
Regards,
Pavel Arnost



Re: [CODI] ViewAccessScoped beans without windowId in URL

2012-05-10 Thread Rafael Pestano
Hi Pavel,

WindowContextConfig#isUrlParameterSupported should be enough, does serverside 
demo  work for you? 

http://people.apache.org/~gpetracek/myfaces/codi/demos/serverside_demo_jsf12.zip


keep in mind that the bean will not survive to a redirect.
I hope it helps. 

Att, 

Rafael M. Pestano

Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
http://code.google.com/p/jsf-conventions-framework/
http://rpestano.wordpress.com
@realpestano 




De: Pavel Arnošt pavel.arn...@loutka.cz
Para: users@myfaces.apache.org 
Enviadas: Quinta-feira, 10 de Maio de 2012 9:41
Assunto: [CODI] ViewAccessScoped beans without windowId in URL

Hi,

I already read documentation in the wiki and several old posts, but I
don't still get it - is it possible to use ViewAccessScoped beans
without windowId in URL? When I disable
WindowContextConfig#isUrlParameterSupported, windowId is gone but AJAX
calls now creates new bean instances on requests. In javadoc, there is
a note about server-side window-handler, how can I use it?

Thanks,
Regards,
Pavel Arnost


Re: [CODI] ViewAccessScoped beans without windowId in URL

2012-05-10 Thread Mark Struberg
Hi folks!

We've done some intense testing and I really suggest to use the windowId url 
parameter and also to use the ClientSideWindowhandler with the windowhandler.js 
and windowhandler.html stuff. If you have customers/users which are used to 
open multiple browser tabs, then this is the only perfectly working solution.

Btw, the windowId in the URL doesn't make any problem because it will get 
checked against the window.name. And if those doesn't fit then we just request 
a new windowId.

LieGrue,
strub



- Original Message -
 From: Rafael Pestano rmpest...@yahoo.com.br
 To: MyFaces Discussion users@myfaces.apache.org; Pavel Arnošt 
 pavel.arn...@loutka.cz
 Cc: 
 Sent: Thursday, May 10, 2012 3:20 PM
 Subject: Re: [CODI] ViewAccessScoped beans without windowId in URL
 
 Hi Pavel,
 
 WindowContextConfig#isUrlParameterSupported should be enough, does serverside 
 demo  work for you? 
 
 http://people.apache.org/~gpetracek/myfaces/codi/demos/serverside_demo_jsf12.zip
 
 
 keep in mind that the bean will not survive to a redirect.
 I hope it helps. 
 
 Att, 
 
 Rafael M. Pestano
 
 Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
 Graduando em Ciência da Computação UFRGS
 http://code.google.com/p/jsf-conventions-framework/
 http://rpestano.wordpress.com
 @realpestano 
 
 
 
 
 De: Pavel Arnošt pavel.arn...@loutka.cz
 Para: users@myfaces.apache.org 
 Enviadas: Quinta-feira, 10 de Maio de 2012 9:41
 Assunto: [CODI] ViewAccessScoped beans without windowId in URL
 
 Hi,
 
 I already read documentation in the wiki and several old posts, but I
 don't still get it - is it possible to use ViewAccessScoped beans
 without windowId in URL? When I disable
 WindowContextConfig#isUrlParameterSupported, windowId is gone but AJAX
 calls now creates new bean instances on requests. In javadoc, there is
 a note about server-side window-handler, how can I use it?
 
 Thanks,
 Regards,
 Pavel Arnost



Re[2]: [CODI] ViewAccessScoped beans without windowId in URL

2012-05-10 Thread Pavel Arnošt

Hi all,

first, I apologize for double post, it looks like that Nabble gateway
does not work very well, it nagged me with could not deliver messages 
and even now your messages are not available at Nabble

(http://old.nabble.com/MyFaces---Users-f181.html).

Thanks for all your replies.

WindowContextConfig#isUrlParameterSupported is really sufficient for
working ViewAccessScope without windowId in URL, I confused creates
new beans with invokes @PostConstruct at every request. And thats
expected, as discussed at
http://stackoverflow.com/questions/2797231/why-does-postconstruct-callback-fire-every-time-even-though-bean-is-viewscoped.

I believe that windowId functionality is great, but on simple public
pages such as Give us feedback or Register with us, windowId
parameter is a little ugly, losing of context with reload is not a
problem here and ViewAccessScope is very handy for AJAX feedback.

Regards,
Pavel

-- Původní zpráva --
Od: Mark Struberg strub...@yahoo.de
Komu: MyFaces Discussion users@myfaces.apache.org
Odesláno: 10.5.2012 16:03:08
Předmět: Re: [CODI] ViewAccessScoped beans without windowId in URL

Hi folks!

We've done some intense testing and I really suggest to use the windowId url 
parameter and also to use the ClientSideWindowhandler with the windowhandler.js 
and windowhandler.html stuff. If you have customers/users which are used to 
open multiple browser tabs, then this is the only perfectly working solution.

Btw, the windowId in the URL doesn't make any problem because it will get 
checked against the window.name. And if those doesn't fit then we just request 
a new windowId.

LieGrue,
strub



- Original Message -



From: Rafael Pestano rmpest...@yahoo.com.br
To: MyFaces Discussion users@myfaces.apache.org; Pavel Arnošt 
pavel.arn...@loutka.cz
Cc:
Sent: Thursday, May 10, 2012 3:20 PM
Subject: Re: [CODI] ViewAccessScoped beans without windowId in URL

Hi Pavel,

WindowContextConfig#isUrlParameterSupported should be enough, does serverside
demo  work for you?

http://people.apache.org/~gpetracek/myfaces/codi/demos/serverside_demo_jsf12.zip


keep in mind that the bean will not survive to a redirect.
I hope it helps.

Att,

Rafael M. Pestano

Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
http://code.google.com/p/jsf-conventions-framework/
http://rpestano.wordpress.com
@realpestano




De: Pavel Arnošt pavel.arn...@loutka.cz
Para: users@myfaces.apache.org
Enviadas: Quinta-feira, 10 de Maio de 2012 9:41
Assunto: [CODI] ViewAccessScoped beans without windowId in URL

Hi,

I already read documentation in the wiki and several old posts, but I
don't still get it - is it possible to use ViewAccessScoped beans
without windowId in URL? When I disable
WindowContextConfig#isUrlParameterSupported, windowId is gone but AJAX
calls now creates new bean instances on requests. In javadoc, there is
a note about server-side window-handler, how can I use it?

Thanks,
Regards,
Pavel Arnost








Re: Switch state saving method per page

2012-05-10 Thread Leonardo Uribe
Hi

In theory there are two modes: client side and server side, but in
theory it is also possible to create modes that combines both
strategies or new ones. For example, just use client side for some
small views and use server side for other ones, or force in some use
cases to use server side state saving.

In the spec there are these classes:

javax.faces.application.StateManager : Encapsulate everything related
to state saving, including apply the state to the component tree or
calculate the state from the tree. Also, it delegates to the
ResponseStateManager the task of store the information necessary to
restore the state into the page (javax.faces.ViewState html hidden
field).

javax.faces.view.StateManagementStrategy : This is the one responsible
to colaborate with the VDL and get the state. This includes details
about Partial State Saving algorithm and it is unique per VDL.

javax.faces.render.ResponseStateManager  : This is the one responsible
to colaborate with the Renderkit implementation to write the state,
encrypt, and decode the state. It deals also with store the state and
later restore the state.

The problem here is the ResponseStateManager in my opinion has too
many responsibilities, so override it means reimplement many stuff
that the implementation should do. StateCache aims to do that,
providing a clean interface with few methods that encapsulates the
operations of store / retrieve the state.

With the current spec you should implement a wrapper for each
RenderKit and override all ResponseStateManager instances (usually
only one HTML_BASIC renderkit), so in this case JSF shows how
extensible is. But to do what you want is necessary to copy some code
from MyFaces internals and that is not the idea.

The problem is according to the method used (client side or server
side) there are some small details that makes too difficult to create
a clean API, so in that sense the spec looks good.

regards,

Leonardo Uribe

2012/5/9 Thomas Andraschko zoi...@googlemail.com:
 Hi Leonardo,

 i already checked this classes and server/client StateCache will be
 switched via isSavingStateInClient().
 So why it is required to make it more pluggable? Sorry but it's really hard
 to understand who and where the state will be written or restored because
 there are many classes for the state saving stuff :/

 Thanks,
 Thomas


 2012/5/9 Leonardo Uribe lu4...@gmail.com

 Hi Thomas

 I think to make it work correctly it is necessary to do some stuff
 inside MyFaces internals. Look these classes:


 http://svn.apache.org/repos/asf/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/StateCache.java


 http://svn.apache.org/repos/asf/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java


 http://svn.apache.org/repos/asf/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ClientSideStateCacheImpl.java

 The intention is make something more pluggable here, so the idea is
 allow override the state saving caching strategy, hiding some other
 details. It is a work in progress, but if you have some ideas help is
 welcome, we can try it and include it directly into myfaces core.

 regards,

 Leonardo Uribe

 2012/5/9 Thomas Andraschko zoi...@googlemail.com:
  I tried it but somehow it does not work and i get an new or empty
 ViewState
  field on postbacks.
  Would be cool if anyone could guide me before i must read and understand
  the complete state saving code :-)
 
  2012/5/9 Thomas Andraschko zoi...@googlemail.com
 
  Hi,
 
  is it possible to switch client/server state saving per page like in
  Trinidad?
  I would create an ViewMetaData annotation with CODI and own StateManager
  which overwrites isSavingStateInClient and reads this MetaData via
  ViewConfigDescriptor and return true/false.
  Is this possible or are the more changes/code required?
 
  Thanks!
  Thomas
 



Re: commandlink not working in panelgrid

2012-05-10 Thread Mike Kienenberger
This is one of the basic concepts that you learn as you work with JSF
-- for a UICommand component to perform its action, it must be
rendered on the initial view, and it must also be rendered on the view
created to process the submit.

So whatever condition you use for rendered must involve objects that
exist longer than request scope.

Also, static class variables are not available for use in the EL
expression.   I believe non-public class instance variables are also
not available, but I think public ones are.   To be on the safe side,
you should provide a bean getter for any variable you want to access
from the EL expression.

So for resources.LOGIN_TYPE_MY_ACCOUNT to work, you would need to
provide a getLOGIN_TYPE_MY_ACCOUNT() { return LOGIN_TYPE_MY_ACCOUNT; }
method on your resources bean.


On Wed, May 9, 2012 at 4:46 PM, Lim Hock-Chai
lim.hock-c...@usamobility.com wrote:
 I should probably clarify by saying, it shows the link but just will not fire 
 the action when click on it.  Another word, the rendered test is successful 
 on panelgrid (hence the link is shown), but the test failed when clicked on 
 the link.  Scratch my head on this for two days.  Learn a new 
 tricks-of-the-trade, priceless...



 -Original Message-
 From: Lim Hock-Chai [mailto:lim.hock-c...@usamobility.com]
 Sent: Wednesday, May 09, 2012 3:36 PM
 To: MyFaces Discussion
 Subject: RE: commandlink not working in panelgrid

 Finally got it to work inside panelgrid.  I don't understand it but it works. 
  Shasi, I think you are right about the problem is caused by rendered 
 attribute being evaluated as false when clicked.  Below is what I did to get 
 it to work.  Hopefully you or someone can explain why.

 The code change that I made to get it to work is on this line only:
 h:panelGrid  rendered=#{not empty sessionScope.MyAccountLoginType and 
 sessionScope.MyAccountLoginType==resources.LOGIN_TYPE_MY_ACCOUNT }

 It works if I change it to this:
 h:panelGrid  rendered=#{ sessionScope.MyAccountLoginType=='MA'}
 Note : value of MA is what I have in my message bundle 
 resources.LOGIN_TYPE_MY_ACCOUNT.  Just to be sure, I did h:outputText 
 value=#{resources.LOGIN_TYPE_MY_ACCOUNT} / and it output value of MA 
 correctly.  Not sure why I can't use it to perform the rendered test.

 I tried below and non of them work.  But I don't know why:
 h:panelGrid  rendered=#{not empty sessionScope.MyAccountLoginType and 
 sessionScope.MyAccountLoginType==resources.LOGIN_TYPE_MY_ACCOUNT }

 h:panelGrid  rendered=#{not empty sessionScope.MyAccountLoginType and 
 sessionScope.MyAccountLoginType=='MA' }

 h:panelGrid  rendered=${not empty sessionScope.MyAccountLoginType and 
 sessionScope.MyAccountLoginType=='MA' }


 -Original Message-
 From: Lim Hock-Chai [mailto:lim.hock-c...@usamobility.com]
 Sent: Wednesday, May 09, 2012 1:52 PM
 To: MyFaces Discussion
 Subject: RE: commandlink not working in panelgrid

 I added an onclick=alert(#{not empty sessionScope.MyAccountLoginType and 
 sessionScope.MyAccountLoginType==resources.LOGIN_TYPE_MY_ACCOUNT }) on the 
 commandlink element and the alert showing value of true when I click on the 
 link.


                h:panelGrid
                                rendered=#{not empty 
 sessionScope.MyAccountLoginType and
                                                                        
 sessionScope.MyAccountLoginType==resources.LOGIN_TYPE_MY_ACCOUNT }
                        h:outputText value= /
                        h:outputText value=|/
                        h:commandLink
                                immediate=true
                                onclick=alert(#{not empty 
 sessionScope.MyAccountLoginType and 
 sessionScope.MyAccountLoginType==resources.LOGIN_TYPE_MY_ACCOUNT })
                                style=CURSOR: pointer
                                
 action=#{commonTaskBean.fromMSAMBackToMyAccount}
                                h:outputText value=My Account/
                        /h:commandLink
                        h:outputText value=|/
                /h:panelGrid

 -Original Message-
 From: Shasi Mitra [mailto:shasimi...@yahoo.com]
 Sent: Wednesday, May 09, 2012 1:36 PM
 To: MyFaces Discussion
 Subject: Re: commandlink not working in panelgrid

 After u click the link also the expression in the rendered attribute is 
 evaluated. That time it should be returning Faldo and hence ur action isn't 
 being fired. If u remove all the rendered attributes or keep ur bean in 
 session scope, it should work. Try printing the expression u gave in the 
 rendered attribute and check.

 Sent from my iPhone

 On May 9, 2012, at 11:59 PM, Lim Hock-Chai lim.hock-c...@usamobility.com 
 wrote:

 I tried both session and request scopes.  Both failed to work.  The thing is 
 that the commandlink is showing on the page, which would mean that the 
 rendered condition in the panelGroup or panelgrid is ok.  It just that when 
 I click on the link that is inside the 

Re: h:outputScript is not being loaded when located in ui:include that is initially rendered=false

2012-05-10 Thread Daniel Reznick
Ok , Thanks

Opened...

https://issues.apache.org/jira/browse/MYFACES-3546



On Thu, May 10, 2012 at 11:15 AM, Werner Punz werner.p...@gmail.com wrote:

 Hi, this looks like a bug to me, can you file a bugreport with an example
 on  
 https://issues.apache.org/**jira/browse/MYFACEShttps://issues.apache.org/jira/browse/MYFACES,
 so that
 the fix will make it into the next release.

 Werner


 Am 10.05.12 08:05, schrieb Daniel Reznick:

  Forgot to add that after I click on the show button and the script was
 supposed to be loaded , it gets loaded if I click F5 / Ctrl + F5 / or hit
 Enter in the URL of the browser...

 Thanks again.

 On Wed, May 9, 2012 at 6:11 PM, Daniel Reznickvedm...@gmail.com  wrote:

  Hi

 I'm trying to load some heavy js file only after a user have clicked on
 button

 so basically when user loads the main page there is a hidden page inside
 ui:include

  h:body
 h:form
 h:commandButton value=ClickMe action=#{myBean.callme()}
 f:ajax render=includeWrapper/f:**ajax
 /h:commandButton
 h:panelGroup id=includeWrapper
 wrapper
 h:panelGroup rendered=#{myBean.show}
 ui:include src=/page2.xhtml/ui:**include
 /h:panelGroup
 /h:panelGroup
 /h:form
 /h:body


 that hidden page goth:outputScript that should be rendered when  user
 will click on the commandButton


 page2.xhtml looks like this

 ui:composition 
 xmlns=http://www.w3.org/1999/**xhtmlhttp://www.w3.org/1999/xhtml
 xmlns:ui=
 http://java.sun.com/jsf/**facelets http://java.sun.com/jsf/facelets
 xmlns:h=http://java.sun.com/**jsf/htmlhttp://java.sun.com/jsf/html
 xmlns:f=
 http://java.sun.com/jsf/core;
 
 xmlns:c=http://java.sun.com/**jsp/jstl/corehttp://java.sun.com/jsp/jstl/core
 


 #{myBean.show}
 h:outputScript library=js name=myscript.js
 rendered=#{myBean.show}/
 Ww
 /ui:composition


 and my callme looks like this

 public void callme(){
 show = !show;
 System.out.println(**cl me\t+show);
 }

 This works perfectly in my mojarra sandbox , but for some reason it is
 not
 being loaded in my Myfaces 2.0.11 application I even tried the latest
 2.1.8
 snapshot

 Is there any web.xml configuration that I'm missing

 Thanks ahead,


 Daniel.