Re: f:convertDateTime Bug?

2007-11-22 Thread Volker Weber
Hi Daniel,

have you seen this links?

http://www.mail-archive.com/users%40myfaces.apache.org/msg21412.html

http://wiki.apache.org/myfaces/FAQ#Date


Regards,
Volker


2007/11/22, SEIDLER DANIEL [EMAIL PROTECTED]:
 HI,

 im using this tag this way:
 h:outputText value=#{date.start}
  f:convertDateTime pattern=MMM  /
 /h:outputText

 So my date.start is in Database saved as September 2007, but outputText show
 me August 2007. If I convert days also, it will decrease my days by 1 and
 not the month.

 Im using MyFaces 1.1.5 with Tomahawk 1.1.5 and Facelets 1.1.11


 Thx. i. A.

 Daniel


Re: DataTable + Check Buttons

2007-11-22 Thread Gerhard Petracek
hello daniel,

i read, that you are using tomahawk and that you found a solution for your
problem.

however, i would like to give you or maybe some others a useful hint:

if you decide to use myfaces-trinidad there is a nice way to solve your
problem without affecting your data.
the trinidad table supports single and multiple row selection (and a lot of
other features):

you will find a selection-demo at:
http://www.irian.at/trinidad-demo/faces/components/table_selection.jspx
(on top of the page you can switch between single and multiple selection.)

regards,
gerhard



2007/11/21, daniel ccss [EMAIL PROTECTED]:

 The solution is here:
 http://balusc.blogspot.com/2006/06/using-datatables.html




-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


Re: f:convertDateTime Bug?

2007-11-22 Thread SEIDLER DANIEL

Thanks  for the quick answer and the solution.

Regards, Daniel
Am 22.11.2007 um 09:17 schrieb Volker Weber:


Hi Daniel,

have you seen this links?

http://www.mail-archive.com/users%40myfaces.apache.org/msg21412.html

http://wiki.apache.org/myfaces/FAQ#Date


Regards,
Volker


2007/11/22, SEIDLER DANIEL [EMAIL PROTECTED]:

HI,

im using this tag this way:
h:outputText value=#{date.start}
 f:convertDateTime pattern=MMM  /
/h:outputText

So my date.start is in Database saved as September 2007, but  
outputText show
me August 2007. If I convert days also, it will decrease my days  
by 1 and

not the month.

Im using MyFaces 1.1.5 with Tomahawk 1.1.5 and Facelets 1.1.11


Thx. i. A.

Daniel




How to setup secure Cookies

2007-11-22 Thread josef_a

hi,

i try to setup myfaces to use only secure cookies (cookies wich are only
sent by https).
Does anybody know, how to manage this?

thx
-- 
View this message in context: 
http://www.nabble.com/How-to-setup-secure-Cookies-tf4855658.html#a13894655
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: How to setup secure Cookies

2007-11-22 Thread Simon Kitching
 josef_a [EMAIL PROTECTED] schrieb:
 i try to setup myfaces to use only secure cookies (cookies wich are only
 sent by https).
 Does anybody know, how to manage this?

I've never heard of secure cookies.

Cookies are sent from client to server as part of an http (or https) request. 
Cookies are sent back from server to client embedded in the response. 

So if the webapp is entirely accessed via https, then the cookies will be 
encrypted. If the webapp is accessed via http then they will not.

In any case, this has nothing to do with MyFaces. The only cookie MyFaces ever 
uses is the standard http session cookie, and that's a webapp-level issue 
rather than a JSF library issue. So you need to read about how to configure a 
WEBAPP with https.

Regards,
Simon



Re: DataTable + Check Buttons

2007-11-22 Thread daniel ccss
Exactly Simon I applied the Select multiple rows to solved the issue :-)

Regards

On Nov 21, 2007 4:36 PM, simon [EMAIL PROTECTED] wrote:

 On Wed, 2007-11-21 at 15:16 -0600, daniel ccss wrote:
  The solution is here: 
  http://balusc.blogspot.com/2006/06/using-datatables.html

 Ecch - component bindings. But apart from that, this page looks really
 useful.

 The select multiple rows example looks to me like exactly the right
 solution for this problem: add a boolean selected to the object in the
 list, then define a column containing a checkbox that maps onto it.

 Daniel, thanks for posting the link for the archives. I'm sure this will
 be useful to others.

 Regards,

 Simon




