java.lang.IllegalStateException in tree2

2007-01-03 Thread Sanjeev
Hi,
I am getting the following exception in tomahawk tree2 while
fetching the data
from  database and constructing the tree:
java.lang.IllegalStateException: Encountered a node [0:0:0] + 
with an illogical
state. Node is expanded but it is also considered a leaf (a 
leaf cannot be
considered expanded

Here is the function which returns the tree data:
public TreeNode getTreeData()
{
  TreeNode treeData = new TreeNodeBase("foo-folder", "First",
 false);
Enumeration keys = topMostNodes.keys();
while(keys.hasMoreElements()){
String currKey = keys.nextElement().toString();
Vector tempChildList = (Vector)topMostNodes.get(currKey);
TreeNodeBase tempNodeBase = new TreeNodeBase("foo-folder", 
currKey, false);
for(int cnt=0; cnt < tempChildList.size(); cnt++)
tempNodeBase.getChildren().add(new
TreeNodeBase("foo-folder",tempChildList.get(cnt).toString()
,true));
treeData.getChildren().add(tempNodeBase);
}
return treeData;
}

The topMostNodes HashTable contanis these entries:

parent 170160   childList [108858, 152338, 306438]
parent 106404   childList [306304]
parent 106402   childList [106406, 106407, 106408]
parent 106401   childList [106404]
parent 106400   childList [106403, 106405]
parent 290094   childList [290095, 290096, 290097, 290098, 
290099, 290100, 290101]

childList is a vector containing all the children of a node.

This is the stack Trace of the exception I am getting:


java.lang.IllegalStateException: Encountered a node [0:0:0] 
+ with an illogical
state.  Node is expanded but it is also considered a leaf 
(a leaf cannot be
considered expanded.
at org.apache.myfaces.custom.tree2.HtmlTreeRenderer.encodeNavigation
(HtmlTreeRenderer.java:463)
at org.apache.myfaces.custom.tree2.HtmlTreeRenderer.encodeCurrentNode
HtmlTreeRenderer.java:346)
at org.apache.myfaces.custom.tree2.HtmlTreeRenderer.encodeTree
(HtmlTreeRenderer.java:248)
at org.apache.myfaces.custom.tree2.HtmlTreeRenderer.encodeTree
(HtmlTreeRenderer.java:276)
at org.apache.myfaces.custom.tree2.HtmlTreeRenderer.
encodeChildren
(HtmlTreeRenderer.java:211)
at javax.faces.component.UIComponentBase.encodeChildren
(UIComponentBase.java:701)
at org.apache.myfaces.renderkit.RendererUtils.renderChild
(RendererUtils.java:444)
at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.
renderChildren
(HtmlGridRendererBase.java:203)
at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.
encodeEnd
(HtmlGridRendererBase.java:85)
at 
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:720)
at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.
java:623)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.
java:546)

It works fine if I replace the while loop with some hard coded node
 values.

Can anybody help plz?

Thanks in advance.
Sanjeev.




Re: [Tobago] How to select rows in sheet ....

2007-01-03 Thread yazid

Thanks Bern; 
I already use the lik to display the row details in another panel;
I've some button (add, addAll,Delete...) to transfert rows between the two
sheet...
I've tried the sheetStateListener , but action for this.


Bernd Bohmann wrote:
> 
> Hello,
> 
> you can add a link to the table row. If the link is pressed this 
> selection would be copy to the second table. Maybe this is a possible 
> solution.
> Please search the mailing list for some answer about
> "get current row from a link in a sheet"
> 
> Regards
> 
> Bernd
> 
> yazid wrote:
>> Exactly, I've to select one or many rows in one sheetand insert them
>> immediatly in the second;
>> 
>> 
>> Bernd Bohmann wrote:
>>> Hello Yazid,
>>>
>>> you want to select one row in the first sheet and immediate add the 
>>> selection to the second sheet?
>>>
>>> Regards
>>>
>>> Bernd
>>>
>>> yazid wrote:
 without inserting a reload facet.
 You should configure freq to 1s, for having a quasi-immediate 
 selection
 in
 server side, but this facet is very time consumming and I've two sheet
 in
 my
 page (one containing a result serach and the second containing the
 selected
 rows from the first);
 Please Help;
>>>
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-Tobago--How-to-select-rows-in-sheet--tf2912753.html#a8150634
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: How to get client browser's resolution.

2007-01-03 Thread Adrian Mitev

Please ignore this post.

2007/1/3, Adrian Mitev <[EMAIL PROTECTED]>:


Hi all! I want to get the width and height of the client brower and
show different styles according to the size. Any suggestions how to do
it?

--
Seeing is believing



Re: How to get client browser's resolution.

2007-01-03 Thread Adrian Mitev

Yes! But i'm wondering how the get it before rendering the first page.

2007/1/3, Volker Weber <[EMAIL PROTECTED]>:


Here is the tobago code:

  var clientDimension
  = this.createInput("hidden", this.form.id + '-clientDimension');
  clientDimension.value
  = document.body.clientWidth + ";" + document.body.clientHeight;
  this.form.appendChild(clientDimension);

Regards,
  Volker

2007/1/3, Adrian Mitev <[EMAIL PROTECTED]>:
> I saw the tobago code. There they have a function for getting the
browser's
> resolution.
>
> 2007/1/3, Gilles Demarty <[EMAIL PROTECTED] >:
> > Hi adrian,
> >
> > a Css Solution :
> >
> > http://alistapart.com/articles/switchymclayout
> >
> > hope this help.
> > Not really related to myfaces, tough.
> >
> > Gilles
> >
> > 2007/1/3, Adrian Mitev <[EMAIL PROTECTED] >:
> > > Hi all! I want to get the width and height of the client brower and
show
> > > different css styles according to the size. Any suggestions how to
do
> it?
> >
>
>



