RE: different sessions within same brower using tabs...

2007-05-08 Thread Jorge Vásquez
Yes but some of us unfortunately aren’t using SEAM as framework…

JV

 

  _  

De: Adrian Mitev [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 08 de mayo de 2007 18:21
Para: MyFaces Discussion
Asunto: Re: different sessions within same brower using tabs...

 

jboss seam solves that problem.

2007/5/9, Jorge Vásquez <[EMAIL PROTECTED]>:

Thanks Simon,
Good beginning, but how can I force the creation of a new session upon some
received action.  Should this handling be some API offered by MyFaces or
shall it be responsibility of the container, nevertheless solutions bound to

a container aren't the ideal...

Regards,
JV

-Mensaje original-
De: Simon Kitching [mailto:[EMAIL PROTECTED]
Enviado el: martes, 08 de mayo de 2007 17:01 
Para: MyFaces Discussion
Asunto: Re: different sessions within same brower using tabs...

Jorge Vásquez wrote:
> Regards to all,
>
> How can I force the creation of a new session when the user tries to 
> access the same application within a tabbing-enabled browser like
> Firefox but logging with a different username.

This recent thread discusses the same issue:

http://www.nabble.com/force-to-start-a-new-servlet-session-tf3656420.html#a1
0245381



 



RE: different sessions within same brower using tabs...

2007-05-08 Thread Jorge Vásquez
Thanks Simon, 
Good beginning, but how can I force the creation of a new session upon some
received action.  Should this handling be some API offered by MyFaces or
shall it be responsibility of the container, nevertheless solutions bound to
a container aren't the ideal...

Regards,
JV

-Mensaje original-
De: Simon Kitching [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 08 de mayo de 2007 17:01
Para: MyFaces Discussion
Asunto: Re: different sessions within same brower using tabs...

Jorge Vásquez wrote:
> Regards to all,
> 
> How can I force the creation of a new session when the user tries to 
> access the same application within a tabbing-enabled browser like 
> Firefox but logging with a different username.  

This recent thread discusses the same issue:
 
http://www.nabble.com/force-to-start-a-new-servlet-session-tf3656420.html#a1
0245381




different sessions within same brower using tabs...

2007-05-08 Thread Jorge Vásquez
Regards to all,

How can I force the creation of a new session when the user tries to access
the same application within a tabbing-enabled browser like Firefox but
logging with a different username.  

 

Thanks,

JV



RE: double click issue in Firefox...

2007-05-06 Thread Jorge Vásquez
Thanks Adrian.  

Do I need to change the web.xml or add some specific taglib.xml
configuration file in order to use this component.  Sorry for asking more
questions but I really haven’t seen any link on the web detailing
installation of shale under a myfaces project.

 

Regards,

JV

 

  _  

De: Adrian Mitev [mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 04 de mayo de 2007 19:34
Para: MyFaces Discussion
Asunto: Re: double click issue in Firefox...

 

1. Shale project has the idea to separate the different modules in the
different jar. So what you have to do is to download shale-core only and put
it in the web-inf\lib directory. For more info about the component see the
wiki [1] 

2. The solution will work on facelets too. And there are no performance
issue with that, but you should beware if you use ajax requests.

[1] http://wiki.apache.org/shale/Token 

2007/5/4, Jorge Vásquez <[EMAIL PROTECTED]>:

Thanks Adrian,

 

For option 1 I have the following doubt:

1.  What exactly are my requirements in order to use the s:token
component from shale, is there some documentation on this integration?  I
just want that component and nothing more from shale, is there like a
reduced library and simplified integration mechanism…I'd really like to
reduce my dependencies with other frameworks as much as possible.

For option 2 I have the following doubts:

1.  Does this solution that you posted work with Facelets too?
2.  Would there be some considerable performance issues on implementing
this approach?  I see that it affects all forms rendered on the application…

 

Regards and thanks again,

JV

 

  _  

De: Adrian Mitev [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 03 de mayo de 2007 16:13
Para: MyFaces Discussion
Asunto: Re: double click issue in Firefox...

 

To prevent the double submit you could use a server side solution like the
token synchronizer pattern implemented as a shale component called s:token
from shale-core lib that you can get from here [1] or to implement it
yourself [2] 

[1] http://shale.apache.org/
[2] http://jroller.com/page/mert?entry=jsf_preventing_double_form_submit 

2007/5/3, Jorge Vásquez <[EMAIL PROTECTED] >:

Regards to all,

During some testing I found that some unpredictable errors occur with
Firefox whenever a user clicks twice rapidly either on a commandLink or on a
commandButton.  What happens is that the respective method modifies some
internal state the first time but then when it gets executed again it founds
inconsistencies that cause an exception to be thrown.  Adding exception
controls to each method for this very specific scenario would result
terribly cumbersome, so I am writing to see if somebody out there has had a
similar problem and how have you managed to solve it.  I played the other
day for a while with JavaScript events but unfortunately those double click
events are uncontrollable when there's also the presence of onclick events,
since most of the time double clicks are also interpreted as simple clicks
and that turns out to be a huge chaos.  

I also tested this behaviour in IE7 (for which I must say that at last
Microsoft launched a descent browser) and there's no problem.  Apparently
this browser blocks double clicks.

Thanks in advance to anybody that could give me some advice…

JV

 

 

 



RE: double click issue in Firefox...

2007-05-04 Thread Jorge Vásquez
Thanks Adrian,

 

For option 1 I have the following doubt:

1.  What exactly are my requirements in order to use the s:token
component from shale, is there some documentation on this integration?  I
just want that component and nothing more from shale, is there like a
reduced library and simplified integration mechanism…I’d really like to
reduce my dependencies with other frameworks as much as possible.

For option 2 I have the following doubts:

1.  Does this solution that you posted work with Facelets too?
2.  Would there be some considerable performance issues on implementing
this approach?  I see that it affects all forms rendered on the application…

 

Regards and thanks again,

JV

 

  _  

De: Adrian Mitev [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 03 de mayo de 2007 16:13
Para: MyFaces Discussion
Asunto: Re: double click issue in Firefox...

 

To prevent the double submit you could use a server side solution like the
token synchronizer pattern implemented as a shale component called s:token
from shale-core lib that you can get from here [1] or to implement it
yourself [2] 

[1] http://shale.apache.org/
[2] http://jroller.com/page/mert?entry=jsf_preventing_double_form_submit 

2007/5/3, Jorge Vásquez <[EMAIL PROTECTED]>:

Regards to all,

During some testing I found that some unpredictable errors occur with
Firefox whenever a user clicks twice rapidly either on a commandLink or on a
commandButton.  What happens is that the respective method modifies some
internal state the first time but then when it gets executed again it founds
inconsistencies that cause an exception to be thrown.  Adding exception
controls to each method for this very specific scenario would result
terribly cumbersome, so I am writing to see if somebody out there has had a
similar problem and how have you managed to solve it.  I played the other
day for a while with JavaScript events but unfortunately those double click
events are uncontrollable when there's also the presence of onclick events,
since most of the time double clicks are also interpreted as simple clicks
and that turns out to be a huge chaos.  

I also tested this behaviour in IE7 (for which I must say that at last
Microsoft launched a descent browser) and there's no problem.  Apparently
this browser blocks double clicks.

Thanks in advance to anybody that could give me some advice…

JV

 

 



double click issue in Firefox...

2007-05-03 Thread Jorge Vásquez
Regards to all,

During some testing I found that some unpredictable errors occur with
Firefox whenever a user clicks twice rapidly either on a commandLink or on a
commandButton.  What happens is that the respective method modifies some
internal state the first time but then when it gets executed again it founds
inconsistencies that cause an exception to be thrown.  Adding exception
controls to each method for this very specific scenario would result
terribly cumbersome, so I am writing to see if somebody out there has had a
similar problem and how have you managed to solve it.  I played the other
day for a while with JavaScript events but unfortunately those double click
events are uncontrollable when there’s also the presence of onclick events,
since most of the time double clicks are also interpreted as simple clicks
and that turns out to be a huge chaos.  

I also tested this behaviour in IE7 (for which I must say that at last
Microsoft launched a descent browser) and there’s no problem.  Apparently
this browser blocks double clicks.

Thanks in advance to anybody that could give me some advice…

JV

 



unable to turn off log messages...

2007-04-30 Thread Jorge Vásquez
Regards,

I am having some problems with log messages in myfaces that I don’t know how
to stop making them appear.  I use log4J to control my log messages and even
when I configure it to stop getting all logger output messages I keep
getting the following:

 

ADVERTENCIA: /pages/logon.xhtml @105,53 forceId="true" Property 'forceId' is
not on type: org.apache.myfaces.component.html.ext.HtmlInputText

29-abr-2007 17:26:19 com.sun.facelets.tag.jsf.ComponentRule warnAttr

ADVERTENCIA: /pages/logon.xhtml @132,60 forceId="true" Property 'forceId' is
not on type: org.apache.myfaces.component.html.ext.HtmlInputText

29-abr-2007 17:26:19 com.sun.facelets.tag.jsf.ComponentRule warnAttr

ADVERTENCIA: /pages/logon.xhtml @144,57 forceId="true" Property 'forceId' is
not on type: org.apache.myfaces.component.html.ext.HtmlInputText

29-abr-2007 17:26:42 com.sun.facelets.tag.jsf.ComponentRule warnAttr

ADVERTENCIA: /pages/templates/searchFieldsTemplate.xhtml @132,120
forceId="true" Property 'forceId' is not on type:
org.apache.myfaces.component.html.ext.HtmlCommandLink

 

 

Does anybody has any advice to stop getting these logger messages which are
also unnecessary since I am using the tomahawk input text which has a
forceId attribute?  

 

Thanks,

JV  

 



howto stop getting message log: No Renderer found for component

2007-04-11 Thread Jorge Vásquez
Regards,

I am fine-tuning my JSF application and although it is working fine I keep
getting a log message in tomcat for a component that I Developed.

My component works fine, it is simply an alternative internationalization
tag.  

I created this component tag with the respective component handler and tag
handler.  I also registered the component in faces_config.xml with:

 

  

alerotech.InternationalLabel



 
com.alerotech.client.uicomponents.InternationalizerComponent



  

 

Nevertheless, I keep getting the same log message that is driving me nuts:

 

2007-04-11 11:19:09 StandardContext[/clientJSF]No Renderer found for
component {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId:
/pages/logon.xhtml][Class: javax.faces.component.html.HtmlForm,Id:
logonForm][Class:
com.alerotech.client.uicomponents.InternationalizerComponent,Id: _id27]}
(component-family=alerotech.InternationalLabel,
renderer-type=com.alerotech.client.InternationalLabel)

 

As you may imagine I use this tag almost thousands of times in my
application so you may get an idea of how many messages I have in the
logger.  

Any idea on what I am missing?

 

By the way I am using Facelets, in case it helps.

 

Thanks in advance,

JV

 



Confused with session issues...

2007-02-26 Thread Jorge Vásquez
Regards to all,

I’ve been working on an application with JSF for 6 months and we are
reaching the point when we need to do some optimization as there are lots of
objects in session scope and this has got us quite concerned.  I have been
going over the list’s past conversations regarding this subject but I
continue with 2 mayor questions:

1.  Is there any way to get an accurate estimation of the session size
without using serialization?

2.  Excessive Session use is discouraged, however components such as the
tree and results tables only work properly when backed up by session scoped
beans, I see some contradiction here and the savestate solution doesn’t work
for me as my application has multiple navigation paths between pages (no
real rules of the type origin -->destination can be applied)

 

Thanks,

JV

 

 



issue with component ids

2007-02-09 Thread Jorge Vásquez
Regards to all,

I haven’t been able to establish different id’s for a HTMLCommandLink
components inside a list.

I have tried the following 2 scenarios with the respective result:

 

1. 

   

 

   

   

   

 



 

RESULT:  I get the exception:  java.lang.IllegalArgumentException: component
identifier must not be a zero-length String
at
javax.faces.component.UIComponentBase.isIdValid(UIComponentBase.java:1034)
at
javax.faces.component.UIComponentBase.setId(UIComponentBase.java:274)

………etc…..

 




 

 

2. 

   

 

   

   

   

 



 

RESULT:  All the rendered anchor () elements in html end up having the
same id:  trialId

 




 

I need to be able to have each commandLink rendered with a specific Id as in
specific situations I reference certain commands through javascript
code…making use of their ids.

 

Any idea on how can I accomplish this?

 

Thanks and regards,

JV

 



Tree2 lazy loading + expand path issues...

2007-02-02 Thread Jorge Vásquez
Regards to all,

I am working on a view which uses the same user interaction rules as Windows
Explorer.  The idea is that I have a tree on the left and a detail for that
tree on the right.  Both views need to maintain synchronized and as in
Windows explorer there’s the possibility of navigating into a folder both
from the tree panel or from the details panel.  So far I can handle very
good the scenarios whenever the user is navigating from the tree (this means
I can handle the detail view updates satisfactorily according to the node
clicked on the tree).  My problem is trying to update the tree view (go to a
specific node) whenever the user clicks on a folder item in the details
view.  My issue here is that I am using the lazy loading scheme described in
the wiki (Alternative Tree2 Lazy Loading Method...by jtmille3) and whenever
I send the path to expand to it doesn’t expands in the tree view.  I tried
the same scenario in a view that doesn’t use lazy loading and it works
perfectly, therefore my question is if someone can orient me on what would
be the right approach to allow tree node expansion but using lazy loading.
(There’s also one obvious point to note:  the node expansion as maximum
happens one level at a time and up/down the current selected node, ‘cause
otherwise I accept that it would be totally impossible).  

 

This is my code fragment for the prototype action that I am using:

 

public String expandNode() {

//Add the children under the node to expand first

TreeNode treeNode = _treeModel.getNodeById("0:0");

//Add the respective children in order to allow
expansion

AuthenticationBean authenticationBean =
(AuthenticationBean) FacesUtils

 
.getManagedBean("authenticationBean");

MessagesBean messagesBean = (MessagesBean)
FacesUtils.getManagedBean("messagesBean");

TreeNodeLazyLoading node000 = new
TreeNodeLazyLoading("actionNode", "0:0:0", "", "0:0:0", true, messagesBean

   .getLocalizedMessage("tree",
"workspaceOpenedIMG", authenticationBean

 
.getLanguageId()), messagesBean.getLocalizedMessage("tree",

   "workspaceClosedIMG",
authenticationBean.getLanguageId()));

TreeNodeLazyLoading node001 = new
TreeNodeLazyLoading("actionNode", "0:0:1", "", "0:0:1", true, messagesBean

   .getLocalizedMessage("tree",
"workspaceOpenedIMG", authenticationBean

 
.getLanguageId()), messagesBean.getLocalizedMessage("tree",

   "workspaceClosedIMG",
authenticationBean.getLanguageId()));   

treeNode.getChildren().add(node000);

treeNode.getChildren().add(node001);

String[] expandedPath = {"0", "0:0"};

_treeModel.getTreeState().expandPath(expandedPath);

return Constants.SUCCESS;

}   

 

Note:  The Action method “expandNode” above is attempting a hard-coded
expansion of the first child node and before invoking the node to expand it
adds two leaf nodes under the node to expand to assure that all its
descendants are already in the model.

 

If anybody can help me explain why the node isn’t expanding and guide me to
a possible implementation that enables the combination of lazy-loading with
one-level at a time node expansion-collapse similar to the way Windows
explorer operates I would deeply appreciate him/her…

 

Thanks,

Jorge Vasquez



RE: Tree2 parent node expand actions...

2007-01-15 Thread Jorge Vásquez
Thanks a lot Andrew.  One last question, the only alternative to getting the
nodeId is using binding or you know any other.  I am currently using too
much binding in my application and I am concerned whether this can cause
serious memory issues in some cases, for instance my tree is in session
scope so probably it wouldn’t be too ideal to include a binding in it, or
what do you think in relation to this subject?

Regards,

JV

 

  _  

De: Andrew Robinson [mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 12 de enero de 2007 18:06
Para: MyFaces Discussion
Asunto: Re: Tree2 parent node expand actions...

 

Node ID isn't on the treeModelBase it is on UITreeData

On 1/12/07, Jorge Vásquez <[EMAIL PROTECTED]> wrote: 

Thanks Andrew but it isn't working.

I am getting the exception:

 

javax.faces.el.PropertyNotFoundException: Bean:
org.apache.myfaces.custom.tree2.TreeModelBase, property: nodeId
at
org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyRes
olverImpl.java:483)
at
org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyRes
olverImpl.java:454)
at
org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.
java:417)
 
at
org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.jav
a:82)
 
at
org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelpe
r.java:532)
 
at
org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
at org.apache.myfaces.el.ValueBindingImpl.getValue
(ValueBindingImpl.java:383)
at
org.apache.myfaces.custom.updateactionlistener.UpdateActionListener.getValue
(UpdateActionListener.java:95)
at
org.apache.myfaces.custom.updateactionlistener.UpdateActionListener.processA
ction
(UpdateActionListener.java:129)
at
javax.faces.event.ActionEvent.processListener(ActionEvent.java:48)
at
javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:484)
at javax.faces.component.UICommand.broadcast(UICommand.java:75)
 