Re: DataTable + Check Buttons

2007-11-22 Thread daniel ccss
Thanks nice example too. I will always askering me which will be the
best solution Tomahawk or Trinidad. We decided Tomahawk, but I want to
see which will be the better in the future.

On Nov 22, 2007 4:28 AM, Gerhard Petracek [EMAIL PROTECTED] wrote:
 hello daniel,

 i read, that you are using tomahawk and that you found a solution for your
 problem.

 however, i would like to give you or maybe some others a useful hint:

 if you decide to use myfaces-trinidad there is a nice way to solve your
 problem without affecting your data.
 the trinidad table supports single and multiple row selection (and a lot of
 other features):

 you will find a selection-demo at:
  http://www.irian.at/trinidad-demo/faces/components/table_selection.jspx
 (on top of the page you can switch between single and multiple selection.)

 regards,
 gerhard



  2007/11/21, daniel ccss [EMAIL PROTECTED]:
  The solution is here:
 http://balusc.blogspot.com/2006/06/using-datatables.html
 



 --

  http://www.irian.at

 Your JSF powerhouse -
 JSF Consulting, Development and
 Courses in English and German

 Professional Support for Apache MyFaces


Re: Session context was RE: Question about FacesContext

2007-11-22 Thread pdt_p

Hi guys...

Thank you for replying my question.

My EJB is connected to a server which running on difference machine. I do
have a listener in my EJB. If something changes in the server that I
connected to, it will inform my EJB straight away. The reason I ask that
question is, I need to update my page for displaying the latest data that
just informed by the server. 
My EJB have a data and EJB is the trigger point when I should update my
page. Normally, the pages will requests the data from EJB. But in my case
now, is the opposite way, the EJB request the page to updating the data.

The reason why i need the facesContext, I need to access my manage bean and
update some data in there. 
In my page, i do have a poll which will run and refresh the page in every
few seconds. Basically, the new data will be display when pollevent is
triggered.

any idea?

Regards,


pdt