Is there a Tomahawk 1.1.4 final release

2007-01-03 Thread Naresh Bhatia
I see that the nightly builds are now 1.1.5-SNAPSHOT - does that mean
that 1.1.4 was released at some point? If yes, can someone please tell
me where to find it? If no, when can I expect the next release?

Thanks. 

Naresh


Re: Inline validation method

2007-01-03 Thread Simon Kitching

Craig McClanahan wrote:
The "validator" attribute has been there since JSF 1.0 ... it 
corresponds to the getValidator() and setValidator() methods of the 
EditableValueHolder interface.  In a similar way, the "converter" 
attribute has been around since JSF 1.0 on components that implement 
ValueHolder.


Well, I thought I knew the list of available attributes pretty well, but 
completely missed that one. And very useful it is too..


Thanks very much!


Re: Inline validation method

2007-01-03 Thread Craig McClanahan

On 1/3/07, Simon Kitching <[EMAIL PROTECTED]> wrote:


Thanks David.

Is this "validator" attribute something added in JSF 1.2? I'm sure it
doesn't exist in JSF 1.1 (which is what MyFaces 1.1.x supports).



The "validator" attribute has been there since JSF 1.0 ... it corresponds to
the getValidator() and setValidator() methods of the EditableValueHolder
interface.  In a similar way, the "converter" attribute has been around
since JSF 1.0 on components that implement ValueHolder.

Craig


Re: [Tobago} using actionListener to redisplay textbox input value

2007-01-03 Thread Bernd Bohmann

Hello,

I'm not sure that this works.
Please try to surround the tc:link with a tc:form or surround the sheet 
with a tc:form.


Please consult the Forms section in the tobago-demo application.

Regards

Bernd

Wong, Emmanuel (Sam) wrote:

Hi:
I have an application contains 3 tabs, I am trying to use the
2nd tab contains  and able to redisplay what I have selected
on the 2nd tab .  I was not able to redisplay the value by
calling actionListener.  The reason that I am using the actionListener
on the datasheet to bypass the validation error.  If I use


Using ActionListener:

actionListener="#{riskIdentifyController.displaySelectedRisk}" 
	

immediate="true">  







Trying to redisplay the value on :
<%-- rows --%>









If I used action command:

action="#{riskIdentifyController.editRisk}" 
	

tip="#{radarProperty.tip_edit_risk}" >




I will get validation error on the 2nd tab.   Any suggestion



Re: ?

2007-01-03 Thread Mike Kienenberger

Possibly due to the bug in NumberFormat.parse(String source).

http://www-128.ibm.com/developerworks/java/library/j-numberformat/

Try making the changes to the source suggested in this article --
using parse(String source, ParsePosition parsePosition) instead -- and
report back.

If so, please open a jira issue with a patch.

On 1/2/07, Bjørn T Johansen <[EMAIL PROTECTED]> wrote:

I am using the following tag...:



And if I input 5000 den it get displayed as 5 000 after submit... But there is 
one problem, if I submit the
page again, the 5 000 is truncated to 5 (guess because of the space), is this a 
known bug/feature or am I
missing something?



Regards,

BTJ

--
---
Bjørn T Johansen

[EMAIL PROTECTED]
---
Someone wrote:
"I understand that if you play a Windows CD backwards you hear strange Satanic 
messages"
To which someone replied:
"It's even worse than that; play it forwards and it installs Windows"
---



Re: Is it possible to use multiple resource bundles with JSF?

2007-01-03 Thread Craig McClanahan

On 1/3/07, mraible <[EMAIL PROTECTED]> wrote:



Is it possible to use multiple i18n resource bundles with JSF? I'd like to
have a messages.properties for labels, messages and such and an
errors.properties for validation errors. I'd be happy to move to JSF 1.2if
that's a feature not present in 1.1.



In JSP syntax:

   
   
   ...
   
   ...
   

For Facelets or Clay, use the corresponding equivalent to loadBundle to load
multiple individual bundles.

The only restriction is that JSF itself accepts only one resource bundle
name in which to look up replacements for the standard conversion and
validation error messages (section 2.5.2 in the JSF spec).


Thanks,


Matt




Craig


Re: [Tobago] How to select rows in sheet ....

2007-01-03 Thread Bernd Bohmann

Hello,

you can add a link to the table row. If the link is pressed this 
selection would be copy to the second table. Maybe this is a possible 
solution.

Please search the mailing list for some answer about
"get current row from a link in a sheet"

Regards

Bernd

yazid wrote:

Exactly, I've to select one or many rows in one sheetand insert them
immediatly in the second;


Bernd Bohmann wrote:

Hello Yazid,

you want to select one row in the first sheet and immediate add the 
selection to the second sheet?


Regards

Bernd

yazid wrote:

without inserting a reload facet.
You should configure freq to 1s, for having a quasi-immediate  selection
in
server side, but this facet is very time consumming and I've two sheet in
my
page (one containing a result serach and the second containing the
selected
rows from the first);
Please Help;






Re: ?

2007-01-03 Thread Bjørn T Johansen
On Tue, 2 Jan 2007 13:13:37 +0100
Bjørn T Johansen <[EMAIL PROTECTED]> wrote:

> I am using the following tag...:
> 
> 
> 
> And if I input 5000 den it get displayed as 5 000 after submit... But there 
> is one problem, if I submit the
> page again, the 5 000 is truncated to 5 (guess because of the space), is this 
> a known bug/feature or am I
> missing something?
> 
> 
> 
> Regards,
> 
> BTJ
> 

No one knows?

BTJ


Re: [Tobago] How to select rows in sheet ....

2007-01-03 Thread yazid

Exactly, I've to select one or many rows in one sheetand insert them
immediatly in the second;


Bernd Bohmann wrote:
> 
> Hello Yazid,
> 
> you want to select one row in the first sheet and immediate add the 
> selection to the second sheet?
> 
> Regards
> 
> Bernd
> 
> yazid wrote:
>> without inserting a reload facet.
>> You should configure freq to 1s, for having a quasi-immediate  selection
>> in
>> server side, but this facet is very time consumming and I've two sheet in
>> my
>> page (one containing a result serach and the second containing the
>> selected
>> rows from the first);
>> Please Help;
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-Tobago--How-to-select-rows-in-sheet--tf2912753.html#a8148480
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: Inline validation method

2007-01-03 Thread Simon Kitching

Thanks David.

Is this "validator" attribute something added in JSF 1.2? I'm sure it 
doesn't exist in JSF 1.1 (which is what MyFaces 1.1.x supports).


The article doesn't specify what JSF version each of the demonstrated 
features is available in..


Cheers, Simon

David Chandler wrote:

FYI, here's the link to the original article:

http://www-128.ibm.com/developerworks/library/j-jsf3/

It simply illustrates inline validation in JSF 1.1, and Simon is
correct that the bean validator method gets passed a component
reference (along with faces context, and an Object value to validate).

In practice, the easiest way to code the correct signature for a bean
validator method is to use your IDE to auto-create the validate()
method by having your managed bean implement the
javax.faces.validator.Validator interface. The bean doesn't actually
have to implement the interface, nor does the method have to be named
validate, but it's a convenient way to create the code.

/dmc

On 1/2/07, Simon Kitching <[EMAIL PROTECTED]> wrote:

lightbulb432 wrote:
> The text below is a modified excerpt from the IBM article about JSF
> validation...I'm wondering what exactly they're trying to say. What 
do they

> mean by the "value [has] to be generically evaluated with a component
> association in lieu of directly inspecting the local bean
> properties"...what's the issue here?

It would be nice if you gave a URL to the quoted article. I guess this
is some IBM proposal to add a feature to JSF (presumably for the JSF 1.3
or 2.0 releases).

At the point that validation runs, the "update model" phase has not
executed. So if you were to try to access the managed-bean property
specified in the "value" attribute, it wouldn't yet have the new value.
This is really the *point* of validation - checking before updating 
model.


So to get the value to be validated, you must ignore whatever the
"value" attribute points to, and instead get the data directly out of
the JSF component.

I presume their proposed "validator" method gets passed the relevant
UIComponent object (an HtmlInputText in this case).

>
>
>
> The method would then be used in the JSF tag via the validator 
attribute as

> shown here:
>
>   value="#{UserRegistration.user.email}"
>validator="#{UserRegistration.validateEmail}"
>required="true">
>   
>
> The validateEmail method is used by JSF to perform custom validation 
on an

> inputText component value bound to a user.email model property. If the
> e-mail format is invalid, then a message is added to the faces 
context for
> the associated component. Now, considering that this validation 
method is
> actually part of the backing bean, why does the value have to be 
generically
> evaluated with a component association in lieu of directly 
inspecting the

> local bean properties? For a hint, look at the prior lifecycle figures.
> Don't worry if you can't quite figure it out right now; we'll 
explain it all

> at the end of the article.
>
> Why, if a validation method is actually part of a backing bean, must 
its

> value be generically evaluated with a component association?
>
> The trick here is that, although the validateEmail inline validation 
method
> is part of the actual backing bean, the method must reference the 
value via
> component association rather than accessing the local properties 
directly.
> Because validation occurs before the component values are bound to 
the model

> (in the update model values phase), the model is in an unknown state.
> Therefore, you must write the inline custom validation logic as if 
it were
> dealing with validation in a custom Validator object. This is also 
explains

> the requirement of maintaining the same method signature.









Re: where to find doc

2007-01-03 Thread Simon Kitching

anoe wrote:

hi everyone, sure this has already been posted, i am trying to use myfaces
with tomahawk 1.1.5 but can't find proper doc, i am reading the doc for
different components is described in the examples but i am executing them,
looking in the source code... and can find none. Any help? Thanks.


http://myfaces.apache.org/javadoc.html



[Tobago} using actionListener to redisplay textbox input value

2007-01-03 Thread Wong, Emmanuel \(Sam\)
Hi:
I have an application contains 3 tabs, I am trying to use the
2nd tab contains  and able to redisplay what I have selected
on the 2nd tab .  I was not able to redisplay the value by
calling actionListener.  The reason that I am using the actionListener
on the datasheet to bypass the validation error.  If I use


Using ActionListener:

   







Trying to redisplay the value on :
<%-- rows --%>





  



If I used action command:






I will get validation error on the 2nd tab.   Any suggestion


Re: Tobago progress bar

2007-01-03 Thread Bernd Bohmann

Hello Simeon,

unfortunately it is not possible to mix tobago and tomahawk controls. 
See: http://myfaces.apache.org/tobago/faq.html#tobago/myfaces%20extension


Maybe in a future version it is possible to mix tobago and tomahawk 
controls, but this requires some none trival changes and extensions in 
tobago.