at
org.apache.myfaces.custom.tree2.UITreeData.broadcast(UITreeData.java:143)
 
at
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)

 

Any idea on how can I obtain the nodeId?

 

Regards and thanks a lot,

JV

 

  _  

De: Andrew Robinson [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 11 de enero de 2007 15:08
Para: MyFaces Discussion
Asunto: Re: Tree2 parent node expand actions...

 

Change the node contents to a commandLink with an updateActionListener and
in the "actionListener" method, toggle the expanded state of the node in the
tree state. Something like:









public class Bean {
  private UITreeData tree;
  private String activeNodePath;
  private TreeModel treeModel; 
  public UITreeData getTree() { return this.tree; }
  public void setTree(UITreeData tree) { this.tree = tree; }
  public TreeModel getTreeModel() { return this.treeModel; }
  public String getActiveNodePath() { return this.activeNodePath; }
  public void setActiveNodePath(String activeNodePath) { this.activeNodePath
= activeNodePath; }
  public void toggleNodeExpansion(ActionEvent evt) {
if (activeNodePath == null) return; 
 
treeModel.getTreeState().toggleExpanded(treeModel.getPathInformation(activeN
odePath));
  }
}

If you can get the node path (ie "0:1:2") without using the getNodeId
property then you can avoid using binding. 

-Andrew

On 1/11/07, Jorge Vásquez <[EMAIL PROTECTED]> wrote:

Regards to all,

First of all happy new year!!!

 

I have been trying to add the option to parent nodes so that  the user can
open each tree branch either by clicking on the "plus" or by clicking on the
name of the node (see image below).

 



 

In this image the node should open both by clicking the "plus" and by
clicking the folder name.  So far in order to open a node the only way is
clicking on the "plus".

 

Is this possible?  Does anybody have some sample code where this works?

 

Thanks in advance,

JV

 

 

<>


RE: Tree2 parent node expand actions...

2007-01-12 Thread Jorge Vásquez
Thanks Andrew but it isn’t working.

I am getting the exception:

 

javax.faces.el.PropertyNotFoundException: Bean:
org.apache.myfaces.custom.tree2.TreeModelBase, property: nodeId
at
org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyRes
olverImpl.java:483)
at
org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyRes
olverImpl.java:454)
at
org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.
java:417)
at
org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.jav
a:82)
at
org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelpe
r.java:532)
at
org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
at
org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:383)
at
org.apache.myfaces.custom.updateactionlistener.UpdateActionListener.getValue
(UpdateActionListener.java:95)
at
org.apache.myfaces.custom.updateactionlistener.UpdateActionListener.processA
ction(UpdateActionListener.java:129)
at
javax.faces.event.ActionEvent.processListener(ActionEvent.java:48)
at
javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:484)
at javax.faces.component.UICommand.broadcast(UICommand.java:75)
at
org.apache.myfaces.custom.tree2.UITreeData.broadcast(UITreeData.java:143)
at
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)

 

Any idea on how can I obtain the nodeId?

 

Regards and thanks a lot,

JV

 

  _  

De: Andrew Robinson [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 11 de enero de 2007 15:08
Para: MyFaces Discussion
Asunto: Re: Tree2 parent node expand actions...

 

Change the node contents to a commandLink with an updateActionListener and
in the "actionListener" method, toggle the expanded state of the node in the
tree state. Something like:









public class Bean {
  private UITreeData tree;
  private String activeNodePath;
  private TreeModel treeModel; 
  public UITreeData getTree() { return this.tree; }
  public void setTree(UITreeData tree) { this.tree = tree; }
  public TreeModel getTreeModel() { return this.treeModel; }
  public String getActiveNodePath() { return this.activeNodePath; }
  public void setActiveNodePath(String activeNodePath) { this.activeNodePath
= activeNodePath; }
  public void toggleNodeExpansion(ActionEvent evt) {
if (activeNodePath == null) return; 
 
treeModel.getTreeState().toggleExpanded(treeModel.getPathInformation(activeN
odePath));
  }
}

If you can get the node path (ie "0:1:2") without using the getNodeId
property then you can avoid using binding. 

-Andrew



On 1/11/07, Jorge Vásquez <[EMAIL PROTECTED]> wrote:

Regards to all,

First of all happy new year!!!

 

I have been trying to add the option to parent nodes so that  the user can
open each tree branch either by clicking on the "plus" or by clicking on the
name of the node (see image below).

 



 

In this image the node should open both by clicking the "plus" and by
clicking the folder name.  So far in order to open a node the only way is
clicking on the "plus".

 

Is this possible?  Does anybody have some sample code where this works?

 

Thanks in advance,

JV

 

<>


Tree2 parent node expand actions...

2007-01-11 Thread Jorge Vásquez
Regards to all,

First of all happy new year!!!

 

I have been trying to add the option to parent nodes so that  the user can
open each tree branch either by clicking on the “plus” or by clicking on the
name of the node (see image below).

 



 

In this image the node should open both by clicking the “plus” and by
clicking the folder name.  So far in order to open a node the only way is
clicking on the “plus”.

 

Is this possible?  Does anybody have some sample code where this works?

 

Thanks in advance,

JV

<>


show image error icon with h:messages component

2006-12-20 Thread Jorge Vásquez
Regards to all,

Is there a way to include an icon within the h:messages component?

 

Thanks,

JV   



Table with grouping levels...

2006-12-14 Thread Jorge Vásquez
Regards to all,

I have a situation in which I need to paint a table that has a rendering
logic –typical of reports- in which there are several grouping levels.  Ex:
1 parent row with several child rows and so on.  I have looked at tree table
component but it doesn’t offer the presentation options that I am looking
for.  In the old application this was built with a couple of while loops
inside a jsp which where mixed with html tags.  How can I build such complex
html tables in jsf?  In my particular case I am using facelets which makes
things more difficult as I cannot use scriptlet.  This is one of those
complex rendering situations where I really miss scriptlet.  Has somebody
been into a similar case?  If so, which components have you used?  How can I
embed iterators into jsf?  

Thanks,

JV



RE: SelectONeMenu valueChangeListener not skipping validation phase...

2006-12-07 Thread Jorge Vásquez
Nop, its not the first page, still, what you say sounds pretty interesting
to have in mind.

Regards and thanks,

JV

 

  _  

De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de David
Chandler
Enviado el: jueves, 07 de diciembre de 2006 12:24
Para: MyFaces Discussion
Asunto: Re: SelectONeMenu valueChangeListener not skipping validation
phase...

 

Is the form on which this is occurring also your welcome file (index.jsf, or
some such thing)? I recently saw this "two clicks required" behavior in that
case. On first access, the URL would be http://myserver/myapp/. On the first
click, it would simply re-render with the complete URL
http://myserver/myapp/index.jsf. The second click then worked. 

When I changed my welcome file to index.html with a redirect to the jsf
page, this problem went away.

/dmc

On 12/7/06, Jorge Vásquez <[EMAIL PROTECTED]  <mailto:[EMAIL PROTECTED]> >
wrote:

In that form where I have the selectoneMenu component, I have to click twice
over the button that does the submit of the form in order to effectively
process the action associated with that button.  The first time nothing
happens and then the action is finally executed.  Don´t know how to explain
this better…Its strange but its happening, if you want some source code I´ll
gladly submit it.  My workaround here has been to do the validation directly
on the action method, it works fine but kind of let me a feeling of
unsatisfaction.

Thanks,

JV

 

 

  _  

De: Cagatay Civici [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 07 de diciembre de 2006 4:53
Para: MyFaces Discussion
Asunto: Re: SelectONeMenu valueChangeListener not skipping validation
phase...

 

Yes renderResponse() should solve the problem, what do you mean by 2 submits
are necessary from an action button. 

On 12/7/06, Jorge Vásquez <[EMAIL PROTECTED]> wrote:

I tried solving it by including
FacesContext.getCurrentInstance().renderResponse() but it introduces a new
problem, since 2 submits are necessary from an action button.

I am starting to think that this is a bug.

Regards,

JV

 

  _  

De: Jorge Vásquez [mailto: [EMAIL PROTECTED] 
Enviado el: miércoles, 06 de diciembre de 2006 19:45
Para: 'MyFaces Discussion'
Asunto: SelectONeMenu valueChangeListener not skipping validation phase...

 

Regards,

I have a selectoneMenu component on my page and I want it to skip validation
phase when it changes, in the past somehow immediate="true" solved this
problem for me but now I have noticed that this ain´t working anymore.  

In my page I have:

< h:selectOneMenu id = "eclass" value = "#{nativeHandler.eclass}" class =
"dropdown" immediate = "true" 

 onchange = "submit()"
valueChangeListener = "#{nativeHandler.eClassSelected}" >

   < f:selectItems value =
"#{nativeHandler.eclassList}" />

 

 

And I have an input which is marked as "required" and whenever I change the
selectOneMenu option it displays the respective validation message for this
component, which I don´t want to happen.

 

Any ideas, is this a known issue, am I missing something?

 

Thanks,

JV

 

 




-- 
David Chandler
Development Coach
learnjsf.com 



RE: SelectONeMenu valueChangeListener not skipping validation phase...

2006-12-07 Thread Jorge Vásquez
In that form where I have the selectoneMenu component, I have to click twice
over the button that does the submit of the form in order to effectively
process the action associated with that button.  The first time nothing
happens and then the action is finally executed.  Don´t know how to explain
this better…Its strange but its happening, if you want some source code I´ll
gladly submit it.  My workaround here has been to do the validation directly
on the action method, it works fine but kind of let me a feeling of
unsatisfaction.

Thanks,

JV

 

 

  _  

De: Cagatay Civici [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 07 de diciembre de 2006 4:53
Para: MyFaces Discussion
Asunto: Re: SelectONeMenu valueChangeListener not skipping validation
phase...

 

Yes renderResponse() should solve the problem, what do you mean by 2 submits
are necessary from an action button. 

On 12/7/06, Jorge Vásquez <[EMAIL PROTECTED]> wrote:

I tried solving it by including
FacesContext.getCurrentInstance().renderResponse() but it introduces a new
problem, since 2 submits are necessary from an action button.

I am starting to think that this is a bug.

Regards,

JV

 

  _  

De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 06 de diciembre de 2006 19:45
Para: 'MyFaces Discussion'
Asunto: SelectONeMenu valueChangeListener not skipping validation phase...

 

Regards,

I have a selectoneMenu component on my page and I want it to skip validation
phase when it changes, in the past somehow immediate="true" solved this
problem for me but now I have noticed that this ain´t working anymore.  

In my page I have:

< h:selectOneMenu id = "eclass" value = "#{nativeHandler.eclass}" class =
"dropdown" immediate = "true" 

 onchange = "submit()"
valueChangeListener = "#{nativeHandler.eClassSelected}" >

   < f:selectItems value =
"#{nativeHandler.eclassList}" />

 

 

And I have an input which is marked as "required" and whenever I change the
selectOneMenu option it displays the respective validation message for this
component, which I don´t want to happen.

 

Any ideas, is this a known issue, am I missing something?

 

Thanks,

JV

 

 



RE: SelectONeMenu valueChangeListener not skipping validation phase...

2006-12-06 Thread Jorge Vásquez
I tried solving it by including
FacesContext.getCurrentInstance().renderResponse() but it introduces a new
problem, since 2 submits are necessary from an action button.

I am starting to think that this is a bug.

Regards,

JV

 

  _  

De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 06 de diciembre de 2006 19:45
Para: 'MyFaces Discussion'
Asunto: SelectONeMenu valueChangeListener not skipping validation phase...

 

Regards,

I have a selectoneMenu component on my page and I want it to skip validation
phase when it changes, in the past somehow immediate=”true” solved this
problem for me but now I have noticed that this ain´t working anymore.  

In my page I have:



   

 

 

And I have an input which is marked as “required” and whenever I change the
selectOneMenu option it displays the respective validation message for this
component, which I don´t want to happen.

 

Any ideas, is this a known issue, am I missing something?

 

Thanks,

JV

 



SelectONeMenu valueChangeListener not skipping validation phase...

2006-12-06 Thread Jorge Vásquez
Regards,

I have a selectoneMenu component on my page and I want it to skip validation
phase when it changes, in the past somehow immediate=”true” solved this
problem for me but now I have noticed that this ain´t working anymore.  

In my page I have:



   

 

 

And I have an input which is marked as “required” and whenever I change the
selectOneMenu option it displays the respective validation message for this
component, which I don´t want to happen.

 

Any ideas, is this a known issue, am I missing something?

 

Thanks,

JV

 



Interest in knowing benefits of myfaces+shale

2006-12-05 Thread Jorge Vásquez
Hello,

I have been reading lately lots of answers that recommend an integration of
faces with shale but I really can´t imagine what specific benefits can this
bring to a project.  Is there some document or reference that anyone knows
that clearly illustrates this benefits, something like what can be done
adding shale that cannot be done with faces alone?

 

Regards,

JV



RE: Error using inputFileUpload component.

2006-12-05 Thread Jorge Vásquez
The cause of the error has nothing to do with the inputFileUpload component,
it is related with the SelectItems Iterator, please help me with this!!!  I
have no idea what is happening, I read that it was probably due to JVM
compatibility issues.  I am using JVM 1.4 and
myfaces-api-1.1.4-SNAPSHOT.jar, myfaces-impl-1.1.4-SNAPSHOT.jar,
tomahawk-1.1.5-SNAPSHOT.jar.

This must be a bug, what is the workaround for it?

Thanks,

JV

 

 

  _  

De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: lunes, 04 de diciembre de 2006 19:42
Para: 'MyFaces Discussion'
Asunto: Error using inputFileUpload component.

 

Regards,

I am getting the following snack trace error with the inputFileUpload
component:  (has anybody had any similar error?) 

 

java.lang.NoSuchMethodError:
java.lang.StringBuffer.insert(ILjava/lang/CharSequence;)Ljava/lang/StringBuf
fer;

  at
javax.faces.component._SelectItemsIterator.getPathToComponent(_SelectItemsIt
erator.java:228)

  at
javax.faces.component._SelectItemsIterator.getPathToComponent(_SelectItemsIt
erator.java:199)

  at
javax.faces.component._SelectItemsIterator.hasNext(_SelectItemsIterator.java
:131)

  at
javax.faces.component._SelectItemsUtil.matchValue(_SelectItemsUtil.java:46)

  at
javax.faces.component.UISelectOne.validateValue(UISelectOne.java:62)

  at javax.faces.component.UIInput.validate(UIInput.java:353)

  at javax.faces.component.UIInput.processValidators(UIInput.java:183)

  at javax.faces.component.UIForm.processValidators(UIForm.java:70)

  at
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java
:624)

  at
javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:146)

  at
org.apache.myfaces.lifecycle.LifecycleImpl.processValidations(LifecycleImpl.
java:262)

  at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)

  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)

  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)

  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)

  at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.
java:144)

  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:186)

  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)

  at
com.alerotech.client.filters.CharsetFilter.doFilter(CharsetFilter.java:25)

  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:186)

  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)

  at
com.alerotech.client.filters.SessionTimeOutFilter.doFilter(SessionTimeOutFil
ter.java:43)

  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:186)

  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)

  at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)

  at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)

  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

  at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:198)

  at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:152)

  at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)

  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

  at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137
)

  at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)

  at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118
)

  at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)

  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

  at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)

  at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)

  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

  at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

  at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

  at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:705)

  at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

Error using inputFileUpload component.

2006-12-04 Thread Jorge Vásquez
Regards,

I am getting the following snack trace error with the inputFileUpload
component:  (has anybody had any similar error?) 

 

java.lang.NoSuchMethodError:
java.lang.StringBuffer.insert(ILjava/lang/CharSequence;)Ljava/lang/StringBuf
fer;

  at
javax.faces.component._SelectItemsIterator.getPathToComponent(_SelectItemsIt
erator.java:228)

  at
javax.faces.component._SelectItemsIterator.getPathToComponent(_SelectItemsIt
erator.java:199)

  at