NABA wrote:
 
 Hi Neil..
 You wrote:
 
 The question is whether every class should know exactly how they are
 stored. And have to fetch them itself.
 
 
 How can a class fetch them istself to the other classes!
 Or is there an other method to get the objects.
 I m using now:
 
 session.getAttribute(isBlueMonday);
 
 However, this is a very good idea/approach to centrelize the access to 
 the session to get objects!
 naba
 
 Neil Pitman schrieb:
 Hi Naba,

 The Session object and JSF are both part of the web layer.  For all
 intents and purposes they are tightly bound together in webapps.  I
 think that both should be unknown to EJBs or other model/data layers.
 The boundary between webapps and appservers should allow simple domain
 objects, but no technology decisions on either side; it becomes a real
 pain when you want to change a web technology, but the server has become
 dependent on it.

 My comment regarding HTTPSessions was more a question of clutter.
 Obviously you need essential objects, like user key, and objects related
 to the interaction or user preferences, since they are costly to obtain,
 and should be near at hand for every subsequent request.

 The question is whether every class should know exactly how they are
 stored. And have to fetch them itself.

 I would prefer a SessionWrapper class that has specific get/set methods
 with strong typing rather than a free-for-all of hardcoded session
 queries like: session.getAttribute(isBlueMonday);

 The session object tends to get bloated, because everyone puts in, but
 no one dares clean it.  You need to pass the session around in every
 call; it would be better to use a managed bean or a spring bean.  This
 bean can certainly use the session for holding data.  But, it is the
 only one holding the keys, literally.  Other classes do not need to find
 the key or make sure that it's correctly initialized, or decide whether
 the whole object is stored or just the keys.  And best of all, if some
 session attribute is getting corrupted, you can breakpoint the
 SessionWrapper access to it.

 Right now, I have a reasonably complex JSF system.  I only keep the some
 keys related to the principle there.  Again, for performance and
 clustering reasons, an essential (only the essential) session object is
 much better.  (let's not even talk about programmer sanity!)

 Neil

 -Original Message-
 From: NABA [mailto:[EMAIL PROTECTED] 
 Sent: November 21, 2007 3:18 AM
 To: MyFaces Discussion
 Subject: Re: Question about FacesContext

 Hi Neil!!
 Is it a bad thing too, to access the session in JSF??
 I do it all the time to get some beans from the session!!
 Or do you answerd only the question from pdt! the access to a session 
 from the ejb?

 naba




 Neil Pitman schrieb:
   
 Hi Pdt,

 Whoa! That does not sound like a very good thing.  JSF is definitely a
 web-layer/presentation thing.  While it might work in JBoss, accessing
 the HTTP Sessions or HTTP Requests or JSF objects are a really bad
 
 idea.
   
 Here is a short and incomplete list of bad things that could happen:

 1) Web objects are not necessarily serializable, and if they are, then
 modifications made in an EJB may be lost if the serialization is one
 
 way
   
 2) Even if it works, these are big objects with complex graphs of
 subobjects or sister objects, the performance hit could be large

 3) JBoss is outside the EJB spec when it allows collocated web apps
 
 and
   
 enterprise apps to see each others' class loader.  Migration to other
 app servers will be problematic

 4) The dependencies become nightmarish

 5) The appserver now depends on the JSF (again, an inversion of
 dependencies) so that a webservice might need to simulate JSF

 6) kiss goodbye to any hope of decoupling the webserver from the
 appserver for performance reasons.

 If there is data that you need from the context, like domain keys,
 
 then
   
 these should be passed in explicitly as parameters to the session
 
 beans.
   
 These can be fundamental types like Strings, or your own value
 
 objects.
   
 I have spent the last 

binding property in my custom tag is not working

2007-11-22 Thread Rajeshekar S
Hi ,
I want to create a custom tag with binding attribute.In the
customTagClass i put  property binding .
The Tag class is:
public class CustomPanelGridTag extends HtmlPanelGridTag{
private String paginator;
private String binding;


  public void setBinding(String binding) {
   this.binding = binding;
  }

  public void setPaginator(String paginator) {
   this.paginator = paginator;
  }

 public String getComponentType() {
 return CustomPanelGrid.COMPONENT_TYPE;
 }

public String getRendererType()
{
return javax.faces.Grid;
}
 protected void setProperties(UIComponent component) {
 super.setProperties(component);
  setString(component,paginator,paginator);
// I tried by putting setString(component,binding,binding)

 }

 public void release() {
 super.release();
 }

 public void setString(UIComponent component, String attributeName,
 String attributeValue) {
 if (attributeValue == null) {

 return;
 }

 if (isValueReference(attributeValue)) {
  System.out.println(attributeName+attributeValue);

setValueBinding(component, attributeName, attributeValue);
 } else {
   System.out.println(attributeNameattr+attributeValue);

 component.getAttributes().put(attributeName,
attributeValue);
 }
 }
 /**
  * sets the value binding of an atttibute
  * @param component
  * @param attributeName
  * @param attributeValue
  */
 public void setValueBinding(UIComponent component, String
attributeName,
 String attributeValue) {

 FacesContext context = FacesContext.getCurrentInstance();
 Application app = context.getApplication();
 ValueBinding vb = app.createValueBinding(attributeValue);
 component.setValueBinding(attributeName, vb);

 }


}


Component binding is not working with this binding property.

I even tried putting
try {
super.setBinding(binding);
   } catch (JspException e) {
// TODO Auto-generated catch block
e.printStackTrace();
   }

in set Properties method of this tag,then also component instance binding is
not done.
Please let me help in knowing what to do if we want to have a binding
property in the custom tag.It will be great help if any body tell how the
binding propery  works done in JSF.To my knowledge , _jspService  method
calls the UIComponentTag.setBinding... and after that
UIComponentTag.createComponentInstance is called to create the component
with the instance given by  binding property.

Thanks,
Rajeshekar