Regards

Bernd

Leyzerzon, Simeon wrote:

Hi,

Is it possible to use progress bar component of Tobago within an application that is using Tomahawk controls.  Or are there any other implementations of progress bar in JSF?  


Some code samples will be helpful.

Thank you in advance.

Simeon L


==
Please access the attached hyperlink for an important electronic communications disclaimer: 


http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==



Re: [Tobago] How to select rows in sheet ....

2007-01-03 Thread Bernd Bohmann

Hello Yazid,

you want to select one row in the first sheet and immediate add the 
selection to the second sheet?


Regards

Bernd

yazid wrote:

without inserting a reload facet.
You should configure freq to 1s, for having a quasi-immediate  selection in
server side, but this facet is very time consumming and I've two sheet in my
page (one containing a result serach and the second containing the selected
rows from the first);
Please Help;


Is it possible to use multiple resource bundles with JSF?

2007-01-03 Thread mraible

Is it possible to use multiple i18n resource bundles with JSF? I'd like to
have a messages.properties for labels, messages and such and an
errors.properties for validation errors. I'd be happy to move to JSF 1.2 if
that's a feature not present in 1.1.

Thanks,

Matt
-- 
View this message in context: 
http://www.nabble.com/Is-it-possible-to-use-multiple-resource-bundles-with-JSF--tf2915194.html#a8146116
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: [Tobago] Curious Problem : several buton inside same tab

2007-01-03 Thread Bernd Bohmann

Hello Yazid,

can you send a simple jsp page for this, please?

Regards

Bernd

yazid wrote:

Hi Bernd;
I'm using the snapshot 1.0.9
no switchType (default)


Bernd Bohmann wrote:

Hello Yazid,

which version of tobago are you using?

switchType of tabGroup?

Regards

Bernd

yazid wrote:

Hi All ;
I’ve a strange behaviour of button.
In a tab containing two panel


   
  
 
……….







in the same tab I’ve another form
 
   
   

The first button work fine; but the second’s action is never invoked;
instead of invoking “ method2” when pressing the second button; the
setAtrribute of the bean1 is invoked







Re: How to get client browser's resolution.

2007-01-03 Thread Volker Weber

Here is the tobago code:

 var clientDimension
 = this.createInput("hidden", this.form.id + '-clientDimension');
 clientDimension.value
 = document.body.clientWidth + ";" + document.body.clientHeight;
 this.form.appendChild(clientDimension);

Regards,
 Volker

2007/1/3, Adrian Mitev <[EMAIL PROTECTED]>:

I saw the tobago code. There they have a function for getting the browser's
resolution.

2007/1/3, Gilles Demarty <[EMAIL PROTECTED] >:
> Hi adrian,
>
> a Css Solution :
>
> http://alistapart.com/articles/switchymclayout
>
> hope this help.
> Not really related to myfaces, tough.
>
> Gilles
>
> 2007/1/3, Adrian Mitev <[EMAIL PROTECTED] >:
> > Hi all! I want to get the width and height of the client brower and show
> > different css styles according to the size. Any suggestions how to do
it?
>




Re: changing styles in tobago

2007-01-03 Thread Volker Weber

Hi Sascha,

you can add (and configure in the tobago-config.xml) a resource
directory for tobago to your application.

in this directory you need to create the tobago resource directroy
structure and there you can put a file "style.css" to overwrite the
styles.

e.g. to change the background color of the box in speyside theme to yellow:

1. create a directory "tobago-resource" in your webapp.
2. configure this directory as tobago resource directory in tobago-config.xml
tobago-resource
3. create the tobago resource directory stucture in this directory
   "html/speyside/standard/style"
4. create a file with name "style.css" here with this content:
 .tobago-box-content {
   background: yellow;
 }

thats all.

But be carefull changing any other than colors! You may destroy the
layout, because layout calculation depends on the "known" sizes,
borders, margins etc.

Regards,
 Volker


2007/1/3, Sascha Djuric <[EMAIL PROTECTED]>:

Hello people

Im fairly new to MyFaces/Tobago. I just finished doing my first application 
with Tobago and everything seems fine, just I should change its appearance 
according to company rules. Now I dont want to create my own theme, but Tobago 
offers no style or styleClass attributes. What is the easiest way to change css 
parameters in tobago?

Thanks in advance
  Sasa



How to get client browser's resolution.

2007-01-03 Thread Adrian Mitev

Hi all! I want to get the width and height of the client brower and
show different styles according to the size. Any suggestions how to do
it?

--
Seeing is believing


changing styles in tobago

2007-01-03 Thread Sascha Djuric
Hello people 

Im fairly new to MyFaces/Tobago. I just finished doing my first application 
with Tobago and everything seems fine, just I should change its appearance 
according to company rules. Now I dont want to create my own theme, but Tobago 
offers no style or styleClass attributes. What is the easiest way to change css 
parameters in tobago?

Thanks in advance
  Sasa


Change SelectMenu default value

2007-01-03 Thread Sam_arb

Hi,
I have a form where the default value of a SelectOneMenu item is dependent
on a Date field value and associated validations. 
When the user enters a date in the date field, a date comparision logic
along with a check of another static value, decides the value of the
selectitem of the SelectOneMenu to be displayed on the page. This is
entirely a client side operation, before any buttons/links are clicked or
form submitted.

I was thinking of using javascript , but javascript and jsf  dont go well
together.
My second thought is to use a cleint side validator, but am not sure how to
do this. 
What is the best way to do this? Your suggestions are most appreciated.