javax.faces.component._SelectItemsIterator.hasNext(_SelectItemsIterator.java
:131)

  at
javax.faces.component._SelectItemsUtil.matchValue(_SelectItemsUtil.java:46)

  at
javax.faces.component.UISelectOne.validateValue(UISelectOne.java:62)

  at javax.faces.component.UIInput.validate(UIInput.java:353)

  at javax.faces.component.UIInput.processValidators(UIInput.java:183)

  at javax.faces.component.UIForm.processValidators(UIForm.java:70)

  at
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java
:624)

  at
javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:146)

  at
org.apache.myfaces.lifecycle.LifecycleImpl.processValidations(LifecycleImpl.
java:262)

  at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)

  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)

  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)

  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)

  at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.
java:144)

  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:186)

  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)

  at
com.alerotech.client.filters.CharsetFilter.doFilter(CharsetFilter.java:25)

  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:186)

  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)

  at
com.alerotech.client.filters.SessionTimeOutFilter.doFilter(SessionTimeOutFil
ter.java:43)

  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:186)

  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)

  at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)

  at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)

  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

  at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:198)

  at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:152)

  at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)

  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

  at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137
)

  at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)

  at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118
)

  at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)

  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

  at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)

  at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)

  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

  at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

  at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

  at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:705)

  at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

  at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:683)

  at java.lang.Thread.run(Thread.java:534)

 

Thanks,

JV

 



RE: navigation pages history...

2006-11-27 Thread Jorge Vásquez
Sounds fine for me, I did the same thing and worked fine, I adopted the
Standard of naming actions with the same name as pages and this way I can
return directly the viewId to go to a previous page (Again this is possible
as I have no complex navigation cases).

Thanks a lot,

JV

 

  _  