Regards,
Sam.
-- 
View this message in context: 
http://www.nabble.com/Change-SelectMenu-default-value-tf2914395.html#a8143535
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: How to get client browser's resolution.

2007-01-03 Thread Adrian Mitev

I saw the tobago code. There they have a function for getting the browser's
resolution.

2007/1/3, Gilles Demarty <[EMAIL PROTECTED]>:


Hi adrian,

a Css Solution :

http://alistapart.com/articles/switchymclayout

hope this help.
Not really related to myfaces, tough.

Gilles

2007/1/3, Adrian Mitev <[EMAIL PROTECTED]>:
> Hi all! I want to get the width and height of the client brower and show
> different css styles according to the size. Any suggestions how to do
it?



Re: How to get client browser's resolution.

2007-01-03 Thread Gilles Demarty

Hi adrian,

a Css Solution :

http://alistapart.com/articles/switchymclayout

hope this help.
Not really related to myfaces, tough.

Gilles

2007/1/3, Adrian Mitev <[EMAIL PROTECTED]>:

Hi all! I want to get the width and height of the client brower and show
different css styles according to the size. Any suggestions how to do it?


RE: How to get client browser's resolution.

2007-01-03 Thread Nebinger, David
There is no standard method for this on the browser or the server, and 
generally trying to code for this is bad practice anyways.
 
Imagine, for a second, that you did some sort of magic to get the dimensions 
and depth, which you then pass to the server which returns the page with the 
necessary styles defined.  Now the browser has displayed/rendered the page, and 
the user manually changes the size of the window (maximize, minimize, restore), 
the color depth, etc.  None of these things automagically cause a page reload, 
so all of that complicated stuff you went through to get a pretty page at some 
resolution now looks like crap.
 

-Original Message-
From: Adrian Mitev [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 03, 2007 10:39 AM
To: MyFaces Discussion
Subject: How to get client browser's resolution.


Hi all! I want to get the width and height of the client brower and show 
different css styles according to the size. Any suggestions how to do it? 



How to get client browser's resolution.

2007-01-03 Thread Adrian Mitev

Hi all! I want to get the width and height of the client brower and show
different css styles according to the size. Any suggestions how to do it?


http://issues.apache.org/jira/browse/TOMAHAWK-508

2007-01-03 Thread Bharath Belagodu
The problem http://issues.apache.org/jira/browse/TOMAHAWK-508 reported
is happening with the latest build. Anyone has information on when this
would be addressed or a workaround. 

 

Static menus may be the route to take but I'd like to defer if we have
any alternatives to address the problem.

 



RE: does not work properly when added programmatically- Any help

2007-01-03 Thread Madhav Bhargava

Hi David,

Thanks for a quick response. I changed the way encoding is done to what you 
have suggested.
I have overridden the getRendersChildren method to return true so that 
encodeChildren of this custom component will only get called.

However if you look at the code of HtmlNavigationMenuRenderer - renderer for 
 you will find that getRenderesChildren will return true. 
This means that in the method that you have provided following will happen:

Note: There is only one child HtmlPanelNavigationMenu for this custom 
component. This component in turn has many HtmlCommandNavigationItem components.

1. child.encodeBegin gets called
2. child.encodeChildren gets called
3. child.encodeEnd gets called.

Child component passed is HtmlPanelNavigationMenu.

Unfortunately nothing changes. Problems persist the way they were.

Rgds,
madhav

> -Original Message-
> From: David Delbecq [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 03, 2007 7:24 PM
> To: MyFaces Discussion
> Subject: Re:  does not work properly when added
> programmatically- Any help
>
> En l'instant précis du 01/03/07 14:17, Madhav Bhargava s'exprimait dans
> toute sa noblesse:
> >
> > Hi All,
> >
> >
> >
> > In the encodeBegin method of this custom component the
> >  component is constructed programmatically.
> >
> >
> >
> > In the Renderer for this custom component encodeBegin looks like:
> >
> >
> >
> > checkState(context, component);
> >
> > super.encodeChildren(context, component);
> >
> > //Call encodeChildren on all the child components of this component
> >
> > List children = component.getChildren();
> >
> > if (null != children) {
> >
> > Iterator childIter = children.iterator();
> >
> > while(childIter.hasNext()) {
> >
> > UIComponent childComponent =
> > (UIComponent)childIter.next();
> >
> > childComponent.encodeChildren(context);
> >
> The above line is suspicious. If you want to handle yourself your
> component's child rendering process, you must do it more cleanly. Most
> component don't render their childs by themselve. Most probably, your
> call to encodeChildren() only do a partial work, explaining difference
> you get.
>
> Here is an example code i use when i need in a custom rendered to manage
> myself rendering of childrens:
>
> private void encodeChild(FacesContext context,UIComponent child)
> throws IOException{
>
> if (!child.isRendered())
> {
> return;
> }
>
> child.encodeBegin(context);
> if (child.getRendersChildren())
> {
> child.encodeChildren(context);
> }
> else
> {
> for (int i = 0;i< child.getChildren().size(); i++)
> encodeChild(context,
> (UIComponent)child.getChildren().get(i));
> }
> child.encodeEnd(context);
> }
>
> Just call this method when you need to render one of your childs.
> don't forget to override the getRendersChildren() and encodeChildren()
> of your custom component btw.


 CAUTION - Disclaimer *
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not to copy, disclose, or distribute this e-mail or its contents to any other 
person and any such actions are unlawful. This e-mail may contain viruses. 
Infosys has taken every reasonable precaution to minimize this risk, but is not 
liable for any damage you may sustain as a result of any virus in this e-mail. 
You should carry out your own virus checks before opening the e-mail or 
attachment. Infosys reserves the right to monitor and review the content of all 
messages sent to or from this e-mail address. Messages sent to or from this 
e-mail address may be stored on the Infosys e-mail system.
***INFOSYS End of Disclaimer INFOSYS***


Tobago progress bar

2007-01-03 Thread Leyzerzon, Simeon
Hi,

Is it possible to use progress bar component of Tobago within an application 
that is using Tomahawk controls.  Or are there any other implementations of 
progress bar in JSF?  

Some code samples will be helpful.

Thank you in advance.

Simeon L


==
Please access the attached hyperlink for an important electronic communications 
disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==


Re: does not work properly when added programmatically - Any help

2007-01-03 Thread David Delbecq
En l'instant précis du 01/03/07 14:17, Madhav Bhargava s'exprimait dans
toute sa noblesse:
>
> Hi All,
>
>  
>
> In the encodeBegin method of this custom component the
>  component is constructed programmatically.
>
>  
>
> In the Renderer for this custom component encodeBegin looks like:
>
>  
>
> checkState(context, component);
>
> super.encodeChildren(context, component);
>
> //Call encodeChildren on all the child components of this component
>
> List children = component.getChildren();
>
> if (null != children) {
>
> Iterator childIter = children.iterator();
>
> while(childIter.hasNext()) {
>
> UIComponent childComponent =
> (UIComponent)childIter.next();
>
> childComponent.encodeChildren(context);
>
The above line is suspicious. If you want to handle yourself your
component's child rendering process, you must do it more cleanly. Most
component don't render their childs by themselve. Most probably, your
call to encodeChildren() only do a partial work, explaining difference
you get.

Here is an example code i use when i need in a custom rendered to manage
myself rendering of childrens:

private void encodeChild(FacesContext context,UIComponent child)
throws IOException{

if (!child.isRendered())
{
return;
}

child.encodeBegin(context);
if (child.getRendersChildren())
{
child.encodeChildren(context);
}
else
{
for (int i = 0;i< child.getChildren().size(); i++)
encodeChild(context,
(UIComponent)child.getChildren().get(i));
}
child.encodeEnd(context);  
}

Just call this method when you need to render one of your childs.
don't forget to override the getRendersChildren() and encodeChildren()
of your custom component btw.



Re: Inline validation method

2007-01-03 Thread David Chandler

FYI, here's the link to the original article:

http://www-128.ibm.com/developerworks/library/j-jsf3/

It simply illustrates inline validation in JSF 1.1, and Simon is
correct that the bean validator method gets passed a component
reference (along with faces context, and an Object value to validate).

In practice, the easiest way to code the correct signature for a bean
validator method is to use your IDE to auto-create the validate()
method by having your managed bean implement the
javax.faces.validator.Validator interface. The bean doesn't actually
have to implement the interface, nor does the method have to be named
validate, but it's a convenient way to create the code.

/dmc

On 1/2/07, Simon Kitching <[EMAIL PROTECTED]> wrote:

lightbulb432 wrote:
> The text below is a modified excerpt from the IBM article about JSF
> validation...I'm wondering what exactly they're trying to say. What do they
> mean by the "value [has] to be generically evaluated with a component
> association in lieu of directly inspecting the local bean
> properties"...what's the issue here?

It would be nice if you gave a URL to the quoted article. I guess this
is some IBM proposal to add a feature to JSF (presumably for the JSF 1.3
or 2.0 releases).

At the point that validation runs, the "update model" phase has not
executed. So if you were to try to access the managed-bean property
specified in the "value" attribute, it wouldn't yet have the new value.
This is really the *point* of validation - checking before updating model.

So to get the value to be validated, you must ignore whatever the
"value" attribute points to, and instead get the data directly out of
the JSF component.

I presume their proposed "validator" method gets passed the relevant
UIComponent object (an HtmlInputText in this case).

>
>
>
> The method would then be used in the JSF tag via the validator attribute as
> shown here:
>
>   value="#{UserRegistration.user.email}"
>validator="#{UserRegistration.validateEmail}"
>required="true">
>   
>
> The validateEmail method is used by JSF to perform custom validation on an
> inputText component value bound to a user.email model property. If the
> e-mail format is invalid, then a message is added to the faces context for
> the associated component. Now, considering that this validation method is
> actually part of the backing bean, why does the value have to be generically
> evaluated with a component association in lieu of directly inspecting the
> local bean properties? For a hint, look at the prior lifecycle figures.
> Don't worry if you can't quite figure it out right now; we'll explain it all
> at the end of the article.
>
> Why, if a validation method is actually part of a backing bean, must its
> value be generically evaluated with a component association?
>
> The trick here is that, although the validateEmail inline validation method
> is part of the actual backing bean, the method must reference the value via
> component association rather than accessing the local properties directly.
> Because validation occurs before the component values are bound to the model
> (in the update model values phase), the model is in an unknown state.
> Therefore, you must write the inline custom validation logic as if it were
> dealing with validation in a custom Validator object. This is also explains
> the requirement of maintaining the same method signature.





--
David Chandler
Development Coach
learnjsf.com


server side state saving and session timeout

2007-01-03 Thread Rogerio Pereira

Hi guys!

Somebody had problems with server side state saving and session timeout,
somebody found a way to handle this situation?

--
Yours truly (Atenciosamente),

Rogério (_rogerio_)
http://faces.eti.br

"Faça a diferença! Ajude o seu país a crescer, não retenha conhecimento,
distribua e aprenda mais." (http://faces.eti.br/?p=45)


does not work properly when added programmatically - Any help

2007-01-03 Thread Madhav Bhargava

Hi All,



I have a custom component which contains HtmlPanelNavigationMenu  -
component class for .

This in turn contains a number of  - component
class HtmlCommandNavigationItem



This is how I create the  component:



HtmlPanelNavigationMenu panelNavigationComponent =
(HtmlPanelNavigationMenu)app.createComponent(HtmlPanelNavigationMenu.COM
PONENT_TYPE);

panelNavigationComponent.setId("leftNav");

panelNavigationComponent.setLayout("list");

// Set the CSS classes for the panelNavigation2 component

panelNavigationComponent.setActiveItemClass("navSelected");

panelNavigationComponent.setOpenItemClass("navOpen");

panelNavigationComponent.setItemClass("navNormal");



//Adding child  components



Element rootElem = doc.getRootElement();

List children = rootElem.getChildren();

Iterator parentIter = children.iterator();

//Iterate through the children

while (parentIter.hasNext()) {

HtmlCommandNavigationItem commandNavigationItem = null;

Element node = (Element) parentIter.next();

if ("true".equals(node.getAttributeValue("visible"))) {

commandNavigationItem =
(HtmlCommandNavigationItem)
app.createComponent(HtmlCommandNavigationItem.COMPONENT_TYPE);


commandNavigationItem.setId(node.getAttributeValue("id"));

FacesUtils.setAction(commandNavigationItem,
node.getAttributeValue("action"));

commandNavigationItem.setImmediate(true);

// Create the panel grid

HtmlPanelGrid panelGrid = (HtmlPanelGrid)
app.createComponent(HtmlPanelGrid.COMPONENT_TYPE);

panelGrid.setColumns(2);

HtmlGraphicImage image = (HtmlGraphicImage)
app.createComponent(HtmlGraphicImage.COMPONENT_TYPE);

image.setUrl(node.getAttributeValue("imgurl"));

HtmlOutputText outputText = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);

FacesUtils.setValueBinding(outputText, "value",
node.getAttributeValue("text"));

panelGrid.getChildren().add(image);

panelGrid.getChildren().add(outputText);

// Add the panel Grid component to the
commandNavigation

// component


commandNavigationItem.getChildren().add(panelGrid);


commandNavigationItem.setParent(panelNavigationComponent);

//recursively add child components to the parent
component

addChildComponents(node, commandNavigationItem);

//Add the commandNavigation2 parent component to
the panelNavigation2 component


panelNavigationComponent.getChildren().add(commandNavigationItem);

}

}

this.getChildren().add(panelNavigationComponent);

}



//Method to recursively add child  components to
create a multi level left navigation

FacesContext context = FacesContext.getCurrentInstance();

Application app = context.getApplication();

// Exit condition

if (null == parent.getChildren())

return;

List children = parent.getChildren();

Iterator childIter = children.iterator();

while (childIter.hasNext()) {

Element child = (Element) childIter.next();

if ("true".equals(child.getAttributeValue("visible"))) {

HtmlCommandNavigationItem childComponent =
(HtmlCommandNavigationItem)
app.createComponent(HtmlCommandNavigationItem.COMPONENT_TYPE);


childComponent.setId(child.getAttributeValue("id"));

FacesUtils.setAction(childComponent,
child.getAttributeValue("action"));

HtmlOutputText outputText = (HtmlOutputText)
app.createComponent(HtmlOutputText.COMPONENT_TYPE);

FacesUtils.setValueBinding(outputText, "value",
child.getAttributeValue("text"));

childComponent.getChildren().add(outputText);

childComponent.setParent(component);

childComponent.setImmediate(true);

// Add the child component

component.getChildren().add(childComponent);

// recursive call

addChildComponents(child, childComponent);

}

}





In the encodeBegin method of this custom component the
 component is constructed programmatically.



In the Renderer for this custom component encodeBegin looks like:



checkState(context, component);

super.encodeChildren(context, component);

//Call encodeChildren on all the child components of this component

List children = component.getChildren();

if (null != children) {

Iterator childIter = children.iterator();

while(childIter.hasNext()) {

UIComponent childComponent =
(UIComponent)childIter.next();

childComponent.encodeChildren(cont

table row within tree2

2007-01-03 Thread terro

Hello,

I am using Sun JSF 1.1 and Tomahawk 1.1.3
I have a dynamically created table, which is created using c:forEach.
Now within this table, and for each row, I would like to add the tree2
functionality.

Therefore when a user clicks on a row (the + sign or whatever), this row
extends into more rows.

Any idea how I can implement this into tree2?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/table-row-within-tree2-tf2913077.html#a8139522
Sent from the MyFaces - Users mailing list archive at Nabble.com.



TabbedPane skip validation but not field input values

2007-01-03 Thread ziofanale

Hello ,

I'm quite new to MyFaces/JSF ..

 I've got a t:panelTabbedPane inside a form with 3 t:panelTabs with several
fields on each tab.

Being everything included in just one form , submitting the first tab fields
causes validation to be fired on required fields
on the other two tabs.

I tried to set immediate="true" on action commandlink/commandbuttons . This
skips validation but  I get null values
for the fields in action methods..

The solution in posts on this forum seem to be writing an actionlistener to
fill bean properties with user input values .. but how ?

Any suggestion would be greatly very appreciated

Thanks

Felice Castelletti
-- 
View this message in context: 
http://www.nabble.com/TabbedPane-skip-validation-but-not-field-input-values-tf2912864.html#a8138948
Sent from the MyFaces - Users mailing list archive at Nabble.com.



[Tobago] How to select rows in sheet ....

2007-01-03 Thread yazid

without inserting a reload facet.
You should configure freq to 1s, for having a quasi-immediate  selection in
server side, but this facet is very time consumming and I've two sheet in my
page (one containing a result serach and the second containing the selected
rows from the first);
Please Help;
-- 
View this message in context: 
http://www.nabble.com/-Tobago--How-to-select-rows-in-sheet--tf2912753.html#a8138623
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: binding / selectOneMenu in dataTable

2007-01-03 Thread [EMAIL PROTECTED]

The selectOneMenu binding object is null. And this is my code:

Here is the dataTable:
cellspacing="0"
columnClasses="defaultCol" headerClass="tableHead" 
style="cursor:pointer; vertical-align:top"

rowClasses="zebraTableContentOdd,zebraTableContentEven" rows="20"
value="#{packageLines.packageLineList}" 
var="packageLine">


In the dataTable there is a column. As you can see, there is a binding 
for the selectOneMenu:


 
   
 value="#{message['lineAllocation.tableColumn.productionLine']}">

   
   validator="#{packageLine.validateLineSelection}"
value="#{packageLine.selectedLine}" 
binding="#{packageLine.oneMenu}">

 
   
 

The selectOneMenu is declared as:

import org.apache.myfaces.component.html.ext.HtmlSelectOneMenu;
private HtmlSelectOneMenu oneMenu;

public HtmlSelectOneMenu getOneMenu() {
   return oneMenu;
 }

 public void setOneMenu(HtmlSelectOneMenu oneMenu) {
   this.oneMenu = oneMenu;
 }

And heres the validation method:

public void validateLineSelection(FacesContext context, UIComponent 
component,

 Object value) {
   logger.info(getOneMenu());
}

The problem is, that the oneMenu Object is null. I need access to each 
SelectOneMenu object of the table, because I have to check the selected 
client values.


Any hints what I have done wrong?

Heiko

Simon Kitching wrote:

[EMAIL PROTECTED] wrote:
Hi, I have a t:selectOneMenu in a t:dataTable. The dataTable consists 
of wrappers, which has the selectOneMenu bound to:


private HtmlSelectOneMenu oneMenu

I want to check for all oneMenu as a double match isn't allowed. To 
compare the selected values I must have access to the oneMenu object. 
But this is always null. So I can't use the 
getOneMenu().getLocalValue() method to access the clients value in 
the validator.


Does anybody now what I have done wrong? Or is this a bug in the 
dataTable?


I'm having trouble understanding what your setup is. Please post the 
relevant fragment of JSP, and any relevant java code.


Cheers,  Simon





Re: myFaces Schedule entry clicked

2007-01-03 Thread anoe

For me, the problem is, the example in tomahawk 1.1.5 is not working at all,
i mean, i even don't know how is it supposed to be working, 'cause i have
very little doc about the componn ent and don't know where to find it. Is it
supposed to do something when you click in the scheduler?

tx


tsm80 wrote:
> 
> Anyone?
> 
> 
> tsm80 wrote:
>> 
>> Hello! I have EXACTLY the same problem: when i left-click an entry in the
>> Schedule it redirects me to the login page of my application, when i
>> right-click on it, it executes the correct action method. Has anyone
>> found a solution for this problem? It's pretty buggy...
>> 
>> 
>> 
>> Jurgen Lust-2 wrote:
>>> 
>>> Strange... Could you send me the code of your JSP and your managed
>>> beans?
>>> 
>>> Jurgen
>>> 
>>> 2006/6/18, koRo <[EMAIL PROTECTED]>:


 Yes, I did. First I had one form for the whole page, but I also tried
 putting
 the schedule in a sepperated form, with the same result.
 --
 View this message in context:
 http://www.nabble.com/myFaces-Schedule-entry-clicked-t1798196.html#a4922746
 Sent from the MyFaces - Users forum at Nabble.com.


>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/myFaces-Schedule-entry-clicked-tf1798196.html#a8137544
Sent from the MyFaces - Users mailing list archive at Nabble.com.



where to find doc

2007-01-03 Thread anoe

hi everyone, sure this has already been posted, i am trying to use myfaces
with tomahawk 1.1.5 but can't find proper doc, i am reading the doc for
different components is described in the examples but i am executing them,
looking in the source code... and can find none. Any help? Thanks.
-- 
View this message in context: 
http://www.nabble.com/where-to-find-doc-tf2912357.html#a8137440
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: [Tobago] Curious Problem : several buton inside same tab

2007-01-03 Thread yazid

Hi Bernd;
I'm using the snapshot 1.0.9
no switchType (default)


Bernd Bohmann wrote:
> 
> Hello Yazid,
> 
> which version of tobago are you using?
> 
> switchType of tabGroup?
> 
> Regards
> 
> Bernd
> 
> yazid wrote:
>> Hi All ;
>> I’ve a strange behaviour of button.
>> In a tab containing two panel
>> 
>> 
>> 
>>   
>>  
>> ……….
>> 
>> 
>> 
>> 
>> 
>> 
>> in the same tab I’ve another form
>>  
>>
>>http://www.nabble.com/-Tobago--Curious-Problem-%3A-several-buton-inside-same-tab-tf2910058.html#a8137437
Sent from the MyFaces - Users mailing list archive at Nabble.com.