De: Julian Ray [mailto:[EMAIL PROTECTED] 
Enviado el: domingo, 26 de noviembre de 2006 14:57
Para: 'MyFaces Discussion'
Asunto: RE: navigation pages history...

 

JV,

 

Our app keeps a stack of views. The get the previous view pop the stack and
and push the current view on to it before you return,  We also have
standardized our navigation mechanism so that each action returns the name
of the view to navigate to next and our navigation.xml file maps full view
names returned from getViewId() to JSPs. If we have x JSPs there are x
 entities. So for us, returning the view from the top of
the stack will force the navigation handler to navigate to that view. Very
simple and easy to manage. 

 

  _  

From: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Sent: Sunday, November 26, 2006 1:44 PM
To: 'MyFaces Discussion'
Subject: RE: navigation pages history...

Thanks Julian.

I’ve Still got one more question:

1.  I am using facelets and in facelets that method returns the name of
the page, which seems interesting, I need to somehow force a redirect to the
page returned and stored previously.  How can I force a redirect to a
specific page without using the traditional steps of returning an action
String and according to that action String and to the rules defined in
faces_config.xml let the faces Servlet do the forward.  Again, I want to do
an explicit forward from an action method to a specific page, how can I
accomplish this? 

 

Regards,

JV 

 

  _  

De: Julian Ray [mailto:[EMAIL PROTECTED] 
Enviado el: sábado, 25 de noviembre de 2006 5:18
Para: 'MyFaces Discussion'
Asunto: RE: navigation pages history...

 

Its easy to create one. Just use a session scoped bean and add a stack to
it. You can get the last view rendered using the following

 

return FacesContext.getCurrentInstance().getViewRoot().getViewId();

 

 

 

  _  

From: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 24, 2006 9:09 PM
To: 'MyFaces Discussion'
Subject: navigation pages history...

Regards,

Is there a way to see the las accessed page that the user was at.  Moreover,
is there some sort of stack that keeps track of the last accessed pages by a
specific user inside a JSF application?

Thanks,

JV

 



RE: navigation pages history...

2006-11-26 Thread Jorge Vásquez
Gerald, can you be a little more detailed in this explanation please?
I'll begin a scenario to help clear out things.  I have the following rule
in faces_config.xml:



infoSpaceTool

/pages/tools/infospace/mainInfoSpace.xhtml




I have an action method that currently returns "infoSpaceTool" as String and
this causes JSF to load page: /pages/tools/infospace/mainInfoSpace.xhtml.
Now, what would happen when the navigation-case has a redirect element?

Thanks,
JV



-Mensaje original-
De: Gerald Müllan [mailto:[EMAIL PROTECTED] 
Enviado el: domingo, 26 de noviembre de 2006 14:26
Para: MyFaces Discussion
Asunto: Re: navigation pages history...

Hi,

there is the -element in faces-config in order to do such a
forward. You can put it to any navigation rule. Should help in this
case.

cheers,

Gerald

On 11/26/06, Jorge Vásquez <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Thanks Julian.
>
> I've Still got one more question:
>
> I am using facelets and in facelets that method returns the name of the
> page, which seems interesting, I need to somehow force a redirect to the
> page returned and stored previously.  How can I force a redirect to a
> specific page without using the traditional steps of returning an action
> String and according to that action String and to the rules defined in
> faces_config.xml let the faces Servlet do the forward.  Again, I want to
do
> an explicit forward from an action method to a specific page, how can I
> accomplish this?
>
>
>
> Regards,
>
> JV
>
>
>
>  
>
>
> De: Julian Ray [mailto:[EMAIL PROTECTED]
>  Enviado el: sábado, 25 de noviembre de 2006 5:18
>  Para: 'MyFaces Discussion'
>  Asunto: RE: navigation pages history...
>
>
>
>
> Its easy to create one. Just use a session scoped bean and add a stack to
> it. You can get the last view rendered using the following
>
>
>
> return FacesContext.getCurrentInstance().getViewRoot().getViewId();
>
>
>
>
>
>
>  
>
>
> From: Jorge Vásquez [mailto:[EMAIL PROTECTED]
>  Sent: Friday, November 24, 2006 9:09 PM
>  To: 'MyFaces Discussion'
>  Subject: navigation pages history...
>
> Regards,
>
> Is there a way to see the las accessed page that the user was at.
Moreover,
> is there some sort of stack that keeps track of the last accessed pages by
a
> specific user inside a JSF application?
>
> Thanks,
>
> JV
>
>


-- 
http://www.irian.at

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

Professional Support for Apache MyFaces



RE: navigation pages history...

2006-11-26 Thread Jorge Vásquez
Thanks Julian.

I’ve Still got one more question:

1.  I am using facelets and in facelets that method returns the name of
the page, which seems interesting, I need to somehow force a redirect to the
page returned and stored previously.  How can I force a redirect to a
specific page without using the traditional steps of returning an action
String and according to that action String and to the rules defined in
faces_config.xml let the faces Servlet do the forward.  Again, I want to do
an explicit forward from an action method to a specific page, how can I
accomplish this?

 

Regards,

JV 

 

  _  

De: Julian Ray [mailto:[EMAIL PROTECTED] 
Enviado el: sábado, 25 de noviembre de 2006 5:18
Para: 'MyFaces Discussion'
Asunto: RE: navigation pages history...

 

Its easy to create one. Just use a session scoped bean and add a stack to
it. You can get the last view rendered using the following

 

return FacesContext.getCurrentInstance().getViewRoot().getViewId();

 

 

 

  _  

From: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 24, 2006 9:09 PM
To: 'MyFaces Discussion'
Subject: navigation pages history...

Regards,

Is there a way to see the las accessed page that the user was at.  Moreover,
is there some sort of stack that keeps track of the last accessed pages by a
specific user inside a JSF application?

Thanks,

JV

 



navigation pages history...

2006-11-24 Thread Jorge Vásquez
Regards,

Is there a way to see the las accessed page that the user was at.  Moreover,
is there some sort of stack that keeps track of the last accessed pages by a
specific user inside a JSF application?

Thanks,

JV

 



RE: Accessing datascroller paginator variables

2006-11-23 Thread Jorge Vásquez
Hi list I noticed that the error had to do with the fact that the
HtmlDataScroller class was using the same logic for keeping track of the
rowIndex.
This is the implementation of the broadcast method:
   /**
 * Invoke any action listeners attached to this class.
 * 
 * After listener invocation, the associated UIData's properties get
 * updated:
 * 
 * if the user selected an absolute page# then setFirst is called
with
 * uiData.getRows() * pageNumber.
 * if the user selected the "first page" option then setFirst(0) is
called.
 * if the user selected the "previous page" option then setFirst is
decremented
 * by uiData.getRows().
 * if the user selected the "fast rewind" option then setFirst is
decremented
 * by uiData.getRows() * fastStep.
 * next, fast-forward and last options have the obvious effect.
 * 
 */
public void broadcast(FacesEvent event) throws AbortProcessingException
{
super.broadcast(event);

if (event instanceof ScrollerActionEvent)
{
ScrollerActionEvent scrollerEvent = (ScrollerActionEvent) event;

broadcastToActionListener(scrollerEvent);

// huh? getUIData never returns null.
UIData uiData = getUIData();
if (uiData == null)
{
return;
}

int pageindex = scrollerEvent.getPageIndex();
if (pageindex == -1)
{
String facet = scrollerEvent.getScrollerfacet();
if (FACET_FIRST.equals(facet))
{
uiData.setFirst(0);
}
else if (FACET_PREVIOUS.equals(facet))
{
int previous = uiData.getFirst() - uiData.getRows();
if (previous >= 0)
uiData.setFirst(previous);
}
else if (FACET_NEXT.equals(facet))
{
int next = uiData.getFirst() + uiData.getRows();
if (next < uiData.getRowCount())
uiData.setFirst(next);
}
else if (FACET_FAST_FORWARD.equals(facet))
{
int fastStep = getFastStep();
if (fastStep <= 0)
fastStep = 1;
int next = uiData.getFirst() + uiData.getRows() *
fastStep;
int rowcount = uiData.getRowCount();
if (next > rowcount)
next = (rowcount - 1) - ((rowcount - 1) %
uiData.getRows());
uiData.setFirst(next);
}
else if (FACET_FAST_REWIND.equals(facet))
{
int fastStep = getFastStep();
if (fastStep <= 0)
fastStep = 1;
int previous = uiData.getFirst() - uiData.getRows() *
fastStep;
if (previous < 0)
previous = 0;
uiData.setFirst(previous);
}
else if (FACET_LAST.equals(facet))
{
int rowcount = uiData.getRowCount();
int rows = uiData.getRows();
int delta = rowcount % rows;
int first = delta > 0 && delta < rows ? rowcount - delta
: rowcount - rows;
if (first >= 0)
{
uiData.setFirst(first);
}
else
{
uiData.setFirst(0);
}
}
}
else
{
int pageCount = getPageCount();
if (pageindex > pageCount)
{
pageindex = pageCount;
}
else if (pageindex <= 0)
{
pageindex = 1;
}
uiData.setFirst(uiData.getRows() * (pageindex - 1));
}
}
}


So for now what I had to do was change my local implementation of this
component.  Something that works perfect and I guess has no mayor
implications for others is changing the position of the invocation of
method:  broadcastToActionListener(scrollerEvent);  This way if somebody
wants to make use of the ScrollerActionEvent to keep track of the firstRow
Index this method won't overwrite his/her work.  I moved it to the last line
of the:
if (event instanceof ScrollerActionEvent)...code portion and it works
perfect  I think this sounds like a reasonable change to the
dataScroller component.
Regards,
JV

p.d:  As I am not a member of the tomahawk developer crew what should I do
to suggest this change?


-Mensaje original-
De: Jorge Vásquez [mailto:[EMAI

RE: Overwriting tomahawk component...

2006-11-23 Thread Jorge Vásquez
Oops, sorry my error, wrong class name in component-class.

Thanks,

JV

 

  _  

De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 23 de noviembre de 2006 10:52
Para: 'MyFaces Discussion'
Asunto: Overwriting tomahawk component...

 

Regards,

I am requiring to change some behaviour in the datascroller component and I
have decided to overwrite it.  (Of course, I already tried out all the
possibilities it offered and didn´t found what I needed).

I am using facelets so first thing I changed was tomahawk.taglib.xml where I
added the following:

 

  

dataScroller



  

org.apache.myfaces.modified.HtmlDataScroller

  

  

org.apache.myfaces.modified.DataScroller

  



  

 

Next thing I did was I changed faces-config.xml and added the following:

 

  



  javax.faces.Panel

 
org.apache.myfaces.modified.DataScroller

  

 
com.alerotech.client.myfaces.custom.datascroller.ALTHtmlDataScrollerRenderer

  



  

 

  

 
org.apache.myfaces.modified.HtmlDataScroller

 
com.alerotech.client.myfaces.custom.ALTHtmlDataScroller



 

I am getting the following error:

 

javax.faces.FacesException: Undefined component type
org.apache.myfaces.modified.HtmlDataScroller

 

 

I don´t know what I am missing here, I have the respective classes:

com.alerotech.client.myfaces.custom.datascroller.ALTHtmlDataScrollerRenderer

and

com.alerotech.client.myfaces.custom.ALTHtmlDataScroller

 

Is there any known procedure to extend components?  What step am I missing?

Regards,

Jorge Vásquez

 



Overwriting tomahawk component...

2006-11-23 Thread Jorge Vásquez
Regards,

I am requiring to change some behaviour in the datascroller component and I
have decided to overwrite it.  (Of course, I already tried out all the
possibilities it offered and didn´t found what I needed).

I am using facelets so first thing I changed was tomahawk.taglib.xml where I
added the following:

 

  

dataScroller



  

org.apache.myfaces.modified.HtmlDataScroller

  

  

org.apache.myfaces.modified.DataScroller

  



  

 

Next thing I did was I changed faces-config.xml and added the following:

 

  



  javax.faces.Panel

 
org.apache.myfaces.modified.DataScroller

  

 
com.alerotech.client.myfaces.custom.datascroller.ALTHtmlDataScrollerRenderer

  



  

 

  

 
org.apache.myfaces.modified.HtmlDataScroller

 
com.alerotech.client.myfaces.custom.ALTHtmlDataScroller



 

I am getting the following error:

 

javax.faces.FacesException: Undefined component type
org.apache.myfaces.modified.HtmlDataScroller

 

 

I don´t know what I am missing here, I have the respective classes:

com.alerotech.client.myfaces.custom.datascroller.ALTHtmlDataScrollerRenderer

and

com.alerotech.client.myfaces.custom.ALTHtmlDataScroller

 

Is there any known procedure to extend components?  What step am I missing?

Regards,

Jorge Vásquez

 



RE: Accessing datascroller paginator variables

2006-11-22 Thread Jorge Vásquez
Jeff,
During tests I found an issue.  It only happens with the first page and when
the user clicks on the next page.  What happens is that the next page that
appears is page 3 (page 2 is skipped).  

I refined a bit my method letting it as follows: (I assume that the first
row has index 0):  

public void paginatorAction(ActionEvent event) {
ScrollerActionEvent scrollerAction = (ScrollerActionEvent)
event;
String clickedFacet = scrollerAction.getScrollerfacet();
int pageClicked = scrollerAction.getPageIndex();
//Means a facet was clicked
if (clickedFacet != null) {
if (clickedFacet.equals("next")) {
_rowIndex = _rowIndex + _rowsPerPage;
} else if (clickedFacet.equals("previous")) {
_rowIndex = _rowIndex - _rowsPerPage;
} else if (clickedFacet.equals("first")) {
_rowIndex = 0;
} else if (clickedFacet.equals("last")) {
_rowIndex = (_rowData.getRowCount() -
getLastPageRows());
} else if (clickedFacet.equals("fastr")) {
_rowIndex = (_rowIndex -
PAGINATOR_FAST_STEP*_rowsPerPage);
if (_rowIndex < 0) {
_rowIndex = 0;
}
} else if (clickedFacet.equals("fastf")) {
_rowIndex = (_rowIndex +
PAGINATOR_FAST_STEP*_rowsPerPage);
if (_rowIndex > (_rowData.getRowCount() -
getLastPageRows())) {
_rowIndex = (_rowData.getRowCount()
- getLastPageRows());
}
}
} else {
//Means a pageNumber was clicked
_rowIndex = (pageClicked*_rowsPerPage -
_rowsPerPage);
}
}

During debugging I check the value of rowIndex and it corresponds to the
first index of the second page but it skips that page and shows page 3.  Any
idea what is happening here?

Regards,
Jorge Vásquez
  

-Mensaje original-
De: Jeff Bischoff [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 22 de noviembre de 2006 10:22
Para: MyFaces Discussion
Asunto: Re: Accessing datascroller paginator variables

Thanks JV,

If you have time, could you add a section about this approach to that 
wiki page? [1] I think this would be a great addition, as it certainly 
gives people more options.

We will need to come up with some intuitive section headings, separating 
the different approaches for clarity.

I think the most fundamental difference between our solutions is that 
mine revolves around the concept of marking or selecting a row. This 
marking is performed externally to the datascroller: through clicking a 
commandLink or executing some code in an action method. When the  user 
returns from another page, they will be shown the datatable page which 
includes the row they marked. (whether or not it's the last one they 
viewed)

Your solution allows the current dataScroller page to be persisted much 
more directly. When the user returns from another page, they will be 
shown the datatable page which they last viewed.

I think certainly that some users will prefer one solution, while others 
will have a use case that requires the other. Having both on that wiki 
would be great. Of course, we need to format it well and explain it so 
that people know what the differences are.

[1] http://wiki.apache.org/myfaces/ManagingDataScrollerPage

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

Jorge Vásquez wrote:
> Hi Jeff,
> I found another approach to maintain the page the user is at.  I am using
> the actionListener attribute of the dataScroller.
> In my xhtml page I have the following:
> 
> *XHTML CODE PORTION*
>for="resultsData" fastStep="#{searchResultsBean.fastStep}"
>   pageCountVar="pageCount"
> pageIndexVar="pageIndex"
>   styleClass="scroller"
> paginator="true"
paginatorMaxPages="#{searchResultsBean.paginatorMaxPages}"
>   paginatorTableClass="paginator"
>   
> paginatorActiveColumnStyle="font-weight:bold;" 
>   immediate="false" 
>   rowsCountVar="totalRows"
>   
> fir

RE: Accessing datascroller paginator variables

2006-11-22 Thread Jorge Vásquez
Hi Jeff,
I found another approach to maintain the page the user is at.  I am using
the actionListener attribute of the dataScroller.
In my xhtml page I have the following:

*XHTML CODE PORTION*
























 


In the managed bean I have the following relevant code:

**MANAGED BEAN CODE PORTION*
private final static int DEFAULT_ROWS = 2;
private final static int PAGINATOR_MAX_PAGES = 5;
private final static int PAGINATOR_FAST_STEP = 5;
private int rowIndex = 0;
private int rowsPerPage = DEFAULT_ROWS; 

public void paginatorAction(ActionEvent event) {
ScrollerActionEvent scrollerAction = (ScrollerActionEvent)
event;
String clickedFacet = scrollerAction.getScrollerfacet();
int pageClicked = scrollerAction.getPageIndex();
//Means a facet was clicked
if (clickedFacet != null) {
if (clickedFacet.equals("next")) {
rowIndex = rowIndex + rowsPerPage;
} else if (clickedFacet.equals("previous")) {
rowIndex = rowIndex - rowsPerPage;
} else if (clickedFacet.equals("first")) {
rowIndex = 0;
} else if (clickedFacet.equals("last")) {
rowIndex = _rowData.getRowCount() -
rowsPerPage;
} else if (clickedFacet.equals("fastrewind")) {
rowIndex = rowIndex -
PAGINATOR_FAST_STEP*rowsPerPage;
if (rowIndex < 0) {
rowIndex = 0;
}
} else if (clickedFacet.equals("fastforward")) {
rowIndex = rowIndex +
PAGINATOR_FAST_STEP*rowsPerPage;
if (rowIndex >= _rowData.getRowCount()) {
rowIndex = _rowData.getRowCount() -
rowsPerPage;
}
}
} else {
//Means a pageNumber was clicked
rowIndex = pageClicked*rowsPerPage - rowsPerPage;
}
}

public int getRowIndex() {
return rowIndex;
}

public int getRowsPerPage() {
return SearchResultsBean.DEFAULT_ROWS;
}

public boolean isFirstPage() {
return (rowIndex < rowsPerPage);
}

public boolean isLastPage() {
return (rowIndex >=  (_rowData.getRowCount() - rowsPerPage));
}

public int getFastStep() {
return SearchResultsBean.PAGINATOR_FAST_STEP;
}

public int getPaginatorMaxPages() {
return SearchResultsBean.PAGINATOR_MAX_PAGES;
}



The most important method here is:  paginatorAction which captures all
scrollerActionEvents and according to the type of element clicked (either a
facet or a specific page) it displaces the rowIndex variable accordingly.  

Also, I added conditional rendering to the facets based on whether the user
is at the first or last page.  If the user is at the first page there´s no
need to include first, previous and fastrewind facets and if the user is at
the last page there´s no need to include last, next and fastforward facets.

I haven´t included anything yet in the wiki but if you guys think this can
be helpful information to others then let me know and I´ll add it to the
wiki.

Regards,
JV

-Mensaje original-
De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Env

RE: Accessing datascroller paginator variables

2006-11-21 Thread Jorge Vásquez
In simple terms my current need is to be able to keep the paginator state in
order to load the last page that the user was at when the datatable reloads.

Regards,

JV

 

  _  

De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: lunes, 20 de noviembre de 2006 17:40
Para: 'MyFaces Discussion'
Asunto: Accessing datascroller paginator variables

 

Hi list,

I am using dataScroller for paginating a list.  I would like to have access
to the current page in the bean in order to load it whenever a user returns
to a list that was previously loaded.  My scenario is the user is loading a
set of detail pages and when he/she comes back to the list it isn´t loading
the page that he/she was at prior to going to the detail pages.  So I was
thinking if I can keep the current page in the bean but continue using
datascroller since I don´t want to reimplement all the pagination logic that
this component already provides.

 

Thanks,

JV



Accessing datascroller paginator variables

2006-11-21 Thread Jorge Vásquez
Hi list,

I am using dataScroller for paginating a list.  I would like to have access
to the current page in the bean in order to load it whenever a user returns
to a list that was previously loaded.  My scenario is the user is loading a
set of detail pages and when he/she comes back to the list it isn´t loading
the page that he/she was at prior to going to the detail pages.  So I was
thinking if I can keep the current page in the bean but continue using
datascroller since I don´t want to reimplement all the pagination logic that
this component already provides.

 

Thanks,

JV



problem with session beans and request beans inheritance...

2006-11-19 Thread Jorge Vásquez
Hi guys,

In my application I have an inheritance model with managed beans in which
the root bean of the hierarchy is the only one that is in session scope and
all the state is kept in it.  The other beans just implement behaviour
methods and are stateless.   

My base bean is called:  InformationElementRootHandler and I have one class
named NativeHandler which extends from it.  InformationElementRootHandler
has an open method which NativeHandler inherits so when this method is
executed on NativeHandler the one that is executed is the one provided by
InformationElementRootHandler (so far, this is plain old inheritance
theory).  The strange thing that happens is that the open method initializes
some instance members of InformationElementRootHandler but afterwards when
another method of this bean is invoked the surprise is that the instance
members that were previously initialized have all null values, no idea why?


 

I would appreciate any insights to this problem.

Thanks and regards,

JV



RE: Appending dynamic table as column to datatable...

2006-11-09 Thread Jorge Vásquez
Simon,
But still don't you think that it would be nice to include a value attribute
as part of panelGrid and let that value reference a panelGrid instance.  It
can be similar to what  offers as value.  This is
pretty nice in cases where you don't want to maintain updating the model
object as you may do in the case of a binding but you just want to create
the object and associate it to a panelGrid just once...Anyway, my problem
continues,  what I am requiring is to be able to include a "code-generated"
table as a column in a datatable.  This table has to be only a row in size
but with a variable number of columns depending of each row´s specific
conditions.  Some rows may have some consecutive images, or a combination of
images and texts, or commandLinks, etc.  I tried using a binding but all my
rows get the same value which is the same as the first row.  I was thinking
of doing it with datatable but haven't came out with a clean solution since
the column types shouldn't be known at the xhtml page, there should be just
a mapping to a value on the bean and that value brings the whole datatable
object.  I don´t know if this is enough to make my point clear, the
requirement is probably too specialized but that's software
engineering, the technology is the media and the sole ruler is the customer.

Regards and thanks,
JV  

-Mensaje original-
De: Simon Kitching [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 08 de noviembre de 2006 20:57
Para: MyFaces Discussion
Asunto: Re: Appending dynamic table as column to datatable...

Jorge Vásquez wrote:
>
> I have another question, why doesn´t panelGrid have a value 
> attribute?  I think that it would be ideal for these kinds of 
> situations where you want to map many panelgrids to different 
> instances of HTmlPanelGrid, and probably embed them inside another 
> container.
>
>  
>

All "value bindings" on components ("value" is the most common name for 
such an attribute) reference a *model* object, not a component.

In the case of an h:dataTable for example the "value" attribute refers 
to a list of model objects to be rendered within the table, not a list 
of child components of the table.

An h:panelGrid may have child components, but it has no meaningful 
*model* object to refer to, so there is no "value" attribute on that 
component.

Regards,

Simon



RE: Appending dynamic table as column to datatable...

2006-11-08 Thread Jorge Vásquez








Hi again,

 

I can simplify a little
bit my question:  “Has anybody generated a datatable dynamically”,
when I say dynamically I refer to building the whole table from java code in
the following manner:

 

    Application
app = FacesUtils.getFacesContext().getApplication();

    HtmlDataTable
myDataTable = (HtmlDataTable)
app.createComponent(HtmlDataTable.COMPONENT_TYPE);

…..

 

And associating it to a
page:

 

        <h:panelGroup rendered="#{columnHeader.internalTable}">

     <h:dataTable rows="1" value="#{searchResultsBean.columnValue.data}"
>

……..     

h:dataTable>

   
    h:panelGroup>

 

 

Regards,

JV









De: Jorge Vásquez
[mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 08 de
noviembre de 2006 15:48
Para: 'MyFaces
 Discussion'
Asunto: Appending dynamic table as
column to datatable...



 

Hi to all,

I have a special requirement for a data table where
one column can correspond to a series of consecutive html elements that may
vary for each row (It can be thought in html terms as embedding a table for a td).
 I have decided to use a panelgrid for this special requirement but I
cannot use the binding attribute since I get an error during rendering, neither
can I use some value attribute which isn´t supported by panelgrids, etc. 
Has anybody had a similar requirement?  If so, how did you proceeded using
JSF?

 

Regards and thanks,

JV

 

 








Appending dynamic table as column to datatable...

2006-11-08 Thread Jorge Vásquez








Hi to all,

I have a special requirement for a data table where
one column can correspond to a series of consecutive html elements that may
vary for each row (It can be thought in html terms as embedding a table for a
td).  I have decided to use a panelgrid for this special requirement but I
cannot use the binding attribute since I get an error during rendering, neither
can I use some value attribute which isn´t supported by panelgrids, etc.  Has
anybody had a similar requirement?  If so, how did you proceeded using JSF?

 

Regards and thanks,

JV

 

 








RE: Help with datatable sorting...

2006-11-01 Thread Jorge Vásquez
Finally, after 8 hours of fighting with this I found the error, but yet I
haven´t been able to understand what was happening, although everything is
working properly now (Its probably a bug but I'm not sure).

I had the following input hidden elements in the page:


  

(where getText2 is a Facelet function that I use often throughout my
application for accesing some internationalization libraries that we use
with this project)

The goal of both of these hiddens is to interact with some javascript code
that I have to show specific confirm messages prior to delete actions.

This is really strange 'cause what causes the problem is the use of the
function, a:getText2, but the text gets rendered without problem and on the
page I get the respective:





As an experiment I included the inputHidden without a function and it works
perfectly.





IT’S A STRANGE WORLD!

Regards and thanks,
JV


-Mensaje original-
De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 01 de noviembre de 2006 12:29
Para: 'MyFaces Discussion'
Asunto: RE: Help with datatable sorting...

Thanks Simon,
This problem is really driving me crazy, I have compared everything with the
myfaces examples and with what you mention in the link and I am doing what
is suggested.

Here is part of my xhtml code:






















..
  

My Bean is extending from SortableList as the examples do, etc.  The very
strange thing here is that it was working a couple days ago perfectly and I
did a couple of changes and its not working anymore (The worst of all is
that it isn´t under Version Control so I don´t have the previous working
version).  I am comparing one table that works perfectly with this one and I
have found that in the one that works perfect the InvokeApplication phase
always gets executed meanwhile in the one that has problems this phase is
getting skipped.  Also, in the bad one the column name that I get is always
empty ("") meanwhile in the other one it is the respective column name.
Simon, any insights either to the problem or to how to diagnose it better
would be deeply appreciated.

Thanks and Regards,
JV



-Mensaje original-
De: Simon Kitching [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 31 de octubre de 2006 21:59
Para: MyFaces Discussion
Asunto: Re: Help with datatable sorting...

Simon Kitching wrote:
> Hi Jorge,
>
> Jorge Vásquez wrote:
>>
>> Regards to all,
>>
>> One week ago I had my commandSortHeader working perfectly until all 
>> of a sudden it just stopped ordering. I haven´t done any change 
>> neither to the xhtml page nor to the bean, and I am really having a 
>> tough time trying to decipher how is this component´s operation in 
>> order to proceed with some debugging. This whole ordering stuff is 
>> really “sui-generis”, ‘cause it seems to work without the 
>> conventional action paradigm or at least I don’t see nowhere where 
>> the action invocation takes place. My specific problem is that I am 
>> not receiving on the bean the column name clicked by the user. In 
>> summary I have 2 questions that can really help me solve this issue:
>>
>>1. Why can´t the column be arriving at the sort function of the
>>   bean? (This is probably too difficult to answer as it implies
>>   multiple possibilities)
>>2. Can anyone explain me the basic operating mechanism used by the
>>   commandSortHeader component or redirect me to somewhere where it
>>   is explained?
>>
> Are you aware of the myfaces wiki?
> http://wiki.apache.org/myfaces
>
> This page in particular may be useful:
> http://wiki.apache.org/myfaces/Working_with_auto_sortable_tables

Hmm..actually, after reading that Working_with_auto_sortable_tables 
page, I'm not sure that first example is correct. I could be wrong, as 
it's a while since I last wrote a sortable table but I don't remember 
anything that automatally invokes a method with signature
  public String sort(String column)

Here's a link to an earlier email discussion on table sorting that may 
be useful:
  
http://mail-archives.apache.org/mod_mbox/myfaces-users/200601.mbox/%3C001501
[EMAIL PROTECTED]

Regards,

Simon



RE: Help with datatable sorting...

2006-11-01 Thread Jorge Vásquez
Thanks Simon,
This problem is really driving me crazy, I have compared everything with the
myfaces examples and with what you mention in the link and I am doing what
is suggested.

Here is part of my xhtml code:






















..
  

My Bean is extending from SortableList as the examples do, etc.  The very
strange thing here is that it was working a couple days ago perfectly and I
did a couple of changes and its not working anymore (The worst of all is
that it isn´t under Version Control so I don´t have the previous working
version).  I am comparing one table that works perfectly with this one and I
have found that in the one that works perfect the InvokeApplication phase
always gets executed meanwhile in the one that has problems this phase is
getting skipped.  Also, in the bad one the column name that I get is always
empty ("") meanwhile in the other one it is the respective column name.
Simon, any insights either to the problem or to how to diagnose it better
would be deeply appreciated.

Thanks and Regards,
JV



-Mensaje original-
De: Simon Kitching [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 31 de octubre de 2006 21:59
Para: MyFaces Discussion
Asunto: Re: Help with datatable sorting...

Simon Kitching wrote:
> Hi Jorge,
>
> Jorge Vásquez wrote:
>>
>> Regards to all,
>>
>> One week ago I had my commandSortHeader working perfectly until all 
>> of a sudden it just stopped ordering. I haven´t done any change 
>> neither to the xhtml page nor to the bean, and I am really having a 
>> tough time trying to decipher how is this component´s operation in 
>> order to proceed with some debugging. This whole ordering stuff is 
>> really “sui-generis”, ‘cause it seems to work without the 
>> conventional action paradigm or at least I don’t see nowhere where 
>> the action invocation takes place. My specific problem is that I am 
>> not receiving on the bean the column name clicked by the user. In 
>> summary I have 2 questions that can really help me solve this issue:
>>
>>1. Why can´t the column be arriving at the sort function of the
>>   bean? (This is probably too difficult to answer as it implies
>>   multiple possibilities)
>>2. Can anyone explain me the basic operating mechanism used by the
>>   commandSortHeader component or redirect me to somewhere where it
>>   is explained?
>>
> Are you aware of the myfaces wiki?
> http://wiki.apache.org/myfaces
>
> This page in particular may be useful:
> http://wiki.apache.org/myfaces/Working_with_auto_sortable_tables

Hmm..actually, after reading that Working_with_auto_sortable_tables 
page, I'm not sure that first example is correct. I could be wrong, as 
it's a while since I last wrote a sortable table but I don't remember 
anything that automatally invokes a method with signature
  public String sort(String column)

Here's a link to an earlier email discussion on table sorting that may 
be useful:
  
http://mail-archives.apache.org/mod_mbox/myfaces-users/200601.mbox/%3C001501
[EMAIL PROTECTED]

Regards,

Simon



Help with datatable sorting...

2006-10-31 Thread Jorge Vásquez








Regards to all,

One week ago I had my commandSortHeader working
perfectly until all of a sudden it just stopped ordering.  I haven´t done any
change neither to the xhtml page nor to the bean, and I am really having a
tough time trying to decipher how is this component´s operation in order to
proceed with some debugging.  This whole ordering stuff is really “sui-generis”,
‘cause it seems to work without the conventional action paradigm or at
least I don’t see nowhere where the action invocation takes place.  My
specific problem is that I am not receiving on the bean the column name clicked
by the user.  In summary I have 2 questions that can really help me solve this
issue:


 Why can´t the column
 be arriving at the sort function of the bean?  (This is probably too
 difficult to answer as it implies multiple possibilities)
 Can anyone explain
 me the basic operating mechanism used by the commandSortHeader component
 or redirect me to somewhere where it is explained?


 

An answer to any of the 2 questions would be deeply
appreciated.

 

Thanks,

JV








RE: extend HtmlJSCookMenuRenderer...

2006-10-27 Thread Jorge Vásquez








I found my problem, I had
a mess between the binary files and the source files.  Thanks.  

 









De: Jorge Vásquez
[mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 27 de octubre
de 2006 12:12
Para: users@myfaces.apache.org
Asunto: extend
HtmlJSCookMenuRenderer...



 

Regards to all,

I need to overwrite the rendering behaviour of
HtmlJSCookMenuRenderer and after looking at the source code I have a line that
is causing me trouble:  

 

   
FormInfo parentFormInfo = RendererUtils.findNestingForm(component, context);

 

I am kind of lost here ´cause I am getting the error
here that this method isn´t defined by RenderUtils.  (being
org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils).  Therefore I
am totally confused, in the first place how is this working if this method
isn´t defined anywhere?.  I am using tomahawk-1.1.5-SNAPSHOT.jar and I
downloaded the source files for this same distribution and I haven´t found this
method.  

 

Any ideas on what is happening here?

 

Thanks,

JV








extend HtmlJSCookMenuRenderer...

2006-10-27 Thread Jorge Vásquez








Regards to all,

I need to overwrite the rendering behaviour of HtmlJSCookMenuRenderer
and after looking at the source code I have a line that is causing me trouble: 


 

    FormInfo parentFormInfo =
RendererUtils.findNestingForm(component, context);

 

I am kind of lost here ´cause I am getting the error
here that this method isn´t defined by RenderUtils.  (being org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils). 
Therefore I am totally confused, in the first place how is this working if this
method isn´t defined anywhere?.  I am using tomahawk-1.1.5-SNAPSHOT.jar and I
downloaded the source files for this same distribution and I haven´t found this
method.  

 

Any ideas on what is happening here?

 

Thanks,

JV








combining file stream content with html...

2006-10-20 Thread Jorge Vásquez








Regards,

I am currently trying to develop a file viewer for certain
image files.  The idea is to embed html content with the content of the file
that is going to be viewed.  Somehow I have to output first the html part of
the page and then embed the file content to the ServletOutputStream and finally
tell jsf to end its processing.  Any ideas? 

Thanks,

Jorge Vásquez








RE: Low level myFaces component maniulation...

2006-09-30 Thread Jorge Vásquez








Thanks Craig, 

Another question:  After
finding a component how can I erase it from the tree in order to force its “rebinding”
during the RenderResponse phase.  

Regards,

Jorge Vásquez 

 









De:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Craig McClanahan
Enviado el: sábado, 30 de
septiembre de 2006 18:12
Para: MyFaces
 Discussion
Asunto: Re: Low level myFaces
component maniulation...



 

 



On 9/30/06, Jorge
Vásquez <[EMAIL PROTECTED]>
wrote:





Regards,

I have run into a very complex situation due to the fact that I use
dynamic includes in my application.  I need to change the whole component
tree of an include and I have found that the bound components inside an include
are processed in the RenderResponse phase (In case it helps I use myfaces
combined with facelets).  So I have tried all the alternatives that you
can imagine:

1.  I created a listener that generated the components before the
Render Response but unfortunately the generated components weren´t bound to the
included page as the binding process in the included page took place during the
Render Response phase and not before.

2.  I decided to intercept somehow the binding process by
introducing a binding component for each included page that would act as a
trigger to the generation of the other components that were binded, but during
this process I discovered that the getters for a binding are only called once
in the history of that component and not for each cycle, and I was using a
binding getter as trigger.  I know this may sound quite confusing but my
current project´s nature is so complex to transmit these ideas just in one
email.

I think that my new idea is to able to reset some elements of the
component tree related to the included pages to permit the trigger getter to be
invoked always and in this way be able to generate the tree composition for the
included page again.  

 Again, my main issue to simplify more my question is being able to
clear specific parts of a component tree (this demands for me to know where is
this tree kept in order to clear specific elements that I wish).  Can
somebody give  help me with a brief example of jsf component tree
manipulation or at least suggest me which are the classes involved in this
process?








The root of the component tree can be retrieved like this:

    UIViewRoot root = FacesContext.getCurrentInstance
().getViewRoot();

>From there, you can walk the entire tree to find what you need, or perhaps use
the findComponent() method to locate a component based on its identifiers.

Craig

 





 





Thanks a lot for your time,

Jorge Vásquez









 








Low level myFaces component maniulation...

2006-09-30 Thread Jorge Vásquez








Regards,

I have run into a very complex situation due to the
fact that I use dynamic includes in my application.  I need to change the whole
component tree of an include and I have found that the bound components inside
an include are processed in the RenderResponse phase (In case it helps I use
myfaces combined with facelets).  So I have tried all the alternatives that you
can imagine:

1.  I created a listener that generated the
components before the Render Response but unfortunately the generated
components weren´t bound to the included page as the binding process in the
included page took place during the Render Response phase and not before.

2.  I decided to intercept somehow the binding
process by introducing a binding component for each included page that would
act as a trigger to the generation of the other components that were binded,
but during this process I discovered that the getters for a binding are only called
once in the history of that component and not for each cycle, and I was using a
binding getter as trigger.  I know this may sound quite confusing but my
current project´s nature is so complex to transmit these ideas just in one
email.

I think that my new idea is to able to reset some elements
of the component tree related to the included pages to permit the trigger
getter to be invoked always and in this way be able to generate the tree
composition for the included page again.  

 Again, my main issue to simplify more my question is
being able to clear specific parts of a component tree (this demands for me to
know where is this tree kept in order to clear specific elements that I wish).  Can
somebody give  help me with a brief example of jsf component tree manipulation or
at least suggest me which are the classes involved in this process?

 

Thanks a lot for your time,

Jorge Vásquez








RE: Include Directive Execution...

2006-09-28 Thread Jorge Vásquez








One question that just
came out to me thinking of a solution to this problem is if somebody has a code
fragment where a phase Listener is used in order to initialize a bean before
the Restore View Phase begins…or any idea on how to implement this.

Regards,

JV

 









De: Jorge Vásquez
[mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 28 de
septiembre de 2006 16:54
Para: 'MyFaces
 Discussion'
Asunto: Include Directive
Execution...



 

Regards to all,

 

I am using the include directive in xhtml to
dynamically load different pages inside a main page container with the
following syntax:

 



 

The idea is that I have a tree and according to the
node that is selected the page that is include should change (The tree executes
and action that modifies the page attribute in toolTabBean.currentTab).
 My problem is that I would like the page to be included somehow before
the request processing lifecycle begins ´cause I need to get the component
binding to be done with the new included page and not with the actual page.
 

 

I think that an answer to the following questions can
give me a hint as to how to proceed:

 


 In which part of the
 JSF lifecyle is the include directive executed?
 Is there any way to
 anticipate the page inclusion in order to process the bindings related to
 the included page?


 

 

Cheers and thanks for your time,

Jorge Vásquez








Include Directive Execution...

2006-09-28 Thread Jorge Vásquez








Regards to all,

 

I am using the include directive in xhtml to
dynamically load different pages inside a main page container with the
following syntax:

 



 

The idea is that I have a tree and according to the
node that is selected the page that is include should change (The tree executes
and action that modifies the page attribute in toolTabBean.currentTab).  My
problem is that I would like the page to be included somehow before the request
processing lifecycle begins ´cause I need to get the component binding to be
done with the new included page and not with the actual page.  

 

I think that an answer to the following questions can
give me a hint as to how to proceed:

 


 In which part of the
 JSF lifecyle is the include directive executed?
 Is there any way to
 anticipate the page inclusion in order to process the bindings related to
 the included page?


 

 

Cheers and thanks for your time,

Jorge Vásquez








RE: Problems with Calendar popup position.

2006-09-20 Thread Jorge Vásquez








Please somebody help me
with this,

I have detected the
source of the error but its _javascript_-related and to be honest I suck at
_javascript_.

 

The error takes place in
the file:  popupcalendar.js.

 

In the following lines (1324-1383):

 

    try

    {

    do {

    aTag =
aTag.offsetParent;

    leftpos += aTag.offsetLeft;

    toppos += aTag.offsetTop;

    }

    while (aTag.tagName != "BODY");

    }

    catch (ex)

    {

    // ignore

    }

….

 

Somehow the elements that
I have containing the img that activates the popup cause problems and the
offset ends up being greater, causing the popup to appear displaced to the left
and to the bottom.  

Is this a bug?  Has
anyone had a similar problem?  If so how have you solved it?

 

Cheers,

Jorge Vásquez

 

 









De:
Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 19 de septiembre de 2006 19:48
Para: 'MyFaces Discussion'
Asunto: Problems with Calendar
popup position. 



 

Regards to all,

 

The popup calendar that I am using in a form appears
displaced to the right and bottom of the calendar field.  This is
happening both in Firefox and Internet Explorer.  The position of the
popup is apparently always the same ´cause as the calendar field appears lower
in the page the popup begins to disappear.  Any ideas on how to force the
popup to appear underneath the field and in the foreground?

 

Thanks in advance,

JV  








Problems with Calendar popup position.

2006-09-19 Thread Jorge Vásquez








Regards to all,

 

The popup calendar that I am using in a form appears displaced
to the right and bottom of the calendar field.  This is happening both in
Firefox and Internet Explorer.  The position of the popup is apparently always the
same ´cause as the calendar field appears lower in the page the popup begins to
disappear.  Any ideas on how to force the popup to appear underneath the field
and in the foreground?

 

Thanks in advance,

JV  








RE: Using personalized validation messages...

2006-09-13 Thread Jorge Vásquez
Thanks a lot Mike, it worked perfect!!!
Regards,
JV 

-Mensaje original-
De: Mike Kienenberger [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 13 de septiembre de 2006 20:26
Para: MyFaces Discussion
Asunto: Re: Using personalized validation messages...

I added a message attribute to all of the tomahawk validators.



should work.


On 9/13/06, Jorge Vásquez <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Regards to all,
>
> Is there a way to make validators return personalized message Strings that
> are not necessarily found in message Bundles?
>
>
>
> For example, in the following code I would like to be able to specify the
> validator to use any message that I wished:
>
>required="true">
> 
> 
>   styleClass="error" />
>
> But unfortunately, in this case the tag validateRegExpr only has the
pattern
> attribute.
>
> Note:  In the past I have used the method of creating a message String in
a
> messageBundle with the same Id as the one used by the component but in
this
> case we are not using messageBundles as internationalization strategy for
> our project.
>
> Any ideas?
>
> Thanks,
> Jorge Vásquez
>
>
>



Using personalized validation messages...

2006-09-13 Thread Jorge Vásquez








Regards to all,

Is there a way to make validators return personalized
message Strings that are not necessarily found in message Bundles?

 

For example, in the following code I would like to be
able to specify the validator to use any message that I wished:

 

              But unfortunately, in this case the tag validateRegExpr only has the pattern attribute.  Note:  In the past I have used the method of creating a message String in a messageBundle with the same Id as the one used by the component but in this case we are not using messageBundles as internationalization strategy for our project. Any ideas? Thanks,Jorge Vásquez

 








RE: HtmlRadioButton problem...

2006-09-05 Thread Jorge Vásquez








Hi,

Has someone had similar
problems with HtmlSelectOneRadio/HtmlRadio/HtmlRadioRenderer?  Is this a
bug?

Cheers,

JV

 

 









De: Jorge Vásquez
[mailto:[EMAIL PROTECTED] 
Enviado el: lunes, 04 de
septiembre de 2006 12:24
Para: 'MyFaces Discussion'
Asunto: HtmlRadioButton problem...



 

Hi everyone,

I am getting a strange behavior in the
htmlRadioRendering process.  The exception that I am getting is:

java.lang.IndexOutOfBoundsException: index 5 >= 5

  at
org.apache.myfaces.renderkit.html.ext.HtmlRadioRenderer.renderRadio(HtmlRadioRenderer.java:108)

 

After
going over the HtmlRadioRenderer code I have found that the cause of the error
is due to the fact that the index of the HtmlRadioButton element that is being
rendered is greater than the size of the HtmlSelectOneRadio list of elements
that is referenced by the HtmlRadio element.  I am generating the Html
Object model in java code and in the model that I generate the indexes are
always smaller than the size of the SelectOneRadio list of elements.  To
make things worse this error only appears occasionally after regenerating the
Html object model, but I haven´t been able to decipher the pattern that
originates the error since it is very random.  I have the feeling that
somehow the HtmlRadioRenderer occasionally does some cache on the
HtmlSelectOneRadio, and the size returned isn´t the size of the current
selectOneRadio list but of the previous one…

 

Unfortunately
for me I cannot have a definite decision since my debugging tool (Exadel
Studio) isn´t allowing me to debug the HtmlRadioRenderer at runtime during
execution in tomcat.  

Can
anybody help me with this?  

 

Regards,

Jorge
Vásquez

 








HtmlRadioButton problem...

2006-09-04 Thread Jorge Vásquez








Hi everyone,

I am getting a strange behavior in the
htmlRadioRendering process.  The exception that I am getting is:

java.lang.IndexOutOfBoundsException: index 5 >= 5

  at
org.apache.myfaces.renderkit.html.ext.HtmlRadioRenderer.renderRadio(HtmlRadioRenderer.java:108)

 

After
going over the HtmlRadioRenderer code I have found that the cause of the error
is due to the fact that the index of the HtmlRadioButton element that is being
rendered is greater than the size of the HtmlSelectOneRadio list of elements
that is referenced by the HtmlRadio element.  I am generating the Html Object
model in java code and in the model that I generate the indexes are always
smaller than the size of the SelectOneRadio list of elements.  To make things
worse this error only appears occasionally after regenerating the Html object
model, but I haven´t been able to decipher the pattern that originates the
error since it is very random.  I have the feeling that somehow the
HtmlRadioRenderer occasionally does some cache on the HtmlSelectOneRadio, and
the size returned isn´t the size of the current selectOneRadio list but of the
previous one…

 

Unfortunately
for me I cannot have a definite decision since my debugging tool (Exadel Studio)
isn´t allowing me to debug the HtmlRadioRenderer at runtime during execution in
tomcat.  

Can
anybody help me with this?  

 

Regards,

Jorge
Vásquez

 








RE: Facet Object creation...

2006-08-30 Thread Jorge Vásquez








Ok Nick, thanks a lot!!!

Regards,

JV

 









De: Hagen, Nicholas
[mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 30 de
agosto de 2006 17:17
Para: MyFaces Discussion
Asunto: RE: Facet Object
creation...



 

Facets are just
UIComponents that are stored on the parent in the facet map.  To add a
facet to a component just do something such as:

 

// Create Facet Component

UIPanel panelComponent =
(UIPanel) … // create HtmlPanelGroup or whatever is the main child
component of the facet

 

// Add Facet to Parent

parentComponent.getFacets().put(“searchableLibrariesFolder”,
panelComponent);

 

Nick









From:
Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 30, 2006
4:56 PM
To: 'MyFaces Discussion'
Subject: RE: Facet Object
creation...



 

One more thing,

In case it helps I am
referrint to the f:facet tag and I want to generate it from java:

 

Ex.

 
<f:facet name="searchableLibrariesFolder">

   
<h:panelGroup>


<t:graphicImage
value="#{node.iconOpen}"

  
rendered="#{t.nodeExpanded}" style="border:0px"
/>


<t:graphicImage
value="#{node.icon}"

  
rendered="#{!t.nodeExpanded}" style="border:0px"
/>


<h:outputText value="#{node.description}"
styleClass="nodeFolder" />

   
h:panelGroup>

 
f:facet>

Regards,

JV









De: Jorge Vásquez
[mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 30 de
agosto de 2006 16:43
Para: users@myfaces.apache.org
Asunto: Facet Object creation...



 

Hi,

I´ve been searching for a class that extends from
UIComponent, that is the one that implements the facelet element, since I have
no idea on how to create a facet from java.

 

For example to create an HtmlOuputText the procedure
is the following :

 

HtmlOutputText outputText = (HtmlOutputText)
FacesContext.getCurrentInstance().getApplication(HtmlOutputText.COMPONENT_TYPE);

 

And then you add it to the parent with the
getChildren().add and so on…(I am using the approach of generating some
GUI objects on java code in combination with the binding attribute)

 

I have no idea on how to create facet objects in a
similar manner, any ideas?

 

Regards to all,

JV

 

 

 

 








RE: Facet Object creation...

2006-08-30 Thread Jorge Vásquez








One more thing,

In case it helps I am
referrint to the f:facet tag and I want to generate it from java:

 

Ex.

  <f:facet name="searchableLibrariesFolder">

    <h:panelGroup>

 <t:graphicImage
value="#{node.iconOpen}"

   rendered="#{t.nodeExpanded}"
style="border:0px" />

 <t:graphicImage
value="#{node.icon}"

   rendered="#{!t.nodeExpanded}"
style="border:0px" />

 <h:outputText value="#{node.description}"
styleClass="nodeFolder" />

    h:panelGroup>

  f:facet>

Regards,

JV









De: Jorge Vásquez
[mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 30 de
agosto de 2006 16:43
Para: users@myfaces.apache.org
Asunto: Facet Object creation...



 

Hi,

I´ve been searching for a class that extends from
UIComponent, that is the one that implements the facelet element, since I have
no idea on how to create a facet from java.

 

For example to create an HtmlOuputText the procedure
is the following :

 

HtmlOutputText outputText = (HtmlOutputText)
FacesContext.getCurrentInstance().getApplication(HtmlOutputText.COMPONENT_TYPE);

 

And then you add it to the parent with the
getChildren().add and so on…(I am using the approach of generating some
GUI objects on java code in combination with the binding attribute)

 

I have no idea on how to create facet objects in a
similar manner, any ideas?

 

Regards to all,

JV

 

 

 

 








Facet Object creation...

2006-08-30 Thread Jorge Vásquez








Hi,

I´ve been searching for a class that extends from UIComponent,
that is the one that implements the facelet element, since I have no idea on
how to create a facet from java.

 

For example to create an HtmlOuputText the procedure
is the following :

 

HtmlOutputText outputText = (HtmlOutputText) FacesContext.getCurrentInstance().getApplication(HtmlOutputText.COMPONENT_TYPE);

 

And then you add it to the parent with the
getChildren().add and so on…(I am using the approach of generating some GUI
objects on java code in combination with the binding attribute)

 

I have no idea on how to create facet objects in a
similar manner, any ideas?

 

Regards to all,

JV

 

 

 

 








JSF Cycle execution question...

2006-08-23 Thread Jorge Vásquez








Regards,

I have been experimenting with a combination of
action and actionListener method binding and when I debug my code I notice that
the actionListener gets executed first, is this always the case?  Is it
possible for this order of execution to change between implementations or it is
part of the reference?

 

Thanks,

JV








Very dynamic page definitions...

2006-08-22 Thread Jorge Vásquez








Regards,

I have a specific need with JSF to change some pages based
on runtime conditions.  For example, some users of the app would see a form
rendered on a two-column table meanwhile others may get it rendered totally different,
even with different field order, according to a personalized template used by them.
 I was thinking of using three scenarios for certain pages, and they would get
included according to runtime conditions of the current user, something like
this:

 



<ui:fragment rendered="#{searchTreeBean.scenario
== 0}>

  <ui:include src="/pages/standard.xhtml"
/>

ui:fragment>

 



<ui:fragment rendered="#{searchTreeBean.scenario
== 1}>

  <ui:include src="/pages/personalized.xhtml"
/>

ui:fragment>

 



<ui:fragment rendered="#{searchTreeBean.scenario
== 2}>

  <ui:include src="#{mybean.includedPage}"
/>

ui:fragment>

 

But I am not very sure if this is an adequate
strategy to support personalized pages for particular users, anyone has had a
similar problem?  How have you proceeded?  This has also lead me to think if
navigation conditions can be incorporated to the faces-config.xml file at
runtime?

 

Cheers,

Jorge Vásquez

 

p.d:  By the way, I am using Facelets as view
technology.








RE: dynamic list rendered onmouseover event...

2006-08-14 Thread Jorge Vásquez
Thanks a lot Andrew, you have really been of great help in solving the
majority of questions that I post!!
Really cool component!!!
JV

-Mensaje original-
De: Andrew Robinson [mailto:[EMAIL PROTECTED] 
Enviado el: lunes, 14 de agosto de 2006 14:21
Para: MyFaces Discussion
Asunto: Re: dynamic list rendered onmouseover event...

have a look at t:popup

On 8/14/06, Jorge Vásquez <[EMAIL PROTECTED]> wrote:
> Thanks Eurig but I already checked those, the element that you are
probably
> referring is: inputSuggest which is destinated for use with input texts. I
> think that the principle is probably the same but I need it to operate
with
> normal output texts.  I´ll probably check out the code and see if I can
> adapt the same principle for output texts...
>
> Regards,
> Jorge Vasquez
>
> -Mensaje original-
> De: Eurig Jones [mailto:[EMAIL PROTECTED]
> Enviado el: lunes, 14 de agosto de 2006 12:37
> Para: MyFaces Discussion
> Asunto: Re: dynamic list rendered onmouseover event...
>
> There are some AJAX components in the myFaces sandbox which might be of
> interest to you...
> http://myfaces.apache.org/sandbox/index.html
>
> Jorge Vásquez wrote:
> >
> > Regards to all,
> >
> > I was wondering if anyone has developed or has used a component which
> > activates a lookup list when a user points his mouse over some text
> > (mouseover event). I have seen something similar in gmail on the chat
> > that is integrated with the web client where whenever one points to a
> > contact it shows some possible actions related to a contact based on
> > the current situation of the contact (whether he/she is logged, etc)…
> >
> > In DHTML terms I think of it as a contextual menu which activates with
> > mouseover events and deactivates with onmouseout events. I have also
> > seen something similar in some Microsoft applications where usually
> > you get a contextual combobox for each cell in a row once the user
> > points his/her mouse to the cell.
> >
> > Thanks in advance,
> >
> > Jorge Vásquez
> >
>
>



RE: dynamic list rendered onmouseover event...

2006-08-14 Thread Jorge Vásquez
Thanks Eurig but I already checked those, the element that you are probably
referring is: inputSuggest which is destinated for use with input texts. I
think that the principle is probably the same but I need it to operate with
normal output texts.  I´ll probably check out the code and see if I can
adapt the same principle for output texts...

Regards,
Jorge Vasquez 

-Mensaje original-
De: Eurig Jones [mailto:[EMAIL PROTECTED] 
Enviado el: lunes, 14 de agosto de 2006 12:37
Para: MyFaces Discussion
Asunto: Re: dynamic list rendered onmouseover event...

There are some AJAX components in the myFaces sandbox which might be of 
interest to you...
http://myfaces.apache.org/sandbox/index.html

Jorge Vásquez wrote:
>
> Regards to all,
>
> I was wondering if anyone has developed or has used a component which 
> activates a lookup list when a user points his mouse over some text 
> (mouseover event). I have seen something similar in gmail on the chat 
> that is integrated with the web client where whenever one points to a 
> contact it shows some possible actions related to a contact based on 
> the current situation of the contact (whether he/she is logged, etc)…
>
> In DHTML terms I think of it as a contextual menu which activates with 
> mouseover events and deactivates with onmouseout events. I have also 
> seen something similar in some Microsoft applications where usually 
> you get a contextual combobox for each cell in a row once the user 
> points his/her mouse to the cell.
>
> Thanks in advance,
>
> Jorge Vásquez
>



RE: Problem with Spanish characters in myfaces simple examples

2006-08-14 Thread Jorge Vásquez
I don´t know if I didn´t made myself clear but first of all the encoding
used isn´t ASCII and there´s a .properties file for Spanish in the
myfaces-example-simple-1.1.5-SNAPSHOT named:  example_messages_es.properties
where there´s a localized Spanish text for each label.  I think that the
problem is either related with some configuration that is missing in the
faces-config that comes with the demo files, related to the locales
supported or it can also be related to some tomcat config variable, I
already restarted tomcat placing the following line at Catalina.bat:  
set CATALINA_OPTS=-Dfile.encoding=UTF-8, but the problem persists.  I found
a recommendation at:  http://wiki.apache.org/tomcat/Tomcat/UTF-8 but I think
that there would be no reason to add a filter, and it should work fine with
the encoding being set in each page and in the container but unfortunately
problems continue...
Again, any ideas?

Regards,
Jorge Vásquez

-Mensaje original-
De: Eurig Jones [mailto:[EMAIL PROTECTED] 
Enviado el: lunes, 14 de agosto de 2006 12:46
Para: MyFaces Discussion
Asunto: Re: Problem with Spanish characters in myfaces simple examples

I dont think by the way you've described is anything to do with JSF. 
Have a look at the following link. You'll need to replace these 
characters with the relevant codes. Outputting text with certain JSF 
tags will do this for you

http://www.ascii.cl/htmlcodes.htm

Jorge Vásquez wrote:
>
> Hi,
>
> Alter deploying the myfaces examples to tomcat 5.0.28, I am getting 
> strange characters for spanish “tildes”.
>
> For instance, instead of “país” I get: “Pa�s”. I am using firefox 
> 1.5.0.6 with UTF-8 as encoding and the strange thing is that after 
> checking the jsps for the examples they also have Utf-8 encoding: <%@ 
> page session="false" contentType="text/html;charset=utf-8"%>
>
> Any ideas on what is happening?
>
> Cheers,
>
> Jorge Vásquez
>



Problem with Spanish characters in myfaces simple examples

2006-08-14 Thread Jorge Vásquez








Hi,

Alter deploying the myfaces examples to tomcat 5.0.28,
I am getting strange characters for spanish “tildes”.  

For instance, instead of “país” I get:  “Pa�s”.  I am using firefox 1.5.0.6 with UTF-8 as
encoding and the strange thing is that after checking the jsps for the examples
they also have Utf-8 encoding:  <%@ page session="false"
contentType="text/html;charset=utf-8"%>

 

Any ideas on what is happening?

 

Cheers,

Jorge Vásquez  








dynamic list rendered onmouseover event...

2006-08-14 Thread Jorge Vásquez








Regards to all,

I was wondering if anyone has developed or has used a
component which activates a lookup list when a user points his mouse over some
text (mouseover event).  I have seen something similar in gmail on the chat
that is integrated with the web client where  whenever one points to a contact
it shows some possible actions related to a contact based on the current
situation of the contact (whether he/she is logged, etc)…

In DHTML terms I think of it as a contextual menu
which activates with mouseover events and deactivates with onmouseout events.  I
have also seen something similar in some Microsoft applications where usually you
get a contextual combobox for each cell in a row once the user points his/her
mouse to the cell.  

 

Thanks in advance,

Jorge Vásquez

 

 








RE: Problem with value-binding with map attribute...

2006-08-08 Thread Jorge Vásquez
Finally, I realized the problem.  I had an immediate="true" attribute on the
command link, this invoked the action method without doing any value binding
first.

Cheers,
Jorge Vásquez

-Mensaje original-
De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 08 de agosto de 2006 9:45
Para: 'MyFaces Discussion'
Asunto: RE: Problem with value-binding with map attribute...

Please somebody help me with this, I am completely lost, anyone has had a
similar need of binding maps to values?  Where should I look for the error?
Any clues as if it´s something missing, or some bug?
Regards,
JV  

-Mensaje original-----
De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: lunes, 07 de agosto de 2006 10:14
Para: users@myfaces.apache.org
Asunto: Re: Problem with value-binding with map attribute...


Hi, I forgot to include that part in the post, but of course I create the
map
object.  The bean has session scope and its constructor includes the line:

returnCheckBoxesMap = new HashMap();

Regards,
Jorge Vasquez
-- 
View this message in context:
http://www.nabble.com/Problem-with-value-binding-with-map-attribute...-tf205
4156.html#a5686850
Sent from the MyFaces - Users forum at Nabble.com.



RE: Problem with value-binding with map attribute...

2006-08-08 Thread Jorge Vásquez
Please somebody help me with this, I am completely lost, anyone has had a
similar need of binding maps to values?  Where should I look for the error?
Any clues as if it´s something missing, or some bug?
Regards,
JV  

-Mensaje original-
De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: lunes, 07 de agosto de 2006 10:14
Para: users@myfaces.apache.org
Asunto: Re: Problem with value-binding with map attribute...


Hi, I forgot to include that part in the post, but of course I create the
map
object.  The bean has session scope and its constructor includes the line:

returnCheckBoxesMap = new HashMap();

Regards,
Jorge Vasquez
-- 
View this message in context:
http://www.nabble.com/Problem-with-value-binding-with-map-attribute...-tf205
4156.html#a5686850
Sent from the MyFaces - Users forum at Nabble.com.



Re: Problem with value-binding with map attribute...

2006-08-07 Thread Jorge Vásquez

Hi, I forgot to include that part in the post, but of course I create the map
object.  The bean has session scope and its constructor includes the line:

returnCheckBoxesMap = new HashMap();

Regards,
Jorge Vasquez
-- 
View this message in context: 
http://www.nabble.com/Problem-with-value-binding-with-map-attribute...-tf2054156.html#a5686850
Sent from the MyFaces - Users forum at Nabble.com.



Problem with value-binding with map attribute...

2006-08-04 Thread Jorge Vásquez








Hi, 

I have some form elements mapped to the same map
attribute of a bean but with different keys each and in theory when a post is
done the map keys should each be set with the values entered in each element in
the form but the map always arrives empty.

 

In order to make myself clear here goes a simplified
example of what I am trying (by the way, the possibility of creating a direct
setter and getter for each property is not possible in my case which is a
little more complex than this example):

 

In the jsp I have something like the following:

 



 

Then, when I invoke an action method on the bean which
has the attribute and getter method:

 

        private Map returnCheckBoxesMap;

 

 

  public Map getReturnCheckBoxesMap() {

    return returnCheckBoxesMap;

  }

 

I notice that the returnCheckBoxesMap remains empty
without the values that I inputted on the textbox, I imagined that by doing the
mapping the map attribute is automatically updated with the values that are
sent on the page?  

Can anyone explain this to me?  How is the
value-binding process done with map attributes, is this a bug or am I missing
something?

 

Regards,

Jorge Vásquez

 








RE: jsf + jsp/servlet hybrid

2006-08-04 Thread Jorge Vásquez









Thanks Grant,

One question though, your
decision on that Project was to keep a hybrid or to migrate everything to JSF?

 

JV.

 









De: Grant Smith
[mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 04 de agosto
de 2006 10:23
Para: MyFaces
 Discussion
Asunto: Re: jsf + jsp/servlet
hybrid



 

Jorge,

I have worked on a project which migrated from a PURE servlet environment to
JSF. We gradually moved the functionality from the servlets to JSF pages.
Overall the experience was not a bad one, as there are ways to access beans
from the servlets, and the request / session info in the servlets can be
reached from the JSF beans. 

Performance wise the servlets performed much better than the JSF pages, but we
could accept that. The fact that there was a combination of servlets and JSF
pages did not slow down either though.

Hope that helps. 

-Grant.



On 8/4/06, Jorge
Vásquez <[EMAIL PROTECTED]>
wrote:







Hi,

Has anybody used a hybrid as an integration strategy with an old
application that uses the JSP Model 2 architecture (jsp + servlets with clean
separation of model, view and control).  In theory it should be possible
since the jsf architecture uses servlet mappings, so we can play with the URIs
sent by the legacy code and the new code in JSF but my curiosity is more aimed
at consulting if anyone of you has done something similar in your projects and
what have you concluded (complex to maintain?, performance issues?, etc.).

 

Cheers,

Jorge Vásquez 












-- 
Grant Smith








jsf + jsp/servlet hybrid

2006-08-04 Thread Jorge Vásquez








Hi,

Has anybody used a hybrid as an integration strategy
with an old application that uses the JSP Model 2 architecture (jsp + servlets
with clean separation of model, view and control).  In theory it should be
possible since the jsf architecture uses servlet mappings, so we can play with
the URIs sent by the legacy code and the new code in JSF but my curiosity is
more aimed at consulting if anyone of you has done something similar in your
projects and what have you concluded (complex to maintain?, performance issues?,
etc.).

 

Cheers,

Jorge Vásquez 








RE: HELP with h:selectOneRadio inside h:dataTable

2006-08-03 Thread Jorge Vásquez
FINALLY I MADE IT!!!,
In case someone is interested I finally was able to generate a table from
the bean with a select one radiobutton...
The first thing you have to do is generate the list of radiobuttons as
follows:
HtmlSelectOneRadio orderRadioButton = (HtmlSelectOneRadio)
app.createComponent(HtmlSelectOneRadio.COMPONENT_TYPE);
orderRadioButton.setId("ordenar");
orderRadioButton.setRendered(false);
UIComponent component =
FacesUtils.getFacesContext().getViewRoot().findComponent("fieldsForm");
for (int i = 0; i < dataFieldCollection.getCollCount();
i++){
UISelectItem selectItem = 

(UISelectItem)app.createComponent(UISelectItem.COMPONENT_TYPE);
SelectItem item = new SelectItem(i+"", "");
selectItem.setValue(item);
orderRadioButton.getChildren().add(selectItem);
}

And then you generate the panel where each radioButton element has the same
index as the radiobutton option in the past list and in the for attribute
they reference the HtmlSelectOneRadio component, the code is as follows (The
important lines are the last ones!!!):

component.getChildren().add(orderRadioButton);
for (int i = 0; i < dataFieldCollection.getCollCount();
i++){
altDataField fld =
(altDataField)dataFieldCollection.getCollObject(i);
HtmlOutputText fieldName = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);
fieldName.setValue(fld.getField("DESCR"));
searchFieldsPanel.getChildren().add(fieldName);
HtmlInputText inputText = (HtmlInputText)
app.createComponent(HtmlInputText.COMPONENT_TYPE);
int entryLength =
Integer.parseInt(fld.getField("ENTRYLENGTH"));

inputText.setMaxlength(Integer.parseInt(fld.getField("ENTRYLENGTH")));
if (entryLength > 40) {
inputText.setSize(40);
} else {
inputText.setSize(entryLength);
}
searchFieldsPanel.getChildren().add(inputText);
HtmlSelectBooleanCheckbox returnCheckBox =
(HtmlSelectBooleanCheckbox)
app.createComponent(HtmlSelectBooleanCheckbox.COMPONENT_TYPE);
returnCheckBox.setSelected(true);
searchFieldsPanel.getChildren().add(returnCheckBox);
HtmlRadio radioButton = (HtmlRadio)
app.createComponent(HtmlRadio.COMPONENT_TYPE);
radioButton.setFor("fieldsForm:ordenar");
radioButton.setIndex(i);
searchFieldsPanel.getChildren().add(radioButton);
}

COOL!!!

Regards,
JV


-Mensaje original-
De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 03 de agosto de 2006 10:53
Para: 'MyFaces Discussion'
Asunto: RE: HELP with h:selectOneRadio inside h:dataTable

Hi,
Does somebody know which HtmlSelectOneRadio impl to use in order to allow it
to force a same id for all the radio buttons in a table?
One appreciation:  I don´t know if I am lost here but I am starting to think
that JSF has some serious design flaws in respect to this html element?

Regards,
Jorge Vasquez 

-Mensaje original-
De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 03 de agosto de 2006 9:39
Para: 'MyFaces Discussion'
Asunto: RE: HELP with h:selectOneRadio inside h:dataTable

Thanks Martin, 
Due to the nature of the form I decided to use another strategy to solve the
problem, more based on a binding mechanism with a panel Grid, in this case I
am having problems when manipulating an HtmlSelectOneRadio component, do you
have by any chance have an example where a SelectOneRadio component is
included into a panelGrid from java code and where the selectOneRadio
element when rendered has the same name for each row but different values.
In case it helps this is my current xhtml code:



And this is my java code where the panelGrid gets created:

public void initializeFieldsPanel() {
searchFieldsPanel.getChildren().clear();
Application app =
FacesUtils.getFacesContext().getApplication();
HtmlOutputText emptyString = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);
emptyString.setValue("");
searchFieldsPanel.getChildren().add(emptyString);
emptyString = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);
emptyString.setValue("");
searchFieldsPanel.getChildren(

RE: HELP with h:selectOneRadio inside h:dataTable

2006-08-03 Thread Jorge Vásquez
Hi,
Does somebody know which HtmlSelectOneRadio impl to use in order to allow it
to force a same id for all the radio buttons in a table?
One appreciation:  I don´t know if I am lost here but I am starting to think
that JSF has some serious design flaws in respect to this html element?

Regards,
Jorge Vasquez 

-Mensaje original-
De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 03 de agosto de 2006 9:39
Para: 'MyFaces Discussion'
Asunto: RE: HELP with h:selectOneRadio inside h:dataTable

Thanks Martin, 
Due to the nature of the form I decided to use another strategy to solve the
problem, more based on a binding mechanism with a panel Grid, in this case I
am having problems when manipulating an HtmlSelectOneRadio component, do you
have by any chance have an example where a SelectOneRadio component is
included into a panelGrid from java code and where the selectOneRadio
element when rendered has the same name for each row but different values.
In case it helps this is my current xhtml code:



And this is my java code where the panelGrid gets created:

public void initializeFieldsPanel() {
searchFieldsPanel.getChildren().clear();
Application app =
FacesUtils.getFacesContext().getApplication();
HtmlOutputText emptyString = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);
emptyString.setValue("");
searchFieldsPanel.getChildren().add(emptyString);
emptyString = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);
emptyString.setValue("");
searchFieldsPanel.getChildren().add(emptyString);
HtmlOutputText returnStr = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);
returnStr.setValue(Functions.getText("fields", "Return"));
searchFieldsPanel.getChildren().add(returnStr);
HtmlOutputText orderStr = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);
orderStr.setValue(Functions.getText("fields", "Order"));
searchFieldsPanel.getChildren().add(orderStr);

for (int i = 0; i < dataFieldCollection.getCollCount();
i++){
altDataField fld =
(altDataField)dataFieldCollection.getCollObject(i);
HtmlOutputText fieldName = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);
fieldName.setValue(fld.getField("DESCR"));
searchFieldsPanel.getChildren().add(fieldName);
HtmlInputText inputText = (HtmlInputText)
app.createComponent(HtmlInputText.COMPONENT_TYPE);
int entryLength =
Integer.parseInt(fld.getField("ENTRYLENGTH"));

inputText.setMaxlength(Integer.parseInt(fld.getField("ENTRYLENGTH")));
if (entryLength > 40) {
inputText.setSize(40);
} else {
inputText.setSize(entryLength);
}
searchFieldsPanel.getChildren().add(inputText);
HtmlSelectBooleanCheckbox returnCheckBox =
(HtmlSelectBooleanCheckbox)
app.createComponent(HtmlSelectBooleanCheckbox.COMPONENT_TYPE);
returnCheckBox.setSelected(true);
searchFieldsPanel.getChildren().add(returnCheckBox);
HtmlSelectOneRadio orderRadioButton =
(HtmlSelectOneRadio) app.createComponent(HtmlSelectOneRadio.COMPONENT_TYPE);
SelectItem item = new SelectItem(i+"");
orderRadioButton.getChildren().add(item);
//  orderRadioButton.setValue(item);

searchFieldsPanel.getChildren().add(orderRadioButton);
}
}

Where I am mostly interested is in the last 5 lines of code where the
HtmlSelectOneRadio component is created...

Regards and thanks again,
Jorge Vásquez

-Mensaje original-
De: Martin Grotzke [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 02 de agosto de 2006 10:48
Para: MyFaces Discussion
Asunto: Re: HELP with h:selectOneRadio inside h:dataTable

Hello,

have a look at
http://wiki.apache.org/myfaces/Display_Radio_Buttons_In_Columns and
http://myfaces.apache.org/sandbox/tagreference.html#selectOneRow.
You find an example for the last one at
http://irian.at/myfaces-sandbox/selectOneRow.jsf.

Cheers,
Martin


On Wed, 2006-08-02 at 10:38 -0500, Jorge Vásquez wrote:
> Hi, I have no idea on how to include selectOneRadio elements inside a
> datatable in order for each f:selectItem to be associated to a
> different row, but all the elements belonging to the same radiobutton
> group.  I am currently get

RE: HELP with h:selectOneRadio inside h:dataTable

2006-08-03 Thread Jorge Vásquez
Thanks Martin, 
Due to the nature of the form I decided to use another strategy to solve the
problem, more based on a binding mechanism with a panel Grid, in this case I
am having problems when manipulating an HtmlSelectOneRadio component, do you
have by any chance have an example where a SelectOneRadio component is
included into a panelGrid from java code and where the selectOneRadio
element when rendered has the same name for each row but different values.
In case it helps this is my current xhtml code:



And this is my java code where the panelGrid gets created:

public void initializeFieldsPanel() {
searchFieldsPanel.getChildren().clear();
Application app =
FacesUtils.getFacesContext().getApplication();
HtmlOutputText emptyString = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);
emptyString.setValue("");
searchFieldsPanel.getChildren().add(emptyString);
emptyString = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);
emptyString.setValue("");
searchFieldsPanel.getChildren().add(emptyString);
HtmlOutputText returnStr = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);
returnStr.setValue(Functions.getText("fields", "Return"));
searchFieldsPanel.getChildren().add(returnStr);
HtmlOutputText orderStr = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);
orderStr.setValue(Functions.getText("fields", "Order"));
searchFieldsPanel.getChildren().add(orderStr);

for (int i = 0; i < dataFieldCollection.getCollCount();
i++){
altDataField fld =
(altDataField)dataFieldCollection.getCollObject(i);
HtmlOutputText fieldName = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);
fieldName.setValue(fld.getField("DESCR"));
searchFieldsPanel.getChildren().add(fieldName);
HtmlInputText inputText = (HtmlInputText)
app.createComponent(HtmlInputText.COMPONENT_TYPE);
int entryLength =
Integer.parseInt(fld.getField("ENTRYLENGTH"));

inputText.setMaxlength(Integer.parseInt(fld.getField("ENTRYLENGTH")));
if (entryLength > 40) {
inputText.setSize(40);
} else {
inputText.setSize(entryLength);
}
searchFieldsPanel.getChildren().add(inputText);
HtmlSelectBooleanCheckbox returnCheckBox =
(HtmlSelectBooleanCheckbox)
app.createComponent(HtmlSelectBooleanCheckbox.COMPONENT_TYPE);
returnCheckBox.setSelected(true);
searchFieldsPanel.getChildren().add(returnCheckBox);
HtmlSelectOneRadio orderRadioButton =
(HtmlSelectOneRadio) app.createComponent(HtmlSelectOneRadio.COMPONENT_TYPE);
SelectItem item = new SelectItem(i+"");
orderRadioButton.getChildren().add(item);
//  orderRadioButton.setValue(item);

searchFieldsPanel.getChildren().add(orderRadioButton);
}
}

Where I am mostly interested is in the last 5 lines of code where the
HtmlSelectOneRadio component is created...

Regards and thanks again,
Jorge Vásquez

-Mensaje original-
De: Martin Grotzke [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 02 de agosto de 2006 10:48
Para: MyFaces Discussion
Asunto: Re: HELP with h:selectOneRadio inside h:dataTable

Hello,

have a look at
http://wiki.apache.org/myfaces/Display_Radio_Buttons_In_Columns and
http://myfaces.apache.org/sandbox/tagreference.html#selectOneRow.
You find an example for the last one at
http://irian.at/myfaces-sandbox/selectOneRow.jsf.

Cheers,
Martin


On Wed, 2006-08-02 at 10:38 -0500, Jorge Vásquez wrote:
> Hi, I have no idea on how to include selectOneRadio elements inside a
> datatable in order for each f:selectItem to be associated to a
> different row, but all the elements belonging to the same radiobutton
> group.  I am currently getting independent radiobutton elements for
> each row but I need all of them to belong to the same group in order
> to allow only one of the rows to be selected at once.
> 
>  
> 
> In case it helps I am currently using the code:
> 
>  
> 
> value="#{searchTreeBean.dataFieldList}"var="dataField">
> 
>  
> 
> value="#{dataField.descrip

HELP with h:selectOneRadio inside h:dataTable

2006-08-02 Thread Jorge Vásquez








Hi, I have no idea on how to include selectOneRadio
elements inside a datatable in order for each f:selectItem to be associated to
a different row, but all the elements belonging to the same radiobutton group.  I
am currently getting independent radiobutton elements for each row but I need
all of them to belong to the same group in order to allow only one of the rows
to be selected at once.

 

In case it helps I am currently using the code:

 

   

 

   

      f:verbatim>

 h:column>

 

   

      f:verbatim>

 h:column>

 

   

 h:column>

 

   

 

   h:selectOneRadio> 

 h:column>    

   h:dataTable>

 

Any ideas?  

 

Regards,

JV








state handling for dynamic form elements in a table...

2006-08-01 Thread Jorge Vásquez








Hello, I am attempting to develop a page that has
some rows formed by input components, which are generated on the run according
to the contents of a collection as follows:

 

  






        #{dataField.description}   td>


        


   
  

  
     f:verbatim>

  
    td>

  





  
td>

  



input>
  


  
td>



   tr>

  
ui:repeat>

 

 

I have achieved the first part which is printing out
the list of rows successfully but I have no idea on how to keep the state of
the values that the user inputs as they aren´t specifically mapped to setters
of a managed bean since they are completely dynamic.  The managedBean
returns a Collection of elements of type dataField, which has getters for
description, userColumn, etc.  How can I guarantee that when the user
sends a submit the state that he entered is kept and mapped to the bean
somehow?

 

Another question that I have related to this problem
is the use of the selectOneRadio component?  I wasn´t able to use it to
generate dynamic radiobuttons since the syntax is something like:

 











 

And the options that I would have are each in a
different row and I have no idea where to place the container element: 
selectOneRadio?

 

Anyone has any ideas ?  

 

Regards,

JV

 








RE: Rendered propety valid expressions?

2006-07-31 Thread Jorge Vásquez
Very interesting!!
Two new questions regarding valid EL expressions:
1.  How exactly will the syntax and procedure be for using a Facelet
function as rendered condition?
2.  Is it possible to obtain elements of Lists at specific positions and
compare them with fixed values.  
Ex:  rendered="#{mb.myList[0] eq 'element1'}"

Regards,
JV

-Mensaje original-
De: Mike Kienenberger [mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 28 de julio de 2006 17:36
Para: MyFaces Discussion
Asunto: Re: Rendered propety valid expressions?

Just keep in mind that <, >, & and others are special html characters.

You're better off using and, or, gt, ge, lt, le, eq, ne.

On 7/28/06, Matthias Wessendorf <[EMAIL PROTECTED]> wrote:
> John,
>
> maybe this gif (JSF 1.1) is helpful too
>
> http://autoren.w3l.de/w3lmedia/W3L/Medium036198/ausdruecke.gif
>
> On 7/28/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> > On 7/28/06, John Conner <[EMAIL PROTECTED]> wrote:
> > > I have just started with JSF and have been playing around with el
> > > expressions in the rendered property of components.  Is there
someplace
> > > that explains what is valid/invalid as an expression for this
property?
> >
> > The JSF 1.1 spec (JSR-127) under 5.1.2 "Value Binding Expression
> > Syntax", which starts off by saying
> >
> > "The syntax of a value binding expression is identical to the syntax
> > of an expression
> > language expression defined in the JavaServer Pages Specification
(version 2.0),
> > sections 2.3 through 2.9, with the following exceptions..."
> >
> >
> > > Specifically is it possible to:
> > > 1. Use an and condition like
> > >   rendered="#{mb.propertyBoolean1 && mb.propertyBoolean2}"
> >
> > Yes, although I'd recommend using "and" instead of "&&"  (I don't
> > remember if it's & or && in any case, but this avoids that issue as
> > well as escaping issues).
> >
> >
> > > 2. Is it possible to compare to an enum value
> > >   rendered="#{mb.enumValue == a.b.c.EnumClass.ENUM_VALUE}"
> >
> > I don't think so since variables must be managed beans or one of the
> > other predefined values.   However, you could write your own resolver
> > that also checked for enumeration classes.
> >
> > > 3. Use a complex call like
> > >   rendered="#{mb.someFunction(mb2.value1)}"
> >
> > Only if you're using Facelets or another viewhandler that lets you
> > define functions.
> >
> > For JSF 1.2, everything is the JSP 2.0 unified EL.   I think this is
> > also what Facelets uses underneath as an espression language (I have
> > el-api.jar and el-ri.jar files from glassfish to make it work).
> >
> > In any case, everything about the expression language is configurable.
> >   A long while back, someone posted a replacement EL that was
> > javascript.
> >
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>



RE: Displaying data from a map

2006-07-28 Thread Jorge Vásquez
You can also use:  #{managedBean.beanMapAttribute.key}

JV

-Mensaje original-
De: Kuni [mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 28 de julio de 2006 15:43
Para: MyFaces Discussion
Asunto: Re: Displaying data from a map

try #{map['key']} if you have String-based key's.. that works. a

Shibi Thomas schrieb:
> hi
> i am not familiar with witing your own functions for facelets. where 
> do i read more about this??
>
>  
> On 7/27/06, *Martin Beránek* <[EMAIL PROTECTED] 
> > wrote:
>
> CD napsal(a):
>
> > It might be best to write a couple of getter methods (one for
> getting
> > the keys and one for getting the values) that delegates to the
> > appropriate methods in the set or builds the keys and values on the
> > value using the set's contents.
>
> Or if you are using facelets, you can write your own functions like:
>
> public Set keysFromMap(Map m)
>
> and
>
> public Object valueFromMap(Object key)
>
> --
> Martin Beranek
>
>
>
>
> -- 
> Kind Regards
> Shibi Thomas
> Cell : 0843052341
> Email : [EMAIL PROTECTED] 
>
> Rom 12:21  Do not be overcome by evil, but overcome evil with good. 



RE: Problems with tree2 continue...

2006-07-28 Thread Jorge Vásquez
I already found out how...
...
  String[] expandedPath = {"0"};
  treeState = new TreeStateBase();
treeState.setTransient(true);
//Expand the tree´s first level nodes
treeState.expandPath(expandedPath);
treeModel.setTreeState(treeState);
...
By passing out the root index in the expanded path array to the treeState
object.

Regards,
JV

-Mensaje original-
De: Jorge Vásquez [mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 28 de julio de 2006 13:26
Para: 'MyFaces Discussion'
Asunto: RE: Problems with tree2 continue...

Didn´t know that.  It now works fine.  Thanks a lot.  
One last question:  ¿How can I open the tree´s first level when it gets
painted for the first time?

Regards,
JV

-Mensaje original-
De: Andrew Robinson [mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 28 de julio de 2006 12:54
Para: MyFaces Discussion
Asunto: Re: Problems with tree2 continue...

The new versions of tomahawk now use hard coded strings with the
property names. So there is no need for a facelets workaround anymore,
just use the raw component (no component handler or attribute renaming
needed)

On 7/28/06, Jorge Vásquez <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Hi,
>
> I am working with Facelets and configuring the tree2 has resulted in a
> painful task.
>
> My current problem is to be able to maintain the tree2 state after the
page
> is reloaded (I am not using frames so each time some item on the page is
> clicked I need to load the tree with the according state).  I decided to
> change the clientSideToggle to false in order to experiment with server
> state and haven´t been able to put it to work, I used this approach first:
>  id="menuTree"
> value="#{menu.treeModel}" var="node" varNodeToggler="t"
> org.apache.myfaces.tree2.CLIENT_SIDE_TOGGLE="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_ROOT_NODE="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_LINES="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_NAV="#{menu.booleanFalse}"
> >
> ...
> 
>
>
>
>
> And it didn´t work.
>
> Then I decided to create a tag handler similar to the one posted in:
>
> http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk
>
> And to my surprise there´s no class named: import
> org.apache.myfaces.renderkit.JSFAttr;
>
>
> neither in tomahawk (version tomahawk-1.1.5-SNAPSHOT.jar) nor myfaces
> (myfaces-impl-1.1.4-SNAPSHOT.jar) jars.  I did find two classes named like
> that in other packages but none of them had the attributes:
>
>   JSFAttr.SHOW_NAV
> JSFAttr.SHOW_NAV
> JSFAttr.CLIENT_SIDE_TOGGLE
> JSFAttr.SHOW_ROOT_NODE
> JSFAttr.PRESERVE_TOGGLE
>
>
>
>
> I really appreciate all the efforts done by everybody with this tree2
> component but just one question:
>
> ¿Is this component ready for production-class applications?
>
> NOTE:  I have read all the documentation available for the tree2 component
> but nevertheless I don´t seem to be able to grasp many ideas behind it, Am
I
> just the one with these problems?  I would kindly appreciate some
guidelines
> on how to thoroughly use this component…I suggest the inclusion of more
> examples with different scenarios.
>
>
>
> Regards to all,
>
> JV
>
>



RE: Problems with tree2 continue...

2006-07-28 Thread Jorge Vásquez
Didn´t know that.  It now works fine.  Thanks a lot.  
One last question:  ¿How can I open the tree´s first level when it gets
painted for the first time?

Regards,
JV

-Mensaje original-
De: Andrew Robinson [mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 28 de julio de 2006 12:54
Para: MyFaces Discussion
Asunto: Re: Problems with tree2 continue...

The new versions of tomahawk now use hard coded strings with the
property names. So there is no need for a facelets workaround anymore,
just use the raw component (no component handler or attribute renaming
needed)

On 7/28/06, Jorge Vásquez <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Hi,
>
> I am working with Facelets and configuring the tree2 has resulted in a
> painful task.
>
> My current problem is to be able to maintain the tree2 state after the
page
> is reloaded (I am not using frames so each time some item on the page is
> clicked I need to load the tree with the according state).  I decided to
> change the clientSideToggle to false in order to experiment with server
> state and haven´t been able to put it to work, I used this approach first:
>  id="menuTree"
> value="#{menu.treeModel}" var="node" varNodeToggler="t"
> org.apache.myfaces.tree2.CLIENT_SIDE_TOGGLE="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_ROOT_NODE="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_LINES="#{menu.booleanFalse}"
> org.apache.myfaces.tree2.SHOW_NAV="#{menu.booleanFalse}"
> >
> ...
> 
>
>
>
>
> And it didn´t work.
>
> Then I decided to create a tag handler similar to the one posted in:
>
> http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk
>
> And to my surprise there´s no class named: import
> org.apache.myfaces.renderkit.JSFAttr;
>
>
> neither in tomahawk (version tomahawk-1.1.5-SNAPSHOT.jar) nor myfaces
> (myfaces-impl-1.1.4-SNAPSHOT.jar) jars.  I did find two classes named like
> that in other packages but none of them had the attributes:
>
>   JSFAttr.SHOW_NAV
> JSFAttr.SHOW_NAV
> JSFAttr.CLIENT_SIDE_TOGGLE
> JSFAttr.SHOW_ROOT_NODE
> JSFAttr.PRESERVE_TOGGLE
>
>
>
>
> I really appreciate all the efforts done by everybody with this tree2
> component but just one question:
>
> ¿Is this component ready for production-class applications?
>
> NOTE:  I have read all the documentation available for the tree2 component
> but nevertheless I don´t seem to be able to grasp many ideas behind it, Am
I
> just the one with these problems?  I would kindly appreciate some
guidelines
> on how to thoroughly use this component…I suggest the inclusion of more
> examples with different scenarios.
>
>
>
> Regards to all,
>
> JV
>
>



Problems with tree2 continue...

2006-07-28 Thread Jorge Vásquez








Hi,

I am working with Facelets and configuring the tree2
has resulted in a painful task.  

My current problem is to be able to maintain the
tree2 state after the page is reloaded (I am not using frames so each time some
item on the page is clicked I need to load the tree with the according state).  I
decided to change the clientSideToggle to false in order to experiment with server
state and haven´t been able to put it to work, I used this approach first:

id="menuTree" value="#{menu.treeModel}" var="node" varNodeToggler="t" org.apache.myfaces.tree2.CLIENT_SIDE_TOGGLE="#{menu.booleanFalse}"org.apache.myfaces.tree2.SHOW_ROOT_NODE="#{menu.booleanFalse}"org.apache.myfaces.tree2.SHOW_LINES="#{menu.booleanFalse}"org.apache.myfaces.tree2.SHOW_NAV="#{menu.booleanFalse}"> ...

 

And it didn´t work.

Then I decided to create a tag handler similar to the
one posted in:

http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk

And to my surprise there´s no class named:

import org.apache.myfaces.renderkit.JSFAttr;

neither in tomahawk (version tomahawk-1.1.5-SNAPSHOT.jar)
nor myfaces (myfaces-impl-1.1.4-SNAPSHOT.jar) jars.  I did find two classes
named like that in other packages but none of them had the attributes:

 

JSFAttr.SHOW_NAVJSFAttr.SHOW_NAVJSFAttr.CLIENT_SIDE_TOGGLEJSFAttr.SHOW_ROOT_NODEJSFAttr.PRESERVE_TOGGLE

 

I really appreciate all the efforts done by everybody
with this tree2 component but just one question:  

¿Is this component ready for production-class
applications?

NOTE:  I have read all the documentation available
for the tree2 component but nevertheless I don´t seem to be able to grasp many
ideas behind it, Am I just the one with these problems?  I would kindly
appreciate some guidelines on how to thoroughly use this component…I
suggest the inclusion of more examples with different scenarios.

 

Regards to all,

JV

   








Navigation problems with FACELETS

2006-07-26 Thread Jorge Vásquez








Greetings to all,

Alter having many problems with JSP+JSF I decided to
give it a try with Facelets.  Everything started fine, my login page appeared
on screen and I was starting to get excited but unfortunately in our profession
excitement doesn´t lasts much and I am getting problems with navigation where I
get no message at all, no log, etc.  I followed the application in debug mode
and after clicking the submit button it went to the corresponding action method
in the managed bean and reached the end and returned the respective String
which in the faces-config is mapped to another page but nothing happens and the
same page is reloaded with no message at all.  Here I confess that I am
completely lost, how can I debug this?  Has anyone had a similar problem with
MyFaces+Facelets?  

Regards,

JV








RE: JSF + JSTL + Pure HTML--An Explosive Mixture

2006-07-25 Thread Jorge Vásquez
Thanks Andrew,
I think I know what is the cause of my html output being so strange, and it
is the include+subview, I have removed all Jsp and JSTL code and problems
persisted.  
I can´t imagine converting all pure HTML code to JSF, that would be hundreds
of hours of work!!!
Do you perhaps know of all the guidelines that I must follow for using the
subview functionality correctly? Or is there any alternative out there
beyond the jsp:include for including one jsp inside another?  (One that is
pure jsf...)
Regards,
Jorge Vásquez

-Mensaje original-
De: Andrew Robinson [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 25 de julio de 2006 11:57
Para: MyFaces Discussion
Asunto: Re: JSF + JSTL + Pure HTML--An Explosive Mixture

You cannot combine JSP and JSTL to my knowledge. If you want to use
JSTL with JSF, use facelelets and remove all JSP code (<%%>). I would
recommend not using JSTL (or JSP) code for JSF pages, they don't play
that well together. Facelets does support some of the JSTL
functionality, but the author (Jacob) recommends that you do not use
JSTL if at all possible.

The best thing for conditional rendering (if logic) is to use the
rendered attribute and when grouping components use the panelGroup
component. If looping, the Tomahawk dataList control is very useful.

On 7/25/06, Jorge Vásquez <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Regards to all,
>
> I am migrating a pure JSP+Servlet Application to JSF and I have
encountered
> some really particular behaviours.  I decided to use a mixture of JSF +
JSTL
> + Pure HTML in order to make the migration less painful but I am
considering
> migrating everything to pure JSF due to the strange things that are
> happening.
>
> For instance, in the following code fragment:
>
>
>
>
>
>
> 
>
>  test="${sessionScope.appStateBean.currentTool == 0}">
>
>   src="<%=request.getContextPath()%>/pages/images/timages/tab_left_gray.gif"
> Title="" border="0">
>
>  
background="<%=request.getContextPath()%>/pages/images/timages/tab_middle_gr
ay.gif">
>
> src="<%=request.getContextPath()%>/pages/images/timages/blank.gif"
width="2"
> height="1" Title="">
>
>
>
> immediate="true" action="#{appStateBean.changeTab}" styleClass="blue">
>
> 
>
> 
>
>   
>
>   
>
>src="<%=request.getContextPath()%>/pages/images/timages/blank.gif"
width="2"
> height="1" Title="">
>
> 
>
> 
src="<%=request.getContextPath()%>/pages/images/timages/tab_right_gray.gif"
> Title="" border="0">
>
> 
>
> 
>
> 
>
>   src="<%=request.getContextPath()%>/pages/images/timages/tab_left.gif""
> Title="" border="0">
>
>  
background="<%=request.getContextPath()%>/pages/images/timages/tab_middle.gi
f">
>
> src="<%=request.getContextPath()%>/pages/images/timages/blank.gif"
width="2"
> height="1" Title="">
>
>
>
> immediate="true" action="#{appStateBean.changeTab}" styleClass="white">
>
> 
>
> 
>
>   
>
>   
>
>src="<%=request.getContextPath()%>/pages/images/timages/blank.gif"
width="2"
> height="1" Title="">
>
> 
>
>  src="<%=request.getContextPath()%>/pages/images/timages/tab_right.gif"
> Title="" border="0">
>
> 
>
> 
>
>   
>
>
>
>
>
>
>
>
> The commandLink doesn´t gets rendered at all, I don´t know if there are
some
> issues when a commandLink gets inside a conditional JSTL tag?
>
>
>
> Another curious issue is the following line:
>
>
>
>

Help in table conversion from HTML to JSF...

2006-07-25 Thread Jorge Vásquez








Greetings,

 

I am having tons of problems migrating a pure html
table to JSF, I don´t know if I am still not used to think in JSF terms but I
kind of get the impression that table components in JSF miss lots of features
that were present in html.

I enumerate some:

 

1.  How is it possible to associate an image to a td
as background in JSF:

Example in html:  

 

2.  How is it possible to define an empty td with
certain width:  

Example in html:  

 

3.  How is it possible to specify to a panelGrid
container that a bunch of elements must go under a td?

 

Does anyone knows of a table component in JSF that is
more closely related to the html table?

 

Thanks a lot,

JV

 








ManagedBean methods with arguments...

2006-07-21 Thread Jorge Vásquez








Hi,

I was wondering if JSF supports invoking methods in
ManagedBeans that have input arguments..

For instance, how can I convert the following pure
jsp code to jsf style (I am particularly interested in conversion for the
method:  getField(String arg)):

 

  <% String dlen = "0";

 for (int i = 0; i < flds.getCollCount(); i++){ 

     altDataField fld =
(altDataField)flds.getCollObject(i);  

     String fldVal =
(String)fldVals.get(fld.m_userColumn);

     if
(Integer.parseInt(fld.m_entryLength) > 40) dlen = "40"; else dlen = fld.m_entryLength; %>

   <TR>

 <TD align=right><%= fld.getField("DESCR") %>   TD>

 <TD><INPUT id="<%= fld.getField("USERCOLUMN") %>" name="<%= fld.getField("USERCOLUMN") %>" size=<%= dlen %> maxlength=<%= fld.getField("ENTRYLENGTH") %> value="<%= fldVal %>">input>   TD>

     <TD><input checked type="checkbox"
name="chk<%= fld.getField("USERCOLUMN") %>" value="1">input>TD> 

     <TD><input type="radio"
name="orderby" value="<%= fld.getField("USERCOLUMN") %>">input>TD>     

   TR>

 
<%
} %>

 

 

Regards,

Jorge Vásquez

 

 

 








RE: Tomahawk tree2

2006-07-21 Thread Jorge Vásquez








Andrew, one last
request:  the TreeBean found in the source files (jsfCompAA-source.zip) is
incomplete:

 

/**

 * 

 */

package
warSource.net.sf.jsfcomp.aa.tree.examples;

 

/**

 *

 * @author Andrew
Robinson (andrew)

 */

public class TreeBean

{

  public TreeBean()

  {}

}

 

Would you mind copying me
the full source for this Bean.

Thanks a lot and best regards,

JV

 









De: Andrew Robinson
[mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 21 de julio
de 2006 10:18
Para: MyFaces
 Discussion
Asunto: Re: Tomahawk tree2



 

Sorry, I haven't had time
to document it on the web site.

Here is the link to download it:

http://sourceforge.net/project/showfiles.php?group_id=137466&package_id=197375




On 7/21/06, Jorge
Vásquez <[EMAIL PROTECTED]>
wrote:







Thanks Andrew,

I don´t see the component that you mention on
that page?

Regards,

JV