Re: Why does JSF submit through JavaScript?

2007-02-22 Thread David Delbecq
Well that's the problem, if you don't want to use javascript and want to
submit a form, all you can do is use a button.
Replacing your link with buttons might be odd, but with a bit o css, you
can remove all borders and margin around the button, make it inline
paragraph and have it look like a link :)

En l'instant précis du 02/22/07 11:02, Veit Guna s'exprimait en ces termes:
> Hi.
>
> Normally, you want to execute some view logic when pressing a link - not
> only to post forms. Since the JS-free outputLink doesn't have an action
> attribute, this can't be used for a replacement for commandLink.
> Replacing all links with buttons seems odd to me...
>
> No other solutions?
>
> regards,
> Veit
>
>
> Simon Kitching schrieb:
>   
>> Replacing all commandLinks with commandButtons seems the best solution
>> to me. After all, if you were using some other tech like CGI or PHP or
>> whatever you still couldn't submit a form using an  tag without
>> javascript. It's just not possible with HTML.
>>
>> The h:commandLink tag is really an optional feature over and above
>> normal html, which is why javascript is needed to implement it on the
>> client side.
>>
>> Note that this only applies where the link *submits a form*. Ordinary
>> links can be output using h:outputLink - but they won't submit the form.
>>
>>
>> lightbulb432 wrote:
>> 
>>> I see, so what do developers of JSF applications generally do -
>>> replace all
>>> commandLinks with commandButtons, or only users with JavaScript
>>> enabled to
>>> access their site? What strategy do some of you use with regards to users
>>> out there who don't enable JavaScript (which isn't as small a number as I
>>> would've thought)
>>>
>>>
>>>
>>> craigmcc wrote:
>>>   
 On 12/21/06, lightbulb432 <[EMAIL PROTECTED]> wrote:
 
> Why does JSF always use JavaScript to submit a form rather than through
> the
> regular method of form submission?
>   
 That only happens for a commandLink component (i.e. a hyperlink that
 is to
 submit a form).  If you use a commandButton component, no JavaScript is
 needed.

 Is your entire JSF web application useless for clients that have
 JavaScript
 
> turned off?
>   
 Only for hyperlinks.  If you can describe a way to have a hyperlink
 submit
 a
 form, without Javascript being enabled, we would love to hear it.

 Craig


 




Re: Why does JSF submit through JavaScript?

2007-02-22 Thread David Delbecq
Agree, it's the same for javascript, crawlers don't use it. You have 2
possible case
1) there is a form to proceed. Then you can use button, you anyway don't
want your crawler to submit your forms
2) There is no form to proceed. Then you can use the simple outputLink.

En l'instant précis du 02/22/07 12:53, Veit Guna s'exprimait en ces termes:
> :).
>
> For form submit's - I'm on your side. But for simple links? Also I don't
> think that searchengines will press buttons when they crawl a page
> because usually buttons submit forms :)...
>
>
>
> David Delbecq schrieb:
>   
>> Well that's the problem, if you don't want to use javascript and want to
>> submit a form, all you can do is use a button.
>> Replacing your link with buttons might be odd, but with a bit o css, you
>> can remove all borders and margin around the button, make it inline
>> paragraph and have it look like a link :)
>>
>> En l'instant précis du 02/22/07 11:02, Veit Guna s'exprimait en ces termes:
>> 
>>> Hi.
>>>
>>> Normally, you want to execute some view logic when pressing a link - not
>>> only to post forms. Since the JS-free outputLink doesn't have an action
>>> attribute, this can't be used for a replacement for commandLink.
>>> Replacing all links with buttons seems odd to me...
>>>
>>> No other solutions?
>>>
>>> regards,
>>> Veit
>>>
>>>
>>> Simon Kitching schrieb:
>>>   
>>>   
>>>> Replacing all commandLinks with commandButtons seems the best solution
>>>> to me. After all, if you were using some other tech like CGI or PHP or
>>>> whatever you still couldn't submit a form using an  tag without
>>>> javascript. It's just not possible with HTML.
>>>>
>>>> The h:commandLink tag is really an optional feature over and above
>>>> normal html, which is why javascript is needed to implement it on the
>>>> client side.
>>>>
>>>> Note that this only applies where the link *submits a form*. Ordinary
>>>> links can be output using h:outputLink - but they won't submit the form.
>>>>
>>>>
>>>> lightbulb432 wrote:
>>>> 
>>>> 
>>>>> I see, so what do developers of JSF applications generally do -
>>>>> replace all
>>>>> commandLinks with commandButtons, or only users with JavaScript
>>>>> enabled to
>>>>> access their site? What strategy do some of you use with regards to users
>>>>> out there who don't enable JavaScript (which isn't as small a number as I
>>>>> would've thought)
>>>>>
>>>>>
>>>>>
>>>>> craigmcc wrote:
>>>>>   
>>>>>   
>>>>>> On 12/21/06, lightbulb432 <[EMAIL PROTECTED]> wrote:
>>>>>> 
>>>>>> 
>>>>>>> Why does JSF always use JavaScript to submit a form rather than through
>>>>>>> the
>>>>>>> regular method of form submission?
>>>>>>>   
>>>>>>>   
>>>>>> That only happens for a commandLink component (i.e. a hyperlink that
>>>>>> is to
>>>>>> submit a form).  If you use a commandButton component, no JavaScript is
>>>>>> needed.
>>>>>>
>>>>>> Is your entire JSF web application useless for clients that have
>>>>>> JavaScript
>>>>>> 
>>>>>> 
>>>>>>> turned off?
>>>>>>>   
>>>>>>>   
>>>>>> Only for hyperlinks.  If you can describe a way to have a hyperlink
>>>>>> submit
>>>>>> a
>>>>>> form, without Javascript being enabled, we would love to hear it.
>>>>>>
>>>>>> Craig
>>>>>>
>>>>>>
>>>>>> 
>>>>>> 
>> 



Re: session scoped Bean created twice!

2007-02-22 Thread David Delbecq
Did you check that the session associated with those 2 session beans is
the same? If the ajax component gets confused client side, it might be
that it is handling in fact 2 different session, and the posting the
resize event to each session.

En l'instant précis du 02/22/07 14:07, Michael Heinen s'exprimait en ces
termes:
> One of my session scoped beans is created two times.
>
>  
>
> I call an ajax actionListener (a4j:commandlink) via JS when the user
> resizes the browser window.
>
> The onresize event of the documentBody is fired multiple times during
> resizing.
>
> Therefore my actionListener is also called multiple times which is not a
> problem because I just reset some values and don't refresh anything on
> the screen.
>
>  
>
> But during debugging I noticed, that the session scoped bean of the
> ActionListener is initialized twice with two different object ids.
>
> The ActionListeners are called for both instances of the Bean!!!
>
> What's the reason for that ?
>
>  
>
> When I resize the browser window a second time after the first resizing
> finished
>
> then the ActionListener of the second created bean is executed only.
>
>  
>
> I use:
>
> MyFacesCore 1.1.4 
>
> tomahawk snapshot 1.1.4 
>
> a4j 1.0.6
>
>  
>
> Any help is appreciated
>
> Michael
>
>  
>
>  
>
>
>   



Re: Why does JSF submit through JavaScript?

2007-02-23 Thread David Delbecq
Well that's the problem, if you don't want to use javascript and want to
submit a form, all you can do is use a button.
Replacing your link with buttons might be odd, but with a bit o css, you
can remove all borders and margin around the button, make it inline
paragraph and have it look like a link :)

En l'instant précis du 02/22/07 11:02, Veit Guna s'exprimait en ces termes:
> Hi.
>
> Normally, you want to execute some view logic when pressing a link - not
> only to post forms. Since the JS-free outputLink doesn't have an action
> attribute, this can't be used for a replacement for commandLink.
> Replacing all links with buttons seems odd to me...
>
> No other solutions?
>
> regards,
> Veit
>
>
> Simon Kitching schrieb:
>   
>> Replacing all commandLinks with commandButtons seems the best solution
>> to me. After all, if you were using some other tech like CGI or PHP or
>> whatever you still couldn't submit a form using an  tag without
>> javascript. It's just not possible with HTML.
>>
>> The h:commandLink tag is really an optional feature over and above
>> normal html, which is why javascript is needed to implement it on the
>> client side.
>>
>> Note that this only applies where the link *submits a form*. Ordinary
>> links can be output using h:outputLink - but they won't submit the form.
>>
>>
>> lightbulb432 wrote:
>> 
>>> I see, so what do developers of JSF applications generally do -
>>> replace all
>>> commandLinks with commandButtons, or only users with JavaScript
>>> enabled to
>>> access their site? What strategy do some of you use with regards to users
>>> out there who don't enable JavaScript (which isn't as small a number as I
>>> would've thought)
>>>
>>>
>>>
>>> craigmcc wrote:
>>>   
 On 12/21/06, lightbulb432 <[EMAIL PROTECTED]> wrote:
 
> Why does JSF always use JavaScript to submit a form rather than through
> the
> regular method of form submission?
>   
 That only happens for a commandLink component (i.e. a hyperlink that
 is to
 submit a form).  If you use a commandButton component, no JavaScript is
 needed.

 Is your entire JSF web application useless for clients that have
 JavaScript
 
> turned off?
>   
 Only for hyperlinks.  If you can describe a way to have a hyperlink
 submit
 a
 form, without Javascript being enabled, we would love to hear it.

 Craig


 



Re: rendered and disabled attributes not setting bean properties

2007-02-27 Thread David Delbecq
When you check the box and submit, do you have any validation error?
Values will not be transfered from selectBooleanCheckbox to
#{addCitaHandler.nuevoPaciente} unless validation of complete form is
successful. As a workaround, in your case, you can simply set the '
immediate="true" '  to your selectBooleanCheckbox

En l'instant précis du 27/02/07 13:53, anoe s'exprimait en ces termes:
> Hi all, I've got this two different inputTexts and a selectBooleanCheckbox
> which controls which inputText is rendered, so in the rendered attribute of
> the first inputText i've got this:
>
>rendered="#{!addCitaHandler.nuevoPaciente}"
>
> and the same without the ! in the second inputText. Of course the
> nuevoPaciente property is controlled with the selectBooleanCheckbox. The
> rendering / not rendering stuff is working ok, but the second inputText is
> not being updated when sending the form. In fact, it's not the second, but
> the inputText which was not showing from the beginning. I've tried using the
> disable attribute instead but it's not working either. If I don't use
> neither rendered nor disabled it works ok. Any idea what's up?
>   



Re: About JSF "h" tag

2007-02-27 Thread David Delbecq
En l'instant précis du 27/02/07 16:26, prantor s'exprimait en ces termes:
> Any how can i use JSF "h" tag. i am abale to use JSF "f" but not "h" tag ? 
> Any one explain me pls...
>   
http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/tlddocs/h/tld-summary.html


Re: Request error, status 500: Internal Server Error Message:null

2007-02-28 Thread David Delbecq
Check everything in you user session is serializable. During application
reload, the container serializes user sessions and deserialize them
after reload. It maybe that one of you backing beans had serialization
problems and did not get properly restored (transient fields?)
En l'instant précis du 28/02/07 14:33, [EMAIL PROTECTED]
s'exprimait en ces termes:
> Hi,
>
> In my web application I am using MyFaces, a4j tags and JBoss
> server.
>
> When I am starting my server for the first time my application is
> running fine.
>
> After that if I redeploy my application without restarting my server
> then I am getting 
>
> "Request error, status 500: Internal Server Error Message: null" if I
> click on the 
>
> But I am passing one parameter to the backing bean through
>  tag.
>
> My code is like as follows,
>
>  
>
>  action="#{customerBean.regenerateHistoryView}" >
>
>title="#{msg['historyView.forward']}"
> alt="#{msg['historyView.leftArrowImage']}">
>
>value="button_left"/>
>
> 
>
>  
>
> Moreover in my server logs I am getting "Null Pointer exception". Can
> any body have any idea?
>
>  
>
>  
>
> Thanks & Regards,
>
> Basha
>
>  
>
>
>
>
> The information contained in this electronic message and any attachments to 
> this message are intended for the exclusive use of the addressee(s) and may 
> contain proprietary, confidential or privileged information. If you are not 
> the intended recipient, you should not disseminate, distribute or copy this 
> e-mail. Please notify the sender immediately and destroy all copies of this 
> message and any attachments. 
>
> WARNING: Computer viruses can be transmitted via email. The recipient should 
> check this email and any attachments for the presence of viruses. The company 
> accepts no liability for any damage caused by any virus transmitted by this 
> email.
>  
> www.wipro.com
>   



Jsp to facelets, replacements for jstl/xml and xtags

2007-03-09 Thread David Delbecq
Hello,

we are currently converting our page framework from the use of
overbloated JSPs to clean facelets with templating. However, we are
facing problems regarding replacement to some existing taglibs in used.
I think at least 2 of our mainly used taglibs could be replaced by
*something* more facelets friendly, but i don't know what. We used them,
in JSP, to open and extract content from some xmls (using JSTL/xml
taglib and xpaths) and to convert xml to xhtml using an xslt (using
jakarta xtags).

currently we are, as a temporary solution, moving those used taglibs
inside some included jsp (we developped a simple JSF component that does
call the jsp and outputs it's content). It's not easy to managed but it
works. But we could reduce number of called JSP if we could do xml
operations using facelets. Does someone know a facelets taglib that can
do this or a set of JSF component/beans that provides similar features?

Thanks,
David Delbecq


How to set response character encoding?

2007-03-09 Thread David Delbecq
Hello,

i am trying to figure out how to set the response character encoding in
my jsf pages. I am using MyFaces+Facelets, the response by default seems
to be iso8859-1 and i'd like to set it to UTF-8, where do i configure this?

Thanks


Re: How to set response character encoding?

2007-03-09 Thread David Delbecq
This instruction only refers to xml charset encoding used when reading
it. Facelets does not use it as encoding for FacesContext.writer. Even
with such instruction in my xml (anyway, all my xml are already utf-8),
facelets still send the response to client in iso-8859-1 charset encoding.

Other suggestions?
En l'instant précis du 09/03/07 11:16, Roger Alix-Gaudreau s'exprimait
en ces termes:
> I am using Facelets as well, and we define the encoding in the XML
> prolog at the top of the layout template file, as such:
>
> 
>
> Roger Alix-Gaudreau
>
> -Original Message-
> From: David Delbecq [mailto:[EMAIL PROTECTED] 
> Sent: Friday, March 09, 2007 3:44 PM
> To: MyFaces Discussion
> Subject: How to set response character encoding?
>
> Hello,
>
> i am trying to figure out how to set the response character encoding in
> my jsf pages. I am using MyFaces+Facelets, the response by default seems
> to be iso8859-1 and i'd like to set it to UTF-8, where do i configure
> this?
>
> Thanks
>   



Re: JSF - New window to confirm delete

2007-03-12 Thread David Delbecq
En l'instant précis du 12/03/07 13:49, edney imme s'exprimait en ces
termes:
> Hallo,
>
> I have a windown, were I need to open another windown, like a popup
> windown.
> And in that windown, I will use to ask to the user if he wants to confirm
> delete the item, or cancel this operation.
>
> Detail: I can't use javascript popup window, it must be a new window,
> with 2
> buttons: Ok and Cancel.
Then it's simply a new form. Only specific part you have to manually do
is ask browser to show this form in a new window. Use  ...  for this purpose.

As for 'closing' the popup, it's not that easy without javascript...

>
> Did anibody did something like that before ? Or has any idea of how I
> can do
> it ?
>
> I alredy do some similar using Struts, but never with JSF.
>
> Thanks for atention.
>



setting default value for input field?

2007-03-12 Thread David Delbecq
Hello,

I need to design a form in JSF where there are various default value for
various fields.
However, the default value is separated from the backing bean (it's
something to display in initial form). I am not sure how to do this, i
don't see in h:inputHidden anything that relate to a default value.

I need to convert this struts form:





to a JSF form, but i don't know where to put the '15' and
'param.searchScope' in JSf

setting  does
not set the default value to 15.

Any suggestion to set default value? Do i have to do
15 or something
like that? Can't find documentation on setting default form values...

Help appreciated.



Re: JSF - New window to confirm delete

2007-03-12 Thread David Delbecq
En l'instant précis du 12/03/07 13:49, edney imme s'exprimait en ces
termes:
> Hallo,
>
> I have a windown, were I need to open another windown, like a popup
> windown.
> And in that windown, I will use to ask to the user if he wants to confirm
> delete the item, or cancel this operation.
>
> Detail: I can't use javascript popup window, it must be a new window,
> with 2
> buttons: Ok and Cancel.
Then it's simply a new form. Only specific part you have to manually do
is ask browser to show this form in a new window. Use  ...  for this purpose.

As for 'closing' the popup, it's not that easy without javascript...

>
> Did anibody did something like that before ? Or has any idea of how I
> can do
> it ?
>
> I alredy do some similar using Struts, but never with JSF.
>
> Thanks for atention.
>



Re: setting default value for input field?

2007-03-12 Thread David Delbecq
Thanks but it does not fit the needs
1) the default value should be configurable per page. It's not the only
hidden field. Some have a searchScope that depend on which page the form
sit in. It can't be initialized by 'managed property'

Cmon, there should be something as simple as defaut="..." that exist in
JSF. I can't believe a form couldn't have default values in the JSP...

Steve Torrefranca a écrit :
> I am also a JSF newbie but I think for default values you can try
> managed property
>
> In you faces-config.xml you do something like
>
>  
>theBackingBean
>
>com.whatever.com.TheBackingBean
>
>session
>      
>  theProperty
>  theDefaultvalue
>  
>  
>
>
>
>
> David Delbecq wrote:
>> Hello,
>>
>> I need to design a form in JSF where there are various default value for
>> various fields.
>> However, the default value is separated from the backing bean (it's
>> something to display in initial form). I am not sure how to do this, i
>> don't see in h:inputHidden anything that relate to a default value.
>>
>> I need to convert this struts form:
>>
>>
>> 
>> 
>> 
>> to a JSF form, but i don't know where to put the '15' and
>> 'param.searchScope' in JSf
>>
>> setting  does
>> not set the default value to 15.
>>
>> Any suggestion to set default value? Do i have to do
>> > value="#{theForm.requestedNodeResults}">15 or something
>> like that? Can't find documentation on setting default form values...
>>
>> Help appreciated.
>>
>>
>>   
>



Re: ---SPAM--- Re: setting default value for input field?

2007-03-13 Thread David Delbecq
Thank you Aleksandr, it does fit my need, i didn't know about the
f:attribute, i'll check if it works for the value (your example use the
size :p )

To people saying it's one backing bean per form, i agree up to some
point. In my case i have only 2 forms and could separate in 2 backing
beans. But main problems are
1) i don't have access to backing bean initialization step thru JSf,
it's manager by struts faces
2) on the same form, default value of some fields depend on current user
profile, on some GET parameters and so on, this make it difficult to
manage somewhere else than in form.

Thanks for help anyway.

En l'instant précis du 13/03/07 08:15, Aleksandr Mazur s'exprimait en
ces termes:
> Hi David,
>
> Life could be easy with facelets. For example:
>
> Tag file: myinputText.xhtml 
>
> 
>  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> http://www.w3.org/1999/xhtml";
>   xmlns:ui="http://java.sun.com/jsf/facelets";
>   xmlns:t="http://myfaces.apache.org/tomahawk";
>   xmlns:c="http://java.sun.com/jstl/core";
> >
> 
> 
> 
> 
> 
> 
>     
> 
> 
> 
> 
> 
>
> So, on your page:
>
>  required="false"/>
>  
> Best regards,
> Aleksandr Mazur,
>
>
>
>
> David Delbecq <[EMAIL PROTECTED]> 
> 12.03.2007 22:29
> Please respond to
> "MyFaces Discussion" 
>
>
> To
> MyFaces Discussion 
> cc
>
> Subject
> ---SPAM--- Re: setting default value for input field?
>
>
>
>
>
>
> Thanks but it does not fit the needs
> 1) the default value should be configurable per page. It's not the only
> hidden field. Some have a searchScope that depend on which page the form
> sit in. It can't be initialized by 'managed property'
>
> Cmon, there should be something as simple as defaut="..." that exist in
> JSF. I can't believe a form couldn't have default values in the JSP...
>
> Steve Torrefranca a écrit :
>   
>> I am also a JSF newbie but I think for default values you can try
>> managed property
>>
>> In you faces-config.xml you do something like
>>
>>  
>>theBackingBean
>>
>>com.whatever.com.TheBackingBean
>>
>>session
>>  
>>  theProperty
>>  theDefaultvalue
>>  
>>  
>>
>>
>>
>>
>> David Delbecq wrote:
>> 
>>> Hello,
>>>
>>> I need to design a form in JSF where there are various default value 
>>>   
> for
>   
>>> various fields.
>>> However, the default value is separated from the backing bean (it's
>>> something to display in initial form). I am not sure how to do this, i
>>> don't see in h:inputHidden anything that relate to a default value.
>>>
>>> I need to convert this struts form:
>>>
>>>
>>> 
>>> 
>>> 
>>> to a JSF form, but i don't know where to put the '15' and
>>> 'param.searchScope' in JSf
>>>
>>> setting  does
>>> not set the default value to 15.
>>>
>>> Any suggestion to set default value? Do i have to do
>>> >> value="#{theForm.requestedNodeResults}">15 or something
>>> like that? Can't find documentation on setting default form values...
>>>
>>> Help appreciated.
>>>
>>>
>>>
>>>   
>
>
>
>   




Re: ---SPAM--- Re: setting default value for input field?

2007-03-13 Thread David Delbecq
Thank you Aleksandr, it does fit my need, i didn't know about the
f:attribute, i'll check if it works for the value (your example use the
size :p )

To people saying it's one backing bean per form, i agree up to some
point. In my case i have only 2 forms and could separate in 2 backing
beans. But main problems are
1) i don't have access to backing bean initialization step thru JSf,
it's manager by struts faces
2) on the same form, default value of some fields depend on current user
profile, on some GET parameters and so on, this make it difficult to
manage somewhere else than in form.

Thanks for help anyway.

En l'instant précis du 13/03/07 08:15, Aleksandr Mazur s'exprimait en
ces termes:
> Hi David,
>
> Life could be easy with facelets. For example:
>
> Tag file: myinputText.xhtml 
>
> 
>  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> http://www.w3.org/1999/xhtml";
>   xmlns:ui="http://java.sun.com/jsf/facelets";
>   xmlns:t="http://myfaces.apache.org/tomahawk";
>   xmlns:c="http://java.sun.com/jstl/core";
> >
> 
> 
> 
> 
> 
> 
>     
> 
> 
> 
> 
> 
>
> So, on your page:
>
>  required="false"/>
>  
> Best regards,
> Aleksandr Mazur,
>
>
>
>
> David Delbecq <[EMAIL PROTECTED]> 
> 12.03.2007 22:29
> Please respond to
> "MyFaces Discussion" 
>
>
> To
> MyFaces Discussion 
> cc
>
> Subject
> ---SPAM--- Re: setting default value for input field?
>
>
>
>
>
>
> Thanks but it does not fit the needs
> 1) the default value should be configurable per page. It's not the only
> hidden field. Some have a searchScope that depend on which page the form
> sit in. It can't be initialized by 'managed property'
>
> Cmon, there should be something as simple as defaut="..." that exist in
> JSF. I can't believe a form couldn't have default values in the JSP...
>
> Steve Torrefranca a écrit :
>   
>> I am also a JSF newbie but I think for default values you can try
>> managed property
>>
>> In you faces-config.xml you do something like
>>
>>  
>>theBackingBean
>>
>>com.whatever.com.TheBackingBean
>>
>>session
>>  
>>  theProperty
>>  theDefaultvalue
>>  
>>  
>>
>>
>>
>>
>> David Delbecq wrote:
>> 
>>> Hello,
>>>
>>> I need to design a form in JSF where there are various default value 
>>>   
> for
>   
>>> various fields.
>>> However, the default value is separated from the backing bean (it's
>>> something to display in initial form). I am not sure how to do this, i
>>> don't see in h:inputHidden anything that relate to a default value.
>>>
>>> I need to convert this struts form:
>>>
>>>
>>> 
>>> 
>>> 
>>> to a JSF form, but i don't know where to put the '15' and
>>> 'param.searchScope' in JSf
>>>
>>> setting  does
>>> not set the default value to 15.
>>>
>>> Any suggestion to set default value? Do i have to do
>>> >> value="#{theForm.requestedNodeResults}">15 or something
>>> like that? Can't find documentation on setting default form values...
>>>
>>> Help appreciated.
>>>
>>>
>>>
>>>   
>
>
>
>   



Re: How to set response character encoding?

2007-03-14 Thread David Delbecq
Aren't filters a bit overkill for such work? Doesn't facelets have a
simple configuration parameter for this??
I have read mail where it's stated and fixed problem where myfaces does
not respect the character encoding rule configured in facelets, but i
can't find where in facelets to configure it...

En l'instant précis du 14/03/07 11:24, Cagatay Civici s'exprimait en ces
termes:
> Hi,
>
> A filter will help,
>
> http://www.jroller.com/page/mert?entry=utf_8_encoding_with_jsf
>
> Cagatay
>
> On 3/14/07, Christopher Cudennec <[EMAIL PROTECTED]> wrote:
>>
>> Hi, you can use a filter. We successfully use
>> org.springframework.web.filter.CharacterEncodingFilter in our project.
>>
>> Cheers, Christopher
>>
>> David Delbecq schrieb:
>> > This instruction only refers to xml charset encoding used when reading
>> > it. Facelets does not use it as encoding for FacesContext.writer. Even
>> > with such instruction in my xml (anyway, all my xml are already
>> utf-8),
>> > facelets still send the response to client in iso-8859-1 charset
>> encoding.
>> >
>> > Other suggestions?
>> > En l'instant précis du 09/03/07 11:16, Roger Alix-Gaudreau s'exprimait
>> > en ces termes:
>> >
>> >> I am using Facelets as well, and we define the encoding in the XML
>> >> prolog at the top of the layout template file, as such:
>> >>
>> >> 
>> >>
>> >> Roger Alix-Gaudreau
>> >>
>> >> -Original Message-
>> >> From: David Delbecq [mailto:[EMAIL PROTECTED]
>> >> Sent: Friday, March 09, 2007 3:44 PM
>> >> To: MyFaces Discussion
>> >> Subject: How to set response character encoding?
>> >>
>> >> Hello,
>> >>
>> >> i am trying to figure out how to set the response character
>> encoding in
>> >> my jsf pages. I am using MyFaces+Facelets, the response by default
>> seems
>> >> to be iso8859-1 and i'd like to set it to UTF-8, where do i configure
>> >> this?
>> >>
>> >> Thanks
>> >>
>> >>
>> >
>> >
>> >
>>
>>




Re: How to set response character encoding?

2007-03-14 Thread David Delbecq
The issue you refer to was fixed (according to what i saw when i search
this), however i can not find where they configured facelets character
encoding to something else than "default behaviour".
En l'instant précis du 14/03/07 12:34, Christopher Cudennec s'exprimait
en ces termes:
> Hi, I had some issues setting the character encoding when I tried to
> set up trinidad. The problem that I ran into is described similarly here:
>
> http://marc.theaimsgroup.com/?l=myfaces-user&m=116230903513566&w=2
>
> So using a filter seems to be the only choice left... any other opinions?
>
> Christopher
>
> David Delbecq schrieb:
>> Aren't filters a bit overkill for such work? Doesn't facelets have a
>> simple configuration parameter for this??
>> I have read mail where it's stated and fixed problem where myfaces does
>> not respect the character encoding rule configured in facelets, but i
>> can't find where in facelets to configure it...
>>
>> En l'instant précis du 14/03/07 11:24, Cagatay Civici s'exprimait en ces
>> termes:
>>  
>>> Hi,
>>>
>>> A filter will help,
>>>
>>> http://www.jroller.com/page/mert?entry=utf_8_encoding_with_jsf
>>>
>>> Cagatay
>>>
>>> On 3/14/07, Christopher Cudennec <[EMAIL PROTECTED]> wrote:
>>>
>>>> Hi, you can use a filter. We successfully use
>>>> org.springframework.web.filter.CharacterEncodingFilter in our project.
>>>>
>>>> Cheers, Christopher
>>>>
>>>> David Delbecq schrieb:
>>>>  
>>>>> This instruction only refers to xml charset encoding used when
>>>>> reading
>>>>> it. Facelets does not use it as encoding for FacesContext.writer.
>>>>> Even
>>>>> with such instruction in my xml (anyway, all my xml are already
>>>>> 
>>>> utf-8),
>>>>  
>>>>> facelets still send the response to client in iso-8859-1 charset
>>>>> 
>>>> encoding.
>>>>  
>>>>> Other suggestions?
>>>>> En l'instant précis du 09/03/07 11:16, Roger Alix-Gaudreau
>>>>> s'exprimait
>>>>> en ces termes:
>>>>>
>>>>>
>>>>>> I am using Facelets as well, and we define the encoding in the XML
>>>>>> prolog at the top of the layout template file, as such:
>>>>>>
>>>>>> 
>>>>>>
>>>>>> Roger Alix-Gaudreau
>>>>>>
>>>>>> -Original Message-
>>>>>> From: David Delbecq [mailto:[EMAIL PROTECTED]
>>>>>> Sent: Friday, March 09, 2007 3:44 PM
>>>>>> To: MyFaces Discussion
>>>>>> Subject: How to set response character encoding?
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> i am trying to figure out how to set the response character
>>>>>>   
>>>> encoding in
>>>>  
>>>>>> my jsf pages. I am using MyFaces+Facelets, the response by default
>>>>>>   
>>>> seems
>>>>  
>>>>>> to be iso8859-1 and i'd like to set it to UTF-8, where do i
>>>>>> configure
>>>>>> this?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>>
>>>>>>   
>>>>>
>>>>> 
>>>>   
>>
>>
>>
>>   
>



Re: How to set response character encoding?

2007-03-14 Thread David Delbecq
Aren't filters a bit overkill for such work? Doesn't facelets have a
simple configuration parameter for this??
I have read mail where it's stated and fixed problem where myfaces does
not respect the character encoding rule configured in facelets, but i
can't find where in facelets to configure it...

En l'instant précis du 14/03/07 11:24, Cagatay Civici s'exprimait en ces
termes:
> Hi,
>
> A filter will help,
>
> http://www.jroller.com/page/mert?entry=utf_8_encoding_with_jsf
>
> Cagatay
>
> On 3/14/07, Christopher Cudennec <[EMAIL PROTECTED]> wrote:
>>
>> Hi, you can use a filter. We successfully use
>> org.springframework.web.filter.CharacterEncodingFilter in our project.
>>
>> Cheers, Christopher
>>
>> David Delbecq schrieb:
>> > This instruction only refers to xml charset encoding used when reading
>> > it. Facelets does not use it as encoding for FacesContext.writer. Even
>> > with such instruction in my xml (anyway, all my xml are already
>> utf-8),
>> > facelets still send the response to client in iso-8859-1 charset
>> encoding.
>> >
>> > Other suggestions?
>> > En l'instant précis du 09/03/07 11:16, Roger Alix-Gaudreau s'exprimait
>> > en ces termes:
>> >
>> >> I am using Facelets as well, and we define the encoding in the XML
>> >> prolog at the top of the layout template file, as such:
>> >>
>> >> 
>> >>
>> >> Roger Alix-Gaudreau
>> >>
>> >> -Original Message-
>> >> From: David Delbecq [mailto:[EMAIL PROTECTED]
>> >> Sent: Friday, March 09, 2007 3:44 PM
>> >> To: MyFaces Discussion
>> >> Subject: How to set response character encoding?
>> >>
>> >> Hello,
>> >>
>> >> i am trying to figure out how to set the response character
>> encoding in
>> >> my jsf pages. I am using MyFaces+Facelets, the response by default
>> seems
>> >> to be iso8859-1 and i'd like to set it to UTF-8, where do i configure
>> >> this?
>> >>
>> >> Thanks
>> >>
>> >>
>> >
>> >
>> >
>>
>>



Re: setting default value for input field?

2007-03-19 Thread David Delbecq
En l'instant précis du 19/03/07 03:15, Simon Kitching s'exprimait en ces
termes:
> [EMAIL PROTECTED] wrote:
>> Hi Noah,
>>
>> Why is it hard for the back-end logic to set these defaults when it
>> constructs
>> the unpersisted Reservation instance?  I'm not sure I followed that
>> part, it's
>> something we do all the time in our system.
>
> I guess it depends. In some cases it is the *business object* that
> logically has a default value, in which case it should be that tier
> which implements the defaulting logic.
>
> However I can imagine cases where the default is really not part of
> the business behaviour of that object (eg defaulting "http:" as a
> prefix).
>
> Maybe you could write a custom tag that sets defaults, eg
>   
> which would:
> * get the parent component
> * do nothing if its submittedValue property is set
> * do nothing if getValue() is set
> * set its submittedValue to the value of the default tag
Hey, i didn't think about this :). This seems to me a clean way of doing
this and creating the custom component should not be very long. Thanks
for suggestion.



Re: Facelets and JSP...how to port JSP code.

2007-03-21 Thread David Delbecq
Hi, you have 2 possibilities

1) You move this code to a facelet tag handler and make foo a JSF
managed bean

2) you create 2 custom facelets tags that support JSP inclusion (this is
a pretty usefull thing to do when migrating code, we did it here)
(why 2 tags, because you have case when you want jsp included during
facelets restor view, and case when you want this to occur during
component rendering, depending on jsp code)
En l'instant précis du 21/03/07 13:29, [EMAIL PROTECTED] s'exprimait
en ces termes:
> I have been considering moving to Facelets.  I have studied it and like
> what I see.  One problem I see is how to port my JSP code into Facelets.
>  By this I mean, in some of my pages, I have JSP code
>
> 
> <%
>if (!foo.isLoaded())
>{
>   response.sendRedirect("login.jsf");
>}
> %>
>
>
> Does anyone know how you might port this?  I am open to design changes
> as well.
>
> Thanks!
>   



Re: SIMPLE question - How can I get   to work

2007-03-21 Thread David Delbecq
Hi, if you want "literally" the four character & n b s p ; in the
output, you must do this:



the &...; entities are read by xml parser and never seen by facelets,
moreover the xml parser itself has no notion of the   entity and
will fail to parse it

However, non breakable space is only a special character, that is also
reachable via it's unicode value, so you can simply write

 

instead of all the awfull outputText thingy. It will not issue a  
in the output html but will issue a non visual character having same
behaviour.
En l'instant précis du 21/03/07 14:54, Charbel Abdul-Massih s'exprimait
en ces termes:
>
> I am using JSF with facelets…
>
> I just need to output a space character “ ” in my page…
>
>  
>
> For some reason, it is not working for me…
>
>  
>
> I tried 
>
>  
>
> That’s not working…
>
>  
>
> Can you please help!!
>



Re: Facelets and JSP...how to port JSP code.

2007-03-21 Thread David Delbecq
En l'instant précis du 21/03/07 16:01, Olivier Ziller GMail Lists
s'exprimait en ces termes:
> Hello,
>
> David Delbecq wrote:
>> Hi, you have 2 possibilities
>>
>> 1) You move this code to a facelet tag handler and make foo a JSF
>> managed bean
>>
>> 2) you create 2 custom facelets tags that support JSP inclusion (this is
>> a pretty usefull thing to do when migrating code, we did it here)
>> (why 2 tags, because you have case when you want jsp included during
>> facelets restor view, and case when you want this to occur during
>> component rendering, depending on jsp code)
>>   
> could you please give a small example on how to do that?
For (1), there are docs and example on the net about creating your own
facelets tag handler (
http://www.jsfcentral.com/articles/facelets_2-2.html
http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk )

For (2), it's just a matter of, in your taghandler or custom component
renderer, getting the servlet controller, locate the appropriate servlet
and make a forward() to it servlet (yes, a JSP is a servlet). It will
then naturally execute and give back, immediatly after execution, 
control to your component  or taghanlder. This way, execution of
facelets don't stop.

PS: another thing you might want to consider, it's possible to have both
facelets and JSP based JSF at the same time (see this
http://wiki.java.net/bin/view/Projects/FaceletsFAQ#How_do_I_use_Facelets_and_JSP_in
)
>
> thanks in advance
>> En l'instant précis du 21/03/07 13:29, [EMAIL PROTECTED] s'exprimait
>> en ces termes:
>>   
>>> I have been considering moving to Facelets.  I have studied it and like
>>> what I see.  One problem I see is how to port my JSP code into Facelets.
>>>  By this I mean, in some of my pages, I have JSP code
>>>
>>> 
>>> <%
>>>if (!foo.isLoaded())
>>>{
>>>   response.sendRedirect("login.jsf");
>>>}
>>> %>
>>>
>>>
>>> Does anyone know how you might port this?  I am open to design changes
>>> as well.
>>>
>>> Thanks!
>>>   
>>> 
>>
>>
>>   



Re: Flow from backing bean to page while also initializing second backing bean?

2007-03-22 Thread David Delbecq
Mail quite confusing, i try to give partial answers anyway

En l'instant précis du 22/03/07 12:33, Joe Reger, Jr. s'exprimait en ces
termes:
> Hi.
>
> I'm using MyFaces 1.1.5, Facelets 1.1.12, Java 6 and Tomcat 5.5.
>
> 1) page1.xhtml with backing bean Page1.java.  Page loads properly,
> displays a form of some sort.
>
> 2) User types some info into page1.xhtml and hits "Save" which calls
> Page1.save().
>
> 3) Page1.save() method returns a String.  JSF handles the page
> navigation and redirection.
>
> Problem: I can return "page2", to go to the second page in the flow. 
> But I need to initialize the backing bean for page2.xhtml which is
> called Page2.java.  If I simply use a faces-config.xml-defined
> navigation rule ("page2") I can't do this initialization... it'll call
> the page but won't call any methods to initialize.  So page2.xhtml
> displays for the user but they don't see the effect of the data they
> entered on page1.xhtml.
you don't need a backing bean per page, if page1 and page2 share same
datas, why not use the same backing bean for both?
>
> Constraint: Ajax4jsf only seems to work when I have a no-argument
> empty constructor, so I can't do backing bean initialization there.
no-arguments constructor is indeed part of the definition of the bean
concept :). If your bean are session scoped, they must be moreover
serializable. A class can only be serializable if it has a no argument
constructor.
>
> Question: In a commandLink I can specify #{page2.myInitMethod}
> (Facelets processes the EL and tells JSF where to go) which allows me
> to initialize my backing bean and return String "page2" so that the
> user gets the page.  But I can't do that in step 3) above... the
> backing bean can only return a String that's pre-defined in
> faces-config.xml.  Is there any way to route the browser from a
> backing bean to another page while specifying an initialization
> method?  Assuming I can't return "page2.myInitMethod".
Let JSF do the initialization stuff itself based on bean definitions
made in faces-config.xml. Btw, you can use managed properties if you
want you bean to know about each other. JSF does all this by itself
Example (myRequestBean.getOtherBean() will now return a JSF session
scoped managed bean):

myRequestBean

com.company.SomeBean
request

 otherBean

com.company.SomeOtherBean
 #{mySessionBean}
 


mySessionBean

com.company.SomeOtherBean
session


Moreover, again, you can make page1.java and page2.java a single bean.
Or you can have page1.java have a getter returning page2. In page2.xhtml
EL would then look like #{page1.page2.someProperty}
>
> Motivation: Slowly moving from a plain MyFaces implementation towards
> Seam which requires no-argument empty constructors.  Also looking to
> get Ajax4Jsf running on multi-screen wizard-like flows.  The app
> consists of about 50 backing beans and in the past I used java object
> constructors to initialize the beans, load stuff from the database,
> etc.  I'm sure I'm missing some basic page flow design pattern built
> into JSF and any help is appreciated.
>
I think you are stuck thinking you need a managed bean per form/page. A
JSF Managed bean is simply a bean that has a life duration (depending on
it's scope) and is made available to JSF component using EL expression.
The structure of your bean and their relation does not have to be tied
to your form. A form can combine several beans or a bean can be used by
several forms. Also, only beans you want directly available as EL value
need to be JSF managed. Objects returned by a getter of a JSF managed
bean do not need to be JSF managed.
> Thanks,
>
> Joe




Re: Flow from backing bean to page while also initializing second backing bean?

2007-03-22 Thread David Delbecq
Mail quite confusing, i try to give partial answers anyway

En l'instant précis du 22/03/07 12:33, Joe Reger, Jr. s'exprimait en ces
termes:
> Hi.
>
> I'm using MyFaces 1.1.5, Facelets 1.1.12, Java 6 and Tomcat 5.5.
>
> 1) page1.xhtml with backing bean Page1.java.  Page loads properly,
> displays a form of some sort.
>
> 2) User types some info into page1.xhtml and hits "Save" which calls
> Page1.save().
>
> 3) Page1.save() method returns a String.  JSF handles the page
> navigation and redirection.
>
> Problem: I can return "page2", to go to the second page in the flow. 
> But I need to initialize the backing bean for page2.xhtml which is
> called Page2.java.  If I simply use a faces-config.xml-defined
> navigation rule ("page2") I can't do this initialization... it'll call
> the page but won't call any methods to initialize.  So page2.xhtml
> displays for the user but they don't see the effect of the data they
> entered on page1.xhtml.
you don't need a backing bean per page, if page1 and page2 share same
datas, why not use the same backing bean for both?
>
> Constraint: Ajax4jsf only seems to work when I have a no-argument
> empty constructor, so I can't do backing bean initialization there.
no-arguments constructor is indeed part of the definition of the bean
concept :). If your bean are session scoped, they must be moreover
serializable. A class can only be serializable if it has a no argument
constructor.
>
> Question: In a commandLink I can specify #{page2.myInitMethod}
> (Facelets processes the EL and tells JSF where to go) which allows me
> to initialize my backing bean and return String "page2" so that the
> user gets the page.  But I can't do that in step 3) above... the
> backing bean can only return a String that's pre-defined in
> faces-config.xml.  Is there any way to route the browser from a
> backing bean to another page while specifying an initialization
> method?  Assuming I can't return "page2.myInitMethod".
Let JSF do the initialization stuff itself based on bean definitions
made in faces-config.xml. Btw, you can use managed properties if you
want you bean to know about each other. JSF does all this by itself
Example (myRequestBean.getOtherBean() will now return a JSF session
scoped managed bean):

myRequestBean
   
com.company.SomeBean
request

 otherBean

com.company.SomeOtherBean
 #{mySessionBean}
 


mySessionBean
   
com.company.SomeOtherBean
session


Moreover, again, you can make page1.java and page2.java a single bean.
Or you can have page1.java have a getter returning page2. In page2.xhtml
EL would then look like #{page1.page2.someProperty}
>
> Motivation: Slowly moving from a plain MyFaces implementation towards
> Seam which requires no-argument empty constructors.  Also looking to
> get Ajax4Jsf running on multi-screen wizard-like flows.  The app
> consists of about 50 backing beans and in the past I used java object
> constructors to initialize the beans, load stuff from the database,
> etc.  I'm sure I'm missing some basic page flow design pattern built
> into JSF and any help is appreciated.
>
I think you are stuck thinking you need a managed bean per form/page. A
JSF Managed bean is simply a bean that has a life duration (depending on
it's scope) and is made available to JSF component using EL expression.
The structure of your bean and their relation does not have to be tied
to your form. A form can combine several beans or a bean can be used by
several forms. Also, only beans you want directly available as EL value
need to be JSF managed. Objects returned by a getter of a JSF managed
bean do not need to be JSF managed.
> Thanks,
>
> Joe



Re: SIMPLE question - How can I get   to work

2007-03-23 Thread David Delbecq
En l'instant précis du 23/03/07 11:54, Jonathan Harley s'exprimait en
ces termes:
>> moreover the xml parser itself has no notion of the   entity and
>> will fail to parse it
> the &...; entities are read by xml parser and never seen by facelets,
>
> Not true, as   is defined in the XHTML DTD. As long as the
> doctype references this, the XML parser understands it.
There are lots of ways to defines   as an entity for the parser,
but unless you explicitly define it using an included dtd or other
mecanism, it does not exist. And what ever you defined entities to, they
are used only by parser, facelets does not see the entities, only the
character(s) or node(s) represented by that entity.
>
>> However, non breakable space is only a special character, that is also
>> reachable via it's unicode value, so you can simply write
>>
>>  
>>
> The XHTML standard mandates that hex references must use lower
> case, so you should really put   (or use non-hex i.e.  ),
> but most browsers would understand upper case I guess.
>
Facelets does not take an xhtml input but an xml template made of
various namespaces. Specs of xml  1.0 states:
[66]   CharRef   ::=   '&#' [0-9]+ ';' |  '&#x'
[0-9a-fA-F]+ ';'


We don't care about browser as our reader is an xml parser that will
feed facelets view handler. Even if you write   in your facelets
template, you probably won't get the same in facelets output but, as i
said, an unicode character that has same behaviour.

Anyway, i think the original poster has his answers now :D


Re: Submit form, validate input, open response in new window?

2007-03-23 Thread David Delbecq
En l'instant précis du 23/03/07 12:58, Marko Asplund s'exprimait en ces
termes:
> hi
>
> I need to do the following in my JSF application:
> - submit a form with input text fields
> - validate form input
> - if conversion or validation results in errors, show the original form
> - if input is ok, open a new window and load a JSF response in it.
> Input form window is left unchanged.
>
> One option I can come up with would be to include a piece of
> Javascript in the form page on postback that would open up a new
> window and load the JSF view in it. Does this sound workable? How do I
> generate Javascript code that would result in invoking a JSF action
> method in a browser window?
when form is valid, your action is called and a navigation occured. In
the page, after navigation, have 2 forms. One is you original form
(probably empty now). The other is a form with only hidden input field
and a target to "_blank". All you javascript has to do is to call the
form_submit() method associated with your hidden form. JSF generate such
javascript function for each form. You just have to call it on page load :)


Re: redirect question

2007-03-29 Thread David Delbecq
This is the way to go. However it will throw an exception is response
has already been committed.
also the url must be either full ("http://..";) either an url
relative to current webapplication.

Sorin Silaghi a écrit :
> Hello,
>
>   This is a really easy one.. how can i redirect from the backing
> bean to something that is not jsf... like to an external link for
> example ???
>
> I've tried the whole
>
> HttpServletResponse response = (HttpServletResponse)
> facesContext.getExternalContext().getResponse();
> response.sendRedirect(url);   
> facesContext.responseComplete();
>
> but it dosen't work the way I expect it to.. I presume this just
> redirects to another JSF page right ? ... so how do I convince it to
> go to google.com  for example ???



Re: JSf Error messages and bean values not displayed

2007-03-30 Thread David Delbecq
Use  to see validation messages in your form.

En l'instant précis du 30/03/07 14:53, Eugine F s'exprimait en ces termes:
> Hello To all,
>
> I am developing an application with JSF and facelets. I have a form
> with some fileds.I am having the follwing  problem. I do not have any
> error messages displayed on my page when I click the submit button
> even though required attribute was set. The beans have all been
> defined and called acordingly.  Even the redisplay of values entered
> in the form is not done. I have zthe following displayed in tomcat
>
> "INFO: No context init parameter
> 'org.apache.myfaces.ADD_RESOURCE_CLASS' found, using default value
> org.apache.myfaces.renderkit.html.util.DefaultAddResource
> 30.03.2007 14:45:47
> org.apache.myfaces.shared_impl.config.MyfacesConfig
> getBooleanInitParameter
> INFO: No context init parameter
> 'org.apache.myfaces.CHECK_EXTENSIONS_FILTER' found, using default
> value true
> 30.03.2007 14:45:47
> org.apache.myfaces.shared_tomahawk.config.MyfacesConfig
> getBooleanInitParameter
> INFO: No context init parameter
> 'org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS' found, using
> default value true
> 30.03.2007 14:45:47
> org.apache.myfaces.shared_tomahawk.config.MyfacesConfig
> getStringInitParameter
> INFO: No context init parameter
> 'org.apache.myfaces.ADD_RESOURCE_CLASS' found, using default value
> org.apache.myfaces.renderkit.html.util.DefaultAddResource
> 30.03.2007 14:45:47
> org.apache.myfaces.shared_tomahawk.config.MyfacesConfig
> getStringInitParameter
> INFO: No context init parameter
> 'org.apache.myfaces.RESOURCE_VIRTUAL_PATH' found, using default value
> /faces/myFacesExtensionResource
> 30.03.2007 14:45:47
> org.apache.myfaces.shared_tomahawk.config.MyfacesConfig
> getBooleanInitParameter
> INFO: No context init parameter
> 'org.apache.myfaces.CHECK_EXTENSIONS_FILTER' found, using default
> value true
> 30.03.2007 14:45:47
> org.apache.myfaces.shared_tomahawk.config.MyfacesConfig
> getCurrentInstance
> INFO: Starting up Tomahawk on the MyFaces-JSF-Implementation"
>
> Can anyone help?
> Thanks
> Eugine
>
>
> Can anyone help?
>
> _
> Die neue MSN Suche Toolbar mit Windows-Desktopsuche. Suchen Sie
> gleichzeitig im Web, Ihren E-Mails und auf Ihrem PC! Jetzt neu!
> http://desktop.msn.de/ Jetzt gratis downloaden!
>



Re: Standardcompliance of rendered markup

2007-04-03 Thread David Delbecq
Hi Rudi,

as far as i know, myfaces is supposed to render xhtml compliant output.
The 2 things you mentions are most probably bugs and should be fixed.
You should report the to the myfaces issue tracker :)
At least, your panelnavigation one is already reported:
http://issues.apache.org/jira/browse/TOMAHAWK-127

En l'instant précis du 03/04/07 15:31, Rudi Steiner s'exprimait en ces
termes:
> Hi all,
>
> since my chef ask me about XHTML or HTML 4.0 compliance of the
> generated HTML-output of MyFaces, today I made some investigations.
>
> I figured out that the generated markup is not far from XHTML but some
> components render invalid markup.
>
> Some examples:
>
>  renders the followind markup:
>
> 
>  onclick="clear_linkDummyForm();document.forms['linkDummyForm'].elements['autoScroll'].value=getScrolling();document.forms['linkDummyForm'].elements['linkDummyForm:_link_hidden_'].value='_id23';if(document.forms['linkDummyForm'].onsubmit){if(document.forms['linkDummyForm'].onsubmit())
>
> document.forms['linkDummyForm'].submit();}else{document.forms['linkDummyForm'].submit();}return
>
> false;" id="_id23" class="mypage">Product
> Information
>  onclick="clear_linkDummyForm();document.forms['linkDummyForm'].elements['autoScroll'].value=getScrolling();document.forms['linkDummyForm'].elements['linkDummyForm:_link_hidden_'].value='_id27';if(document.forms['linkDummyForm'].onsubmit){if(document.forms['linkDummyForm'].onsubmit())
>
> document.forms['linkDummyForm'].submit();}else{document.forms['linkDummyForm'].submit();}return
>
> false;" id="_id27" class="mypage">Online Shop
> 
>
> The validator at W3C says the following:
>
> Error  Line 62 column 477: end tag for "ul" which is not finished.
>
> ...page">Product Information
>
> Most likely, You nested tags and closed them in the wrong order. For
> example ... is not acceptable, as  must be closed
> before . Acceptable nesting is: ...
>
> Another possibility is that you used an element which requires a child
> element that you did not include. Hence the parent element is "not
> finished", not complete. For instance,  generally requires a
> , lists (ul, ol, dl) require list items (li, or dt, dd), and so
> on.
>
>
>
> In this case, the component should not generate an ul-element for a
> sublist which contains no children.
>
> A second example of validation errors can be generated, by setting the
> following parameter in the web.xml:
>
> javax.faces.STATE_SAVING_METHOD
> client
>
> In this case, I got the following errormessage:
>
> Error  Line 101 column 165: ID "jsf_tree_64" already defined.
>
> ...type="hidden" name="jsf_tree_64" id="jsf_tree_64"
> value="H4sIAK1WzW7T
>
> I guess, that the view state is written to the submitted page multiple
> times (once for each subview element maybe?)
>
>
> Could anyone please tell me something on the compliance level of
> MyFaces and Tomahawk-Components and if there are some settings, which
> affect the compliance level of the rendered markup?
>
> Thank you in advance,
> Rudi



Re: Validation/rendering strategy

2007-04-04 Thread David Delbecq
Probably this may fits your need?






If not, then you will have to write a custom component that does it for
you (locate component, check if it has an inputValue, check validity and
only renders content if needed):






En l'instant précis du 04/04/07 10:22, Julien Martin s'exprimait en ces
termes:
> Hello,
>
> I would like for an outputText element to be hidden (i.e. not
> rendered) when the corresponding inputText element has input and
> validated (by a standard tag-based validator). Is that possible?
>
>
> 
> 
> 
> 
>
>
> Thanks in advance,
>
> Julien. 



Re: Combining in-place-editing via AJAX with JSF's binding

2007-04-05 Thread David Delbecq
I would suggest ajax4jsf. As far as i know, it provide custom button
link that submit in ajax, retrieve the response and redraw parts of the
form on client side. This seems to do what you want, except for one
thing. According to docs, the current release does not support portlets
environments. However, docs also state that it's 'to come very soon',
maybe this has changed since the doc i read was written, maybe snapshot
can do what you want. Maybe you can delay your work? :) (i don't really
expect you say yes to last one :p)


En l'instant précis du 05/04/07 11:24, Matthias Wessendorf s'exprimait
en ces termes:
> don't rush. sometimes it takes a while.
> jQuery isn't that wide adapted ;)
>
> On 4/5/07, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
>> Hi folks,
>>
>> I'm building an application that basically consists of a single page
>> that
>> displays a few elements, of which most are editable in place. Some JS
>> converts each text element into an input field once its clicked and
>> submits
>> the changed value in the background. The user can also add new items
>> to a
>> list.
>>
>> So far I'm doing all my JavaScripting via jQuery, which I'm quite
>> familar
>> with. The enviroment in which the application must run is a Websphere
>> Portal
>> Server with JSR 168 portlets.
>>
>> What I'm currently reasearching: How to bind those in-place-edited value
>> back to Java beans using JSF?
>>
>> I know that I must use a servlet to control the output in a portlet
>> enviroment, so I'd start with configuring a JSF servlet in addition
>> to the
>> portlets I'm using. There is jQuery's form plugin that allows me to
>> submit a
>> form via AJAX in a format that the same as a native browser form
>> submit, JSF
>> shouldn't have any problems working with that. I can skip the render
>> response phase or write a custom view handler to output JSON or XML as a
>> reply to the AJAX request.
>>
>> I need your help on how to add new input elements on the client-side and
>> bind them to JSF. Can I generate IDs? Do I have to manipulate the
>> viewstate,
>> if possible at all? Are there frameworks or components available that do
>> just this and would work in a portlet enviroment? Or are there at least
>> projects I can take a look at for reference?
>>
>> Some more details:
>> The interface allows the user to edit several documents of which each
>> consists of a structure like this:
>>
>> Subject (big header)
>> Details (several fields like date inputs)
>>
>> Item 1
>> Subitem 1
>> Subitem 2
>> Subitem 3
>> Item 2
>> Subitem 1
>> Item 3Almost each elements is editable. The user can add items to the
>> list
>> and subitems to each item, and edit those, changing the title or adding
>> comments.
>> Each change must be saved (session, db) as early as possible (similar to
>> GMail).
>> I'm already using JSF for the rest of the application and I'd like to
>> avoid
>> starting to write my own binding framework when JSF already does such a
>> great job on that matter.
>>
>> Thanks for your help!
>>
>> Regards
>> Jörn Zaefferer
>>
>> PS: This is my second attempt to send this to the list, maybe I've
>> got more
>> luck this time.
>>
>
>



Re: [OT] Chess Strategies (was Re: New to MyFaces)

2007-04-05 Thread David Delbecq
Personnaly,  i discovered the Bird opening, and since like it very much.
It's not very well known by other people and it provide me with ability
to make blacks spend a few minutes  thinking  about their 1st move :D
It can also be converted to a reverted Dutch where white have one move
in advance compared to normal dutch.

Anyway, it's uncommoness is powerfull considering it's not a bad
opening. There are lots of opportunities when opponent tries to go too fast.

Jeff Bischoff a écrit :
> Mike accidentally started a chess thread. Sweet!
>
> Personally, I like playing the queen's gambit and the slav. Hmm... I
> wonder which Tomahawk components those equate to? ;)
>
> Mike Kienenberger wrote:
>> Or to put it another way, learning MyFaces is like learning the rules
>> to chess.
>> Learning to use the component sets are like learning about various
>> strategies for winning chess.
>>
>
>
>



Re: Tabset spills over the window size

2007-04-10 Thread David Delbecq
Hi,


no need to post 4 times to get answers faster, especially during easter
day off :)

Am not sure there is a real solution to this, as tabbed pane is rendered
as a Table tag.
I would suggest, in order either
1) Don't make 50 fields wide forms, it anyway is not userfriendly,
independent of the tabs problem
2) Tabbedpane support styling using Css, see if you can adapt width of
tabs area with this
3) In last resort, either do not use tabbedpane, either write a custom
renderer that do use something else than a table.

En l'instant précis du 09/04/07 18:17, Leyzerzon, Simeon s'exprimait en
ces termes:
>
> Hi,
>
> Maybe somebody knows where to look for this:
>
> I have a really wide table (over 50 fields) inside of the tabset with
> 4 tabs and as a consequence individual tabs on the tabset spans beyond
> the boundaries of the screen thus making an illusion to the user that
> there's only 1 tab.  What needs to be tweaked to make the width of the
> tabs a certain constant value so that irrespective of the width of the
> tab's enclosed contents, the tabset always displayed 4 tabs to the user.
>
> Thank you in advance.
> Simeon
>
> ==
> Please access the attached hyperlink for an important electronic 
> communications disclaimer: 
>
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> ==
>   



Re: how can i know which link has been clicked by user??

2007-04-10 Thread David Delbecq
Arg, mixing JSF and scriptlet? Be prepared for problems, it's like
mixing JSF and JSTL in a JSP :)

The action itself has no way to know which button was used to invoke it.
However, you have various possibilities

1) use a f:param to pass named parameter JSF, you can then query this
parameter from the JSF context
eg:



some link name


2) Add a listener to your action, the listener will be called with an
event object which allows you to retrieve the commandLink object user
clicked on.

PS: why do you do the iteration in a scriptlet rather than using a JSF
datatable to iterate of your items?

En l'instant précis du 10/04/07 12:13, shree s'exprimait en ces termes:
> hi all,
> i am displaying various links of tutorials in a JSF page using
> .
> what i need to do is,when ever a user clicks a link,i hv to display
> corresponding details of that clicked link in another jsf page.but my
> problem, here is how to pass the value of the clicked one to the bean.
>
> here is the code snippet.
> <%ArrayList values = new ArrayList();
> values = a.getPendingList();
> for ( j = 0; j < values.size(); j = j + 6) {
> %>
> 
> <%=values.get(j+1)%>
> 
> <%}%>
>
> i want to pass corresponding values(j+1) to the bean .
> i hv been trying to do this since 3 days.
> somebody please help me.
>
> thanks in advance,
> Shree.
>   



Re: how can i know which link has been clicked by user??

2007-04-10 Thread David Delbecq
En l'instant précis du 10/04/07 12:35, shree s'exprimait en ces termes:
> thanks for the reply David.
> i have already  tried  using 
> but f:param tag is not allowing expressions.
>   
f:param value is allowing EL expressions.
>
> David Delbecq-2 wrote:
>   
>> Arg, mixing JSF and scriptlet? Be prepared for problems, it's like
>> mixing JSF and JSTL in a JSP :)
>>
>> The action itself has no way to know which button was used to invoke it.
>> However, you have various possibilities
>>
>> 1) use a f:param to pass named parameter JSF, you can then query this
>> parameter from the JSF context
>> eg:
>>
>> 
>> 
>> some link name
>> 
>>
>> 2) Add a listener to your action, the listener will be called with an
>> event object which allows you to retrieve the commandLink object user
>> clicked on.
>>
>> PS: why do you do the iteration in a scriptlet rather than using a JSF
>> datatable to iterate of your items?
>>
>> En l'instant précis du 10/04/07 12:13, shree s'exprimait en ces termes:
>> 
>>> hi all,
>>> i am displaying various links of tutorials in a JSF page using
>>> .
>>> what i need to do is,when ever a user clicks a link,i hv to display
>>> corresponding details of that clicked link in another jsf page.but my
>>> problem, here is how to pass the value of the clicked one to the bean.
>>>
>>> here is the code snippet.
>>> <%ArrayList values = new ArrayList();
>>> values = a.getPendingList();
>>> for ( j = 0; j < values.size(); j = j + 6) {
>>> %>
>>> 
>>> <%=values.get(j+1)%>
>>> 
>>> <%}%>
>>>
>>> i want to pass corresponding values(j+1) to the bean .
>>> i hv been trying to do this since 3 days.
>>> somebody please help me.
>>>
>>> thanks in advance,
>>> Shree.
>>>   
>>>   
>>
>> 
>
>   



Re: how can i know which link has been clicked by user??

2007-04-10 Thread David Delbecq
JSF has a 6 phases lifecycle, JSP only has one phase. Your scriptlet
will be evaluated only during the JSP execution. Be aware that JSF tags
do evaluate their body only when creating the view. After that, JSF tags
are not used anymore, the root JSF tag just handle the 'render' of child
component, independent of the JSP content. That's why mixing JSF and
JSTL or scriptlets is a bad thing.

En l'instant précis du 10/04/07 13:25, shree s'exprimait en ces termes:
> yes .it allows like or value="abc".
> but i want to pass the value like  in
> scriplet tags.
>
> En l'instant précis du 10/04/07 12:35, shree s'exprimait en ces termes:
>   
>> thanks for the reply David.
>> i have already  tried  using 
>> but f:param tag is not allowing expressions.
>>   
>> 
> f:param value is allowing EL expressions.
>
>   



Re: how can i know which link has been clicked by user??

2007-04-10 Thread David Delbecq
Use a datatable to iterate over a collection of items, inside it use the
commandLink with f:param (with EL in value) and  outputText for link
text (once again using EL to change value at each iteration).

 
En l'instant précis du 10/04/07 14:35, shree s'exprimait en ces termes:
> Exactly.thats true.
> but  I am asking how to achieve such functionality without using scriplet in
> the middle??
> is it possible with JSF or should i need to use simple java script or AJAX.
>
>
>
> JSF has a 6 phases lifecycle, JSP only has one phase. Your scriptlet
> will be evaluated only during the JSP execution. Be aware that JSF tags
> do evaluate their body only when creating the view. After that, JSF tags
> are not used anymore, the root JSF tag just handle the 'render' of child
> component, independent of the JSP content. That's why mixing JSF and
> JSTL or scriptlets is a bad thing.
>
>
>   



Re: My application gives no error but the UploadedFile object is null

2007-04-11 Thread David Delbecq
Did you try with JSF command button instead of AJAX one? Maybe some
validation is failing and you don't see it. Try to add this to your
step2.xhtml:





En l'instant précis du 10/04/07 22:36, dxxvi s'exprimait en ces termes:
> I tried with both Tomahawk 1.1.3 and 1.1.5 SNAPSHOT. This is my environment:
>
> Java 6.0
> Tomcat 6.0.10
> JSF RI 1.2_04-b10-b01
> Ajax4jsf 1.1.1 SNAPSHOT
> RichFaces 3.0.1 SNAPSHOT
> Facelets 1.1.12
>
> If you're kind enough to give me your help, here's my 
> http://download.yousendit.com/D1BF241B687BF059 application  (the
> t:inputFileUpload is in step2.xhtml).
>   



Re: modifying faces servlet to let view be loaded from a data base by default

2007-04-11 Thread David Delbecq
You mean you want to load view definition from a proprietary DB format
instead of JSP (default) or an xhtml template (Facelets)?
En l'instant précis du 11/04/07 09:49, Eugine F s'exprimait en ces termes:
> Hello users,
> I would like to have a clue as to how I could modify the faces servlet
> or the component that I have to modify to let the view be loaded form
> a data base. Anyone has an idea?
> thanks
> Eugine
>
> _
> Wenn Ihnen E-Mail nicht schnell genug ist: MSN Messenger! - 
> http://www.imagine-msn.com/messenger/default2.aspx?locale=de Kostenlos
> downloaden!
>




Re: modifying faces servlet to let view be loaded from a data base by default

2007-04-11 Thread David Delbecq
You mean you want to load view definition from a proprietary DB format
instead of JSP (default) or an xhtml template (Facelets)?
En l'instant précis du 11/04/07 09:49, Eugine F s'exprimait en ces termes:
> Hello users,
> I would like to have a clue as to how I could modify the faces servlet
> or the component that I have to modify to let the view be loaded form
> a data base. Anyone has an idea?
> thanks
> Eugine
>
> _
> Wenn Ihnen E-Mail nicht schnell genug ist: MSN Messenger! - 
> http://www.imagine-msn.com/messenger/default2.aspx?locale=de Kostenlos
> downloaden!
>



Re: how link svg file with jsf component

2007-04-12 Thread David Delbecq
graphicImage renders a  tag. Svgs are not supposed to be
included with such tags. It's like trying to use a img tag to show a
flash object.

See here how to include svg in your page:
http://wiki.svg.org/SVG_and_HTML

When you have understand this, you can use either the ajx4jsf 'media'
component or use the tomahawk 'htmlTag'  component to render your object
tag.

Also don't forget to setup your mimetype in your web.xml for svg ressources.

En l'instant précis du 11/04/07 16:14, mathias °ö° s'exprimait en ces
termes:
> hi
>
> how link an extern svg-file with jsf component.
> with
> http://www.***/file.svg"; />
> it does not work.
>
>   



Re: how link svg file with jsf component

2007-04-12 Thread David Delbecq
Indeed, now you say this, am not sure the tomahwak htmlTag component
accepts attributes other than the default uioutput ones.
maybe something along this?






In facelets i would simply make, without verbatim




but won't work in JSP. Also the media tag of ajax4jsf is made to ouput
'media' in various tags (object, a, img, iframe), if you can afford an
additionnal library...


En l'instant précis du 12/04/07 10:40, mathias °ö° s'exprimait en ces
termes:
>
> 2. use htmTag component
> 
> 
> 
> 
> 
> 
>
> but is does not work. how i handle htmlTag Attributes?
>
> best regards
> mathias °ö°
>
>
> David Delbecq-2 wrote:
>   
>> graphicImage renders a   tag. Svgs are not supposed to be
>> included with such tags. It's like trying to use a img tag to show a
>> flash object.
>>
>> See here how to include svg in your page:
>> http://wiki.svg.org/SVG_and_HTML
>>
>> When you have understand this, you can use either the ajx4jsf 'media'
>> component or use the tomahawk 'htmlTag'  component to render your object
>> tag.
>>
>> Also don't forget to setup your mimetype in your web.xml for svg
>> ressources.
>>
>> En l'instant précis du 11/04/07 16:14, mathias °ö° s'exprimait en ces
>> termes:
>> 
>>> hi
>>>
>>> how link an extern svg-file with jsf component.
>>> with
>>> http://www.***/file.svg"; />
>>> it does not work.
>>>
>>>   
>>>   
>>
>> 
>
>   



Re: modifying faces servlet to let view be loaded from a data base by default

2007-04-13 Thread David Delbecq
En l'instant précis du 12/04/07 10:58, Eugine F s'exprimait en ces termes:
> Hello Simon,
> Thanks I think you got me right. I want to let the viewhandler get all
> the views from the databse. I would ceratainly be working with
> facelets. The idea behind it is developing something liake a content
> management system. I would now have a good look at JspViewHandlerImpl,
> FacesServlet and LifecycleImpl. nBased on that I would try to see if I
> could implement a custom view handler. I would let you know or come
> back to you in case of difficulties. :) Thanks
> Eugine
Then you don't have to write a custom viewhandler but instead write
something the extends facelets (perhaps change some facelets code...)
since facelets has it's own viewhandler that care of loading the .xhtml
from file and parsing it.
>
>> From: Simon Kitching <[EMAIL PROTECTED]>
>> Reply-To: "MyFaces Discussion" <[EMAIL PROTECTED]>
>> To: MyFaces Discussion <[EMAIL PROTECTED]>
>> Subject: Re: modifying faces servlet to let view be loaded from a
>> data base by default
>> Date: Thu, 12 Apr 2007 08:54:08 +1200
>>
>> Hi Eugene,
>>
>> Yes, ViewHandler is one of the main classes you need to look at
>> (JspViewHandlerImpl is the implemenation for JSP pages). Also look at
>> FacesServlet and LifecycleImpl. The code in these three classes is
>> pretty easy to understand.
>>
>> You might want to read:
>>   http://wiki.apache.org/myfaces/StudyGuide
>>
>> I don't know any existing term for this so I'm going to use the
>> phrase "view definition" for something that defines what JSF
>> components are in a view.; "jsp files" and "facelets xtml files" are
>> two examples.
>>
>> If you wanted to get *all* your "view definitions" from a database
>> then I think that would be reasonably simple; just implement a new
>> ViewHandler and then register it in the faces-config file.
>>
>> However if you want *some* of your "view definitions" to be from a
>> database, and some from the database depending on something in the
>> requested URL (eg prefix/suffix) then that might be a bit trickier.
>> I'm not aware of any built-in mechanism that allows different
>> ViewHandlers to be returned based on URL. I'm sure there's some way
>> to achieve this though. Maybe your custom ViewHandler can hold a
>> reference to a JspViewHandler, inspect the URL/viewId and decide
>> whether to handle the request itself or delegate to the underlying
>> implementation?
>>
>> Regards,
>>
>> Simon
>>
>> Eugine F wrote:
>>> Hello ,
>>> The issue is the following; If I ask for a resource such as
>>> "projects.jsp", the faces implementation implementation begins the
>>> request prcessing life cycle. How does the faces implementation go
>>> about getting this resource. Which class is responsible for the
>>> search of this resource and at what stage of the life cycle?  I
>>> would like to know if it is the viewHandler and if possible the
>>> method that takes care of this process. With this knowledge I would
>>> then like to influence the behaviour or customize it.
>>> Thanks
>>>
 From: "Volker Weber" <[EMAIL PROTECTED]>
 Reply-To: "MyFaces Discussion" <[EMAIL PROTECTED]>
 To: "MyFaces Discussion" <[EMAIL PROTECTED]>
 Subject: Re: modifying faces servlet to let view be loaded from a
 data base by default
 Date: Wed, 11 Apr 2007 09:57:18 +0200

 Hi,

 you can use the binding on a panel tag, and create the content in
 your app.

 regards,
  Volker

 2007/4/11, Eugine F <[EMAIL PROTECTED]>:
> Hello users,
> I would like to have a clue as to how I could modify the faces
> servlet or
> the component that I have to modify to let the view be loaded form
> a data
> base. Anyone has an idea?
> thanks
> Eugine
>
> _
> Wenn Ihnen E-Mail nicht schnell genug ist: MSN Messenger! -
> http://www.imagine-msn.com/messenger/default2.aspx?locale=de
> Kostenlos
> downloaden!
>
>
>>>
>>> _
>>> Ihr Blog. Ihre Fotos. Ihre Erlebnisse. Jetzt auf MSN Spaces. - 
>>> http://spaces.msn.com/SignUp.aspx Jetzt anmelden!
>>>
>>
>
> _
> Wenn Ihnen E-Mail nicht schnell genug ist: MSN Messenger! - 
> http://www.imagine-msn.com/messenger/default2.aspx?locale=de Kostenlos
> downloaden!
>



Re: how link svg file with jsf component

2007-04-13 Thread David Delbecq
firefow can load svg using  tag, so you should check the the
object tag is correct and the the pointed svg file is at proper location.

En l'instant précis du 12/04/07 16:10, mathias °ö° s'exprimait en ces
termes:
> i have tested with :
> at browser (ie and firefox) i see only a grey frame. the browser can´t load
> the svg image.
> (if i start the svg image from my file browser it will open.)
>
> my next step i try with  component , but im not sure which
> attribute i must set.
>
>  codetype="image/svg+xml" codebase="test.svg" />
>
> but this code-snapshot does not work.
>
> best regards
>
>
> David Delbecq-2 wrote:
>   
>> Indeed, now you say this, am not sure the tomahwak htmlTag component
>> accepts attributes other than the default uioutput ones.
>> maybe something along this?
>> 
>> > width="400" height="300">
>> 
>> 
>>
>>
>> In facelets i would simply make, without verbatim
>>
>> > width="#{someBean.someSvgWidth}" height="#{someBean.someSvgWidth}">
>> 
>>
>> but won't work in JSP. Also the media tag of ajax4jsf is made to ouput
>> 'media' in various tags (object, a, img, iframe), if you can afford an
>> additionnal library...
>>
>>
>> En l'instant précis du 12/04/07 10:40, mathias °ö° s'exprimait en ces
>> termes:
>> 
>>> 2. use htmTag component
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>
>>> but is does not work. how i handle htmlTag Attributes?
>>>
>>> best regards
>>> mathias °ö°
>>>
>>>
>>> David Delbecq-2 wrote:
>>>   
>>>   
>>>> graphicImage renders a   tag. Svgs are not supposed to be
>>>> included with such tags. It's like trying to use a img tag to show a
>>>> flash object.
>>>>
>>>> See here how to include svg in your page:
>>>> http://wiki.svg.org/SVG_and_HTML
>>>>
>>>> When you have understand this, you can use either the ajx4jsf 'media'
>>>> component or use the tomahawk 'htmlTag'  component to render your object
>>>> tag.
>>>>
>>>> Also don't forget to setup your mimetype in your web.xml for svg
>>>> ressources.
>>>>
>>>> En l'instant précis du 11/04/07 16:14, mathias °ö° s'exprimait en ces
>>>> termes:
>>>> 
>>>> 
>>>>> hi
>>>>>
>>>>> how link an extern svg-file with jsf component.
>>>>> with
>>>>> http://www.***/file.svg"; />
>>>>> it does not work.
>>>>>
>>>>>   
>>>>>   
>>>>>   
>>>> 
>>>> 
>>>   
>>>   
>>
>> 
>
>   



Re: JSF - Java Servlets, compatibility layer?

2007-04-17 Thread David Delbecq
Default JSF is based on JSP to generate the view. JSF can as such
display in a specific area of the JSP. As long as you don't try to get
the output of a sub-jsp or sub-servlet inside a the JSF form but
somewhere around, there shouldn't be any big problem (take care cycle in
parts of the jsp where there are JSF component poses problem, never mix
JSF and JSTL, but you can have them side by side).

If you need deeper mix of JSF/JSP you will have a write a JSF component
that calls a JSP. (Servlet specifications allows you to call a servelt
inside another one, just use it inside your component, you can reach the
servlet context vie the faces context).

For information, i did, in Facelets 2 components that handles JSP/JSF
integration. One call JSP during render view to include output of a JSP
where component should render, the other that call JSP during restore
view, to ensure some datas are setup, but does not do any rendering.

En l'instant précis du 17/04/07 14:43, Tobias Kühne s'exprimait en ces
termes:
> Hi all,
>
> at the moment one of my tasks is, to find out if there is a
> possibility to run Java Servlets from within a Java Server Faces page.
>
> Some background info therefor: we've got a software product that
> consists of Java Servlets and runs on the Tomcat container. All the
> servlets make use of one main servlet by extending its functionality.
>
> Now our long term goal is to migrate from the Java Servlet to the JSF
> / MyFaces technology.
>
> And my question is, if it's possible to write a compatibility layer,
> that calls the servlet and displays it's output within a Java Server
> Faces page. Maybe even by overwriting the HTTPServlet classes... ?
>
> Does such layer perhaps already exist?
>
> Or does anybody know how to solve this problem in an elegant way?
>
> Small changes on the servlets would be no problem at all.
>
> Thank you,
>  Tobias.
>



Re: Modules

2007-04-17 Thread David Delbecq
Quick thought.
En l'instant précis du 17/04/07 14:30, Martin Marinschek s'exprimait en
ces termes:
> Hi *,
>
> for a client, I've worked out a solution (planned, not implemented so
> far) for modularization using facelets and a special JSF configuration
> parser - we're now discussing what other solutions we could have
> possibly taken and what they would look like. So if you could give me
> feedback on this, I'd love to hear what you think about the solution,
> and especially what solutions you've implemented for the same or a
> similar problem.
>
> Basically, we'd want our solution to support the following:
>
> 1) modules are not only controls, but as much as possible also
> business and navigational logic
custom components, beans definitions and navigation logic can be
configured in META-INF/faces-config.xml of the JARs
> 2) develop modules completely independent of one another
> 3) as far as possible, the module developer shouldn't have to know
> that she's developing a module - so there should be as few assumptions
> as possible necessary while developing a module
Well except for the fact your view definition (.xhtml) files can not be
loaded by default from the .JAR, a simple "module template" that
contains either maven or ant rules could be able to build equally
standalone web applications as .war or .JAR files to include in main
application.
>
> The solution we've come up with has the following two main ideas
> behind it:
>
> 1) modules consist of special facelet-components which have a
> src-attribute (something similar to an ui:insert), and a navigation
> step replaces this src attribute instead of the full page (a special
> navigation handler which knows the navigation has happened in a
> component is necessary for this; the mechanism is similar to using the
> sub-form)
> 2) modules define managed beans in their own prefixed faces-config.xml
> files, we parse these configurations to implement our own
> variable-resolver which does a scoped resolution of these managed
> beans
>
> With this, the module developer does not need to know he's developing
> a module, except for a very few issues, and the integration is pretty
> simple.
>
> By the way - portlets were also considered as an option, but the inter
> portlet communication has proven to be complicated.
>
> regards,
>
> Martin
>
>
>



Re: Security - protect JSF pages (.xhtml) via security in web.xml -> DOES NOT WORK ?

2007-04-19 Thread David Delbecq
One of those
/rule/ruleList.faces
/faces/rule/ruleList.xhtml
/faces/rule/*
will most probably work better, depending on how you mapped your
facelets context. If not, please provide full web.xml so we can see
where problem is :)

PS: security contraints apply to url submitted by browser, not internal
forwards that may appear as a result of JSF navigation rule.


En l'instant précis du 19/04/07 10:14, Zohner, Michael s'exprimait en
ces termes:
> Sorry, there was a small mistake:
>
> WRONG:
> So, when I become an "RDSstaticdatarulesrw" user, I can see the page.
> It has no effect.
>
> RIGHT:
> So, when I become ANOTHER USER than "RDSstaticdatarulesrw" user, I can
> see the page.
> So, all that has no effect.
>
>
> Regards
> Michael
>
>
> -Original Message-
> From: Zohner, Michael 
> Sent: 19 April 2007 10:10
> To: MyFaces Discussion
> Subject: Security - protect JSF pages (.xhtml) via security in web.xml
> -> DOES NOT WORK ?
>
> Hi,
>
> I am trying to protect several pages in our jsf application (myFaces,
> facelets, richfaces).
>
> We have a security server where our users have specific roles.
>
> Its an https application.
>
> This is in my web.xml:
>
>  
>   
>SSL Rule Pages
>
>/rule/ruleList.xhtml
>GET
>PUT
>POST
>   
> 
>  
>  RDSstaticdatarulesrw
> 
>   
>CONFIDENTIAL
>   
>  
>
> So, when I become an "RDSstaticdatarulesrw" user, I can see the page.
> It has no effect.
>
> When I write /rule/* instead of
> /rule/ruleList.xhtml, I cannot see ANY pages.
> Also not the pages which are NOT in directory "rule".
>
> So, HOW can I get this working ?
>
> The best would be to protect whole dirs and single pages.
>
> Best regards
> Michael
>
>
> 
> Dresdner Bank AG
> Sitz/Registered Office: Frankfurt am Main, Handelsregister/Commercial
> Register: Amtsgericht/Local Court, Frankfurt am Main, HRB 14000
> Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board:
> Michael Diekmann Vorstand/Board of Managing Directors: Herbert Walter
> (Vorsitzender/Chairman), Andreas Georgi, Stefan Jentzsch, Wulf Meier,
> Andree Moschner, Klaus Rosenfeld, Otto Steinmetz, Friedrich Woebking 
>
> This e-mail is confidential and the information contained in it may be
> privileged.  It should not be read, copied or used by anyone other than
> the intended recipient.  If you have received it in error, please
> contact the sender immediately by telephoning +44 (0)20 7623 8000 or by
> return email, and delete the e-mail and do not disclose its contents to
> any person.  We believe, but do not warrant, that this e-mail and any
> attachments are virus free, but you must take full responsibility for
> virus checking.  Please refer to
> http://www.dresdnerkleinwort.com/disc/email/ and read our e-mail
> disclaimer statement and monitoring policy.
> 
>
>
> 
> Dresdner Bank AG
> Sitz/Registered Office: Frankfurt am Main, Handelsregister/Commercial 
> Register: Amtsgericht/Local Court, Frankfurt am Main, HRB 14000 
> Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Michael 
> Diekmann 
> Vorstand/Board of Managing Directors: Herbert Walter (Vorsitzender/Chairman), 
> Andreas Georgi, Stefan Jentzsch, Wulf Meier, Andree Moschner, Klaus 
> Rosenfeld, Otto Steinmetz, Friedrich Woebking 
>
> This e-mail is confidential and the information contained in it may be 
> privileged.  It should not be read, copied or used by anyone other than the 
> intended recipient.  If you have received it in error, please contact the 
> sender immediately by telephoning +44 (0)20 7623 8000 or by return email, and 
> delete the e-mail and do not disclose its contents to any person.  We 
> believe, but do not warrant, that this e-mail and any attachments are virus 
> free, but you must take full responsibility for virus checking.  Please refer 
> to http://www.dresdnerkleinwort.com/disc/email/ and read our e-mail 
> disclaimer statement and monitoring policy.
> 
>
>   



Re: Security - protect JSF pages (.xhtml) via security in web.xml -> DOES NOT WORK ? -> THE WEB.XML !

2007-04-19 Thread David Delbecq
your security constraint's url pattern
 /rule/ruleList.xhtml

Only prevent unauthorized users from pointing their browser at
http://server/yourWebapp//rule/ruleList.xhtml

It does not prevent them from pointing browser to
http://server/yourWebapp/rule/ruleList.faces or
http://server/yourWebapp/rule/ruleList.jsf

you probably want to have url pattern for .faces and .jsf instead of .xhtml


En l'instant précis du 19/04/07 10:52, Zohner, Michael s'exprimait en
ces termes:
> Hi,
>
> I dont know if I really understood Martins proposal.
>
> We have to use the scurity constraint I think.
>
> Here is the web.xml:
>
> 
>
> http://java.sun.com/xml/ns/j2ee";
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>
>  Data Staging area for Static data
>  App
>
>  
>   Ajax4jsf Filter
>   ajax4jsf
>   org.ajax4jsf.FastFilter
>  
>
>  
>  
>   extensionsFilter
>   
>   
> org.apache.myfaces.webapp.filter.ExtensionsFilter
>   
>
>maxFileSize
>2m
>   
>   
>uploadThresholdSize
>100k
>   
>  
>
>
>  
>   ajax4jsf
>   faces
>   REQUEST
>   FORWARD
>   INCLUDE
>  
>  
>   extensionsFilter
>   faces
>  
>  
>   extensionsFilter
>   /faces/myFacesExtensionResource/*
>  
>
>  
> 
> javax.faces.CONFIG_FILES
> 
> /WEB-INF/faces-beans.xml,/WEB-INF/faces-nav.xml
> 
>  
>
>  
>   
>   javax.faces.STATE_SAVING_METHOD
>   server
>  
>
>  
>  
>   org.ajax4jsf.VIEW_HANDLERS
>   com.sun.facelets.FaceletViewHandler
>  
>
>   
>  
>   javax.faces.DEFAULT_SUFFIX
>   .xhtml
>  
>
>   
>   facelets.REFRESH_PERIOD
>   2
>  
>
>  
>   facelets.DEVELOPMENT
>   true
>  
>
>  
> com.sun.faces.validateXml
> true
>  
>
>  
> com.sun.faces.verifyObjects
> true
>  
>
>  
> org.ajax4jsf.SKIN
> dkib
>  
>
>  
>   facelets.LIBRARIES
>   
>  /WEB-INF/taglib/tomahawk.taglib.xml;/WEB-INF/taglib/facestrace.taglib.xml
>   
>  
>
>  
>   
>   org.apache.myfaces.ALLOW_JAVASCRIPT
>   true
>  
>
>  
>   org.apache.myfaces.DETECT_JAVASCRIPT
>   false
>  
>
>  
>   
>   org.apache.myfaces.PRETTY_HTML
>   true
>  
>
>  
>   
>   org.apache.myfaces.AUTO_SCROLL
>   true
>  
>
>  
>   org.apache.myfaces.COMPRESS_STATE_IN_SESSION
>   false
>  
>
>  
>   org.apache.myfaces.CHECK_EXTENSIONS_FILTER
>   false
>  
>
>
> 
> faces
> javax.faces.webapp.FacesServlet
> 1
> 
>
>   
>   jsp
>   
>   org.apache.jasper.servlet.JspServlet
>   
>   
>   keepgenerated
>   true
>   
>   
>   logVerbosityLevel
>   FATAL
>   
>   
>   classdebuginfo
>   true
>   
>   
>   enablePooling
>   false
>   
>   0
>   
>
>  
>   JspRedirector
>   /test/jspRedirector.jsp
>  
>
>  
>  
>   faces
>   *.jsf
>  
>
>  
>   faces
>   *.faces
>  
>
>  
>   JspRedirector
>   /JspRedirector
>  
>
>  
>   jsp
>   *.jsp
>  
>
>  
>   jsp
>   *.jspf
>  
>
>  
>   600
>  
>
>  
>  
>   index.html
>   index.jsp
>   /jsf/index.jsf
>  
>  
>   401
>   /Http401Unauthorized
>  
>  
>   java.lang.Throwable
>   /ErrorCtrl
>  
>  
>  
>   
>jstl-sql-rt.tld
>/WEB-INF/taglib/jstl-sql-rt.tld
>   
>   
>jstl-fmt.tld
>/WEB-INF/taglib/jstl-fmt.tld
>   
>   
>jstl-core.tld
>/WEB-INF/taglib/jstl-core.tld
>   
>  
>
>  
>   
>SSL Scheduler Pages
>
>/scheduler/schedulerManager.xhtml
>GET
>PUT
>POST
>   
> 
>  
>  RDSstaticdatadeveloper
> 
>   
>CONFIDENTIAL
>   
>  
>
>  
>   
>SSL Rule Pages
>
>/rule/ruleList.xhtml
>GET
>PUT
>POST
>   
> 
>  
>  RDSstaticdatarulesrw
> 
>   
>CONFIDENTIAL
>   
>  
>
>  
>   CLIENT-CERT
>   gds
>  
>
>  
>   developer role - access to 

Re: Security - protect JSF pages (.xhtml) via security in web.xml -> DOES NOT WORK ? -> THE WEB.XML !

2007-04-19 Thread David Delbecq
En l'instant précis du 19/04/07 11:17, Zohner, Michael s'exprimait en
ces termes:
> How to do that ?
>   
Obviously by having more appropriate  in your

> It would be also ok to protect the whole directory (so, then it is 
> independent, which suffix the pages have).
>
> But who can I get this working ? 
>
> -Original Message-
> From: David Delbecq [mailto:[EMAIL PROTECTED] 
> Sent: 19 April 2007 11:17
> To: MyFaces Discussion
> Subject: Re: Security - protect JSF pages (.xhtml) via security in web.xml -> 
> DOES NOT WORK ? -> THE WEB.XML !
>
> your security constraint's url pattern
>  /rule/ruleList.xhtml
>
> Only prevent unauthorized users from pointing their browser at 
> http://server/yourWebapp//rule/ruleList.xhtml
>
> It does not prevent them from pointing browser to 
> http://server/yourWebapp/rule/ruleList.faces or 
> http://server/yourWebapp/rule/ruleList.jsf
>
> you probably want to have url pattern for .faces and .jsf instead of .xhtml
>
>
> En l'instant précis du 19/04/07 10:52, Zohner, Michael s'exprimait en ces 
> termes:
>   
>> Hi,
>>
>> I dont know if I really understood Martins proposal.
>>
>> We have to use the scurity constraint I think.
>>
>> Here is the web.xml:
>>
>> 
>>
>> http://java.sun.com/xml/ns/j2ee";
>>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
>> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>
>>  Data Staging area for Static data  
>> App
>>
>>  
>>   Ajax4jsf Filter
>>   ajax4jsf
>>   org.ajax4jsf.FastFilter
>>  
>>
>>  
>>  
>>   extensionsFilter
>>   
>>   
>> org.apache.myfaces.webapp.filter.ExtensionsFilter
>>   
>>
>>maxFileSize
>>2m
>>   
>>   
>>uploadThresholdSize
>>100k
>>   
>>  
>>
>>
>>  
>>   ajax4jsf
>>   faces
>>   REQUEST
>>   FORWARD
>>   INCLUDE
>>  
>>  
>>   extensionsFilter
>>   faces
>>  
>>  
>>   extensionsFilter
>>   /faces/myFacesExtensionResource/*
>>  
>>
>>  
>> 
>> javax.faces.CONFIG_FILES
>> 
>> /WEB-INF/faces-beans.xml,/WEB-INF/faces-nav.xml
>> 
>>  
>>
>>  
>>   
>>   javax.faces.STATE_SAVING_METHOD
>>   server
>>  
>>
>>  
>>  
>>   org.ajax4jsf.VIEW_HANDLERS
>>   com.sun.facelets.FaceletViewHandler
>>  
>>
>> 
>>   javax.faces.DEFAULT_SUFFIX
>>   .xhtml
>>  
>>
>>   
>>   facelets.REFRESH_PERIOD
>>   2
>>  
>>
>>  
>>   facelets.DEVELOPMENT
>>   true
>>  
>>
>>  
>> com.sun.faces.validateXml
>> true
>>  
>>
>>  
>> com.sun.faces.verifyObjects
>> true
>>  
>>
>>  
>> org.ajax4jsf.SKIN
>> dkib
>>  
>>
>>  
>>   facelets.LIBRARIES
>>   
>>  
>> /WEB-INF/taglib/tomahawk.taglib.xml;/WEB-INF/taglib/facestrace.taglib.xml
>>   
>>  
>>
>>  
>>   
>>   org.apache.myfaces.ALLOW_JAVASCRIPT
>>   true
>>  
>>
>>  
>>   org.apache.myfaces.DETECT_JAVASCRIPT
>>   false
>>  
>>
>>  
>>   
>>   org.apache.myfaces.PRETTY_HTML
>>   true
>>  
>>
>>  
>>   
>>   org.apache.myfaces.AUTO_SCROLL
>>   true
>>  
>>
>>  
>>   org.apache.myfaces.COMPRESS_STATE_IN_SESSION
>>   false
>>  
>>
>>  
>>   org.apache.myfaces.CHECK_EXTENSIONS_FILTER
>>   false
>>  
>>
>>
>> 
>> faces
>> javax.faces.webapp.FacesServlet
>> 1
>> 
>>
>>  
>>  jsp
>>  
>>  org.apache.jasper.servlet.JspServlet
>>  
>>  
>>  keepgenerated
>>  true
>>  
>>  
>>  logVerbosityLevel
>>  FATAL
>>  
>>  
>>  classdebuginfo
>>  true
>>  
>>  
>>  enablePooling
>>  false
>>  
>>  0
>>

Re: i am new use of myfaces tomhawk

2007-04-23 Thread David Delbecq
Configuration of tomahawk is available on tomahawk site.

En l'instant précis du 23/04/07 15:38, deepraj s'exprimait en ces termes:
> i am new user of myfaces tomhawk please give me details like filter setting
> in web.xml
> and jsf
> i basically use jsf ,netbeans5.5,sun app server.
> which jar files are required.
> how to setup tomhawk.
> which configration are required.
> please provide me details
> thanks
>
>   



Re: Modifying XHTML through a filter

2007-05-02 Thread David Delbecq
Correct me if i am wrong, but ajax4jsf already has a filter that
corrects html responses to make them xhtml compliant (and then parseable
by xmlHttpRequest client side)

http://labs.jboss.com/file-access/default/members/jbossajax4jsf/freezone/docs/devguide/FAQ.html#FilterUsageDamagesAnApplicationLayout

En l'instant précis du 02/05/07 10:53, Rudi Steiner s'exprimait en ces
termes:
> Hi Jonathan,
>
> thank you for your answer. This is exactly the way to resolve the
> problem. A howto can be found here:
> http://www.javaworld.com/javaworld/jw-08-2003/jw-0829-designpatterns.html?page=2
>
>
> I know that modifying the generated markup this way is not recommended
> by software engineers ;) but I lost a lot of time on this topic and I
> think this is the fastest way. After this discussion:
> http://www.nabble.com/XHTML-Strict-tf3582852.html, i decided to do
> this.
>
> I'm not a developer, so I hope that someone is reading this mailings
> and take this discussion as an input for further improvements. I think
> that one of the primary objectives  of a web framework like myFaces
> should be, to generate standard conform markup. No component should be
> integrated in a official release, if it dosn't generate clean markup.
> At the moment, myFaces is neither XHTML nor HTML 4.01 conform.
>
> Best regards,
> Rudi
>
> On 4/27/07, Jonathan Harley <[EMAIL PROTECTED]> wrote:
>> Rudi Steiner wrote:
>> > I have still the problem with the generated XHTML from myFaces. I
>> > reduced my app to a few basic mechanisms, but this basic mechanisms
>> > must produce XHTML strict. To achieve this, i would like to wirte a
>> > filter, which makes light modifications of the generated markup, just
>> > to  satisfy the validator. For example, I would surround a hidden
>> > field, generated by myFaces with a -Tag.
>> >
>> > Could anyone please give me a hint how to achieve this. I tried it
>> > with regular expressions but I think, it is not possible to work with
>> > RE on OutputStreams.
>>
>> You'd have to buffer the output and work on that - I think this is
>> what the MyFaces Extensions filter does too.
>>
>> This is easily done in servlet filters, because each filter passes
>> the request and response objects down the chain, which are then
>> used by everything downstream of your filter. If instead of passing
>> on the same response that you received, you pass on a "decorated"
>> (enhanced) response, which overrides getOutputStream() and
>> getWriter(), you can give everyone else something which looks like
>> an OutputStream or PrintWriter but actually just captures everything
>> to a buffer. You can then manipulate the buffer as you wish.
>>
>> Fixing MyFaces to generate compliant XHTML in the first place would
>> be a much better solution though, because otherwise you'll probably
>> have to update this filter every time MyFaces or Tomahawk are
>> updated.
>>
>> MyFaces may have to generate HTML 4 to pass the TCK, but what
>> about a context-param setting to switch on strict XHTML markup
>> generation? It presumably wouldn't affect very many things anyway.
>>
>>
>> Jonathan.
>> -- 
>> .
>>Dr Jonathan Harley   .
>> .   Email: [EMAIL PROTECTED]
>> Zac Parkplatz Ltd   .   Office Telephone: 024 7633 1375
>> www.parkplatz.net   .   Mobile: 079 4116 0423
>>



Re: injecting HTML through a BackingBean

2007-05-08 Thread David Delbecq

En l'instant précis du 08/05/07 11:58, omidh s'exprimait en ces termes:
> Hi,
> I use a RichtextBox in my Portlet, which is using MyFaces.
> Now I would like to display the written Text (in the richtextBox Editor)
> in some other pages. As you know the Text out of the richtextbox looks like
> these:
> richtext RICHTEXT bla  
> unterstrichen
>
> how can I inject these String from a BackingBean into my "generated page"?
> is in myfaces or tomahawk a Tag for things like that?
>
> thanks in advance,
> Omid
>
>   



Re: JSF Dropdown Perfomance Issues

2007-05-08 Thread David Delbecq
En l'instant précis du 08/05/07 17:52, bansi s'exprimait en ces termes:
>
>  value="#{manufacturerBean.selectedManufacturer}" > 
>  
>  
>  event="onchange"
> reRender="manufName,manufDescription,manufSource,btnSave,btnDelete" /> 
>  
>  
>
>
> Here are my concerns
> - Just picking a value from the dropdown shouldn't result in a call to
> database especially when there are no changes made to database
>   
When you pickup a data an submit form (that's what a4j does), JSF ensure
the value user selected is in the list of available values. This is part
of validation process. To do this, it iterate over child select items,
resulting in a call to get f:selectItems entries, resulting in
evaluation of #{manufacturerBean.manufacturerList}. If you want to
prevent useless database calls, you must do it in manufacturerList.
f:selectItems is stateless and won't keep the list in cache.

Note: you might want to consider the Hibernate second level cache &
query caching to prevent too many database queries.






Re: The absolute uri: http://myfaces.apache.org/sandbox cannot be resolved in either web.xml or the jar files deployed with this application

2007-05-09 Thread David Delbecq
Check the tag-lib is present in the jar (META-INF/) folder. It can be a
case of bad snapshot compilation, or a case of truncated .jar file
during transfert. I already got the last case a while before with
another taglib, it seems truncated .jar file stay unnoticed, only the
truncated content is silently made unavalaible. Since most jar building
scripts do put the META-INF/ content in the last entries of the .jar,
those are the first dropped.


En l'instant précis du 09/05/07 14:28, Bjørn T Johansen s'exprimait en
ces termes:
> I am suddenly getting this error but I am not sure what I have done to get 
> this:
>
> The absolute uri: http://myfaces.apache.org/sandbox cannot be resolved in 
> either web.xml or the jar files deployed with this
> application
>
>
> Any idea how to fix this?
> (I have tomahawk-sandbox-1.1.5-SNAPSHOT.jar in my lib dir...)
>
>
> Regards,
>
> BTJ
>
>   



Re: Problem with Datalist.

2007-05-10 Thread David Delbecq
Carlos Ortiz a écrit :
> datalist is not render absoult nothing. any other jsf tag is working
> but this one [datalist] just dont render,I'm using the jars form the
> example download ,
> any ideas. ¡?
basic thought: because list empty?
>
>  
>> 
>>
>> > layout="grid" id="none" >
>> > value="#{car.Id}">
I think general convention uses #{car.id} not #{car.Id}. It shouldn't
change behavious because EL parser uppercase itself first letter and
adds get or set in front to have method name. However, id fits more java
conventions for naming fields than Id. Same remark for Brand, Model and
Name.
>> > value="#{car.Brand}">
>> > value="#{car.Model}">
>> > value="#{car.Name}">
>>
>> 
>>   
> the Car
> public class SimpleCar {
>private int Id;
>private String Brand; 
>private String Model;
>private String Name;
>  public String getBrand() {
>return Brand;
>}
>public void setBrand(String brand) {
>Brand = brand;
>}
Same remark here, java conventions is to use lowerCamelCase for fields,
variables and method names and UpperCamelCase for class names.This way
when you do something.x() and Something.y() you know you call method x
on instance something and call static methid y() on class Something with
looking up at declaration code :)
>public int getId() {
>return Id;
>}
>public void setId(int id) {
>Id = id;
>}
>public String getModel() {
>return Model;
>}
>public void setModel(String model) {
>Model = model;
>}
>public String getName() {
>return Name;
>}
>public void setName(String name) {
>Name = name;
>}
>  
> the car bean
>
> import java.util.ArrayList;
> import java.util.List;
>
>
> public class CarBean {
>
> private List lst;
>
>public CarBean() {
>lst=new ArrayList();
>int i=0,current;
>for(;i<15;i++){
>SimpleCar tmp=new SimpleCar();
>tmp.setBrand("BMW");
>tmp.setId(i);
>tmp.setModel("X5");
>tmp.setName(String.valueOf(i)+tmp.getModel());
>}
>current=i;
>current+=15;
>  for(;iSimpleCar tmp=new SimpleCar();
>tmp.setBrand("BMW");
>tmp.setId(i);
>tmp.setModel("Z32");
>tmp.setName(String.valueOf(i)+tmp.getModel());
>}
>current=i;
>current+=15;
>for(;iSimpleCar tmp=new SimpleCar();
>tmp.setBrand("Hyunday");
>tmp.setId(i);
>tmp.setModel("Elentra");
>tmp.setName(String.valueOf(i)+tmp.getModel());
>}
>current=i;
>current+=15;
>for(;iSimpleCar tmp=new SimpleCar();
>tmp.setBrand("Hyunday");
>tmp.setId(i);
>tmp.setModel("Getz");
>tmp.setName(String.valueOf(i)+tmp.getModel());
>}
>current=i;
>current+=15;
>for(;iSimpleCar tmp=new SimpleCar();
>tmp.setBrand("VolksWagen");
>tmp.setId(i);
>tmp.setModel("Polo");
>tmp.setName(String.valueOf(i)+tmp.getModel());
>}
>current=i;
>current+=15;
>for(;iSimpleCar tmp=new SimpleCar();
>tmp.setBrand("VolksWagen");
>tmp.setId(i);
>tmp.setModel("Jetta");
>tmp.setName(String.valueOf(i)+tmp.getModel());
>}
>current=i;
>current+=15;
>for(;iSimpleCar tmp=new SimpleCar();
>tmp.setBrand("Toyota");
>tmp.setId(i);
>tmp.setModel("Rav4");
>tmp.setName(String.valueOf(i)+tmp.getModel());
>}
>  current=i;
>current+=15;
>for(;iSimpleCar tmp=new SimpleCar();
>tmp.setBrand("Toyota");
>tmp.setId(i);
>tmp.setModel("Corolla");
>tmp.setName(String.valueOf(i)+tmp.getModel());
>}
>  }
Nice, lots of tmp SimpleCar but... Where do you store them? ;)
>
>public List getLst() {
>return lst;
Returns a brand new never use empty list ;)
>}
>
>public void setLst(List lst) {
>this.lst = lst;
>}
>
>  
>
>
> }
>
>
>



Re: SingleStepButtonBarRenderer$Button overrides final method .?

2007-05-11 Thread David Delbecq
En l'instant précis du 11/05/07 13:31, Stephen Friedrich s'exprimait en
ces termes:
> I just upgraded from 1.0.0 to current CVS to see if the i18m bug I
> reported is fixed already.
> Unfortunately I now cannot even start my app anymore.
> Deployment fails with this exception:
>
> 11:35:23,843 ERROR [FacesConfigurator] failed to configure class
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SingleStepButtonBarRenderer
>
> java.lang.VerifyError: class
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SingleStepButtonBarRenderer$Button
> overrides final method .
The method name above is strange, could you check your .jar file did not
get corrupted. Try to clean your trinidad source and rebuild jar if you
are building from sources. Final methods overriding should be detected
by compiler. If it is not and it reaches runtim, it's probably that your
webapp is using old jar of some dependency that changed or that you have
conflicting version of some libs inside your WEB-INF/lib

> at java.lang.ClassLoader.defineClass1(Native Method)
>
> From the svn log I see that "awiner" "made singleStepButtonBar
> Faces-major" whatever that means.
>
> Any clues how to solve this? I guess that I have some old jars in my
> classpath, because the trinidad sources compiled just fine.



Re: Needs help for creating a new JSF component

2007-05-22 Thread David Delbecq
There are tutorial on how to create components and renderes.
Now while your goal is easy, it's realization isn't, creating composite
components is not straightfoward in JSF.
I see 4 ways to do so

1) don't use child components, just render several form fields in the
renderer and decode them yourself
2) During your component initialisation create child components
(getChildren().add()). The tricky part is to not redo it when it's a
restore view (because JSF recreated child components for you). The
easiest way is to do it lazily and store in your main component state a
'childCreated' property
3) Use facelets, which can easily be used to create composite components
4) Create the whole composite component tree in a bean and use binding.

Storing your component clientId inside a bean should not be necessary.
You always have your component as parameter when you need it in JSF
(render, restore, apply values, ...).

En l'instant précis du 22/05/07 13:34,
[EMAIL PROTECTED] s'exprimait en ces termes:
>
> Hi,
>
> I have to develop a new JSF component (component, tag and renderer).
>
> The goal of this new component is easy... Put together severals input
> zone in one single component.
>
> I have done somethink that works... But i'm not sure I did everything
> correctly. (in the State of Art)
> --> Should be great if I can get a link to a complete tutorial or full
> sample.
>
> I create some code I don't like:
> --> I have to "hardcoded" in the backingbean the "id" of my component
> and then cast it to my component.
> In my backingbean, the code looks like this:
> UIComponent temp =
> FacesContext.getCurrentInstance().getViewRoot().findComponent("dialog:dialog-body:mltext");
> UIMltext myComponent = (UIMltext) temp;
>
> During reading documentation I have found it is possible to "add"
> component in the JSF tree dynamicly with code like this:
> public void addControls(ActionEvent actionEvent)
> {
> Application application =
> FacesContext.getCurrentInstance().getApplication();
> //Question: how to get controlPanel ???
> List children = controlPanel.getChildren();
> children.clear();
> for (int count = 0; count < numControls; count++)
> {
> HtmlOutputText output =
> (HtmlOutputText)application.createComponent(HtmlOutputText.COMPONENT_TYPE);
> output.setValue(" " + count + " ");
> output.setStyle("color: blue");
> children.add(output);
> }
> }
> Is it necessary in my component. What is the goal of adding component
> in the tree?
>
> I can now do: "MyValue myValues = myComponent.getValue()"
>
> Then I have to do somethink like:
>
> backingBean.setValue1(myValues.getValue1());
> backingBean.setValue2(myValues.getValue2());
> ...
> backingBean.setValuex(myValues.getValuex());
>
> Is it correct? I should prefer the setter are called by JSF layer. Is
> it possible?
> Thanks a lot.
> Stéphane
>



Re: howto click a t:commandbutton via js

2007-05-22 Thread David Delbecq
no, it will only call the event of onClick but not necesseraly submit form.

To act a if user clicked on button, just do

document.getElementById('formxX::selectButton').click();


En l'instant précis du 22/05/07 14:15, Benjamin Bratkus s'exprimait en
ces termes:
> *i guess you mean the onClick() for the submit button ? or do you mean
> i have to write my own method ?
>
> ben
>
> p.s. the onclick does not work...
>
>
> On Tue, 22 May 2007 14:51:30 +0300, Ayhan Güngör wrote*
> > try
> > ...
> > document.getElementsByName('selectbutton').x_onClick();"/>
> > ...
> >
> > On 5/22/07, *Benjamin Bratkus * <[EMAIL PROTECTED]
> > wrote:
>
> hi folks,
> >
> > actually i am fighting with my different browsers :P so for
> firefox 1.x and
> > 2.x my app works fine but the same side within ie6 do not work.
> >
> > means i fill in in a h:inputText a string and press return and i
> got the next
> > view by using the button under the inpuText
> >
> > ie ignores me :9
> >
> > so i thought about something like :
> >
> > 
> > #{msg['add.byusername']} 
> >  > x_onKeyPress="if(event.keyCode == 13)
> > document.getElementsByName('selectbutton').doclick();"/>
> >  Orientation in Objects GmbH
> Weinheimer Str. 68
> D-68309 Mannheim
> http://www.oio.de 
> Tel. +49(0)621-71839-0
> Fax +49(0)621-71839-50
>
> Amtsgericht Mannheim
> HRB 38348
>



Re: Needs help for creating a new JSF component

2007-05-23 Thread David Delbecq
There are tutorial on how to create components and renderes.
Now while your goal is easy, it's realization isn't, creating composite
components is not straightfoward in JSF.
I see 4 ways to do so

1) don't use child components, just render several form fields in the
renderer and decode them yourself
2) During your component initialisation create child components
(getChildren().add()). The tricky part is to not redo it when it's a
restore view (because JSF recreated child components for you). The
easiest way is to do it lazily and store in your main component state a
'childCreated' property
3) Use facelets, which can easily be used to create composite components
4) Create the whole composite component tree in a bean and use binding.

Storing your component clientId inside a bean should not be necessary.
You always have your component as parameter when you need it in JSF
(render, restore, apply values, ...).

En l'instant précis du 22/05/07 13:34,
[EMAIL PROTECTED] s'exprimait en ces termes:
>
> Hi,
>
> I have to develop a new JSF component (component, tag and renderer).
>
> The goal of this new component is easy... Put together severals input
> zone in one single component.
>
> I have done somethink that works... But i'm not sure I did everything
> correctly. (in the State of Art)
> --> Should be great if I can get a link to a complete tutorial or full
> sample.
>
> I create some code I don't like:
> --> I have to "hardcoded" in the backingbean the "id" of my component
> and then cast it to my component.
> In my backingbean, the code looks like this:
> UIComponent temp =
> FacesContext.getCurrentInstance().getViewRoot().findComponent("dialog:dialog-body:mltext");
> UIMltext myComponent = (UIMltext) temp;
>
> During reading documentation I have found it is possible to "add"
> component in the JSF tree dynamicly with code like this:
> public void addControls(ActionEvent actionEvent)
> {
> Application application =
> FacesContext.getCurrentInstance().getApplication();
> //Question: how to get controlPanel ???
> List children = controlPanel.getChildren();
> children.clear();
> for (int count = 0; count < numControls; count++)
> {
> HtmlOutputText output =
> (HtmlOutputText)application.createComponent(HtmlOutputText.COMPONENT_TYPE);
> output.setValue(" " + count + " ");
> output.setStyle("color: blue");
> children.add(output);
> }
> }
> Is it necessary in my component. What is the goal of adding component
> in the tree?
>
> I can now do: "MyValue myValues = myComponent.getValue()"
>
> Then I have to do somethink like:
>
> backingBean.setValue1(myValues.getValue1());
> backingBean.setValue2(myValues.getValue2());
> ...
> backingBean.setValuex(myValues.getValuex());
>
> Is it correct? I should prefer the setter are called by JSF layer. Is
> it possible?
> Thanks a lot.
> Stéphane
>



Re: Why do managed beans must implement the Serializable interface

2007-05-23 Thread David Delbecq
If you don't want serialized bean, make them request scope bean.
Session scope bean must be serializable whatever happen.

Not sure i understand you last problem, but if you want to link B to A
(so A see the B instance managed by JSF) you can do this in
faces-config.xml, using managed-properties. That way, if A and B are
sessions scope, you are guaranteed they stay together. (This can also
work if B is session scope and A request, JSF will setup A at each request)

Hope this help.

En l'instant précis du 23/05/07 17:39, Trumml s'exprimait en ces termes:
> Thanks for this short reply.
> But this serialization is a little bit problematic for me...
> I have a site with two different backing beans and a command button. The
> command button calls method A.1 from bean A, the site is reloaded (the
> method changes some properties of bean A) and all properties of A are
> renewed within the jsf site. Additionally A.1 changes some properties of
> bean B but those properties are not renewed within the view.
> So I tried to use component binding with bean B but this does not work
> because I can not use HtmlOutputText with my bean B because it is not
> serializable...?
>
> 
> 
> 
>
>
>
>
> Werner Punz-2 wrote:
>   
>> This has to be done due to the jsf inherent state saving and also some
>> app server serialize the sessions for clustering.
>>
>> Werner
>>
>>
>> Trumml schrieb:
>> 
>>> I use MyFaces (1.1.5) with Tomahawk and Facelet support. I added the
>>> following commmand to my xhtlm site:
>>> 
>>> When I press this button an Exception is thrown because the
>>> PatientNavigatorBean is not serializable. My question is: which managed
>>> beans have to be serializable, when and why?
>>> When I add the Serializable interface to my managed bean everything works
>>> fine but I do want to know why I have to do this and are there possibly
>>> any
>>> fields in my bean which might be transient?
>>>
>>> => I already found a forum post but it does not contain the correct
>>> answer
>>> for my question i guess (
>>> http://www.nabble.com/What-requires-implementing-the-Serializable-interface--tf991035.html#a2566919
>>> http://www.nabble.com/What-requires-implementing-the-Serializable-interface--tf991035.html#a2566919
>>> )
>>>
>>> 16:16:37,983 ERROR [JspStateManagerImpl] Exiting serializeView - Could
>>> not
>>> serialize state: at.co.systema.ce.jsf.PatientNavigator
>>> java.io.NotSerializableException: at.co.systema.ce.jsf.PatientNavigator
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
>>> at
>>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
>>> at
>>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
>>> at
>>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
>>> at
>>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
>>> at
>>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
>>> at
>>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
>>> at
>>> java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
>>> at
>>> java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
>>> at
>>> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
>>> at java.util.ArrayList.writeObject(ArrayList.java:569)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>> at
>>> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
>>> at
>>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
>>> at
>>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
>>> at
>>> java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
>>> at
>>> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
>>> at java.util.ArrayList.writeObject(ArrayList.java:569)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce

Re: Started using Myfaces 1.1.5 and every page is broken (duplicate ID in the faces tree Component)

2007-05-23 Thread David Delbecq
Since you seem to be using facelets:

http://wiki.java.net/bin/view/Projects/FaceletsFAQ#I_m_getting_Duplicate_ID_Errors

SiSi'mon a écrit :
> We are getting errors on nearly every page now that we are using MyFaces
> 1.1.5.  All seem to point to a duplicate ID problem but checking the xHTML
> there is no duplicate ID.  This seems to be generated or something. 
>
> Something seems quite mucked up.  any ideas?
>
> ---
>
> SEVERE: Error Rendering View[/web/Information.xhtml]
> java.lang.IllegalStateException: Client-id : _id81 is duplicated in the
> faces tree. Component : idListForm:idPopupDataTable:_id81, path:
> {Component-Path : [C
>
> ---
>   


Re: Caching JSF Dropdown Results

2007-05-23 Thread David Delbecq
Hi Bansi,
This is the third time you as the same problem about the fact list of
item is re-read from bean each time a dropdown is used. You should
probably referer to response already given to you:

http://www.nabble.com/JSF-Dropdown-Perfomance-Issues-tf3710469.html#a10378469
http://www.nabble.com/Perfomance-Issues-with-JSF-dropdown-tf3694314.html#a10330594

bansi a écrit :
> I have  following dropdown 
>
> Code: 
>
>  
>
>   
>value="#{manufacturerBean.selectedManufacturer}" >   
>  
> 
> 
>  
>action="#{manufacturerBean.loadManufacturerDetails}" event="onchange"
> reRender="manufName,manufDescription,manufSource,btnSave,btnDelete" />
>
> 
>  
>
> 
> The perfomance issue is Whenever i pick a  value from the dropdown it
> results in 3 datbase calls 
> Here is the sequence of method calls 
> - First time the method in f:selectItems gets called which results in a
> database call
> 
> - Second time as expected/desired Ajax4JSF onchange event action method gets
> called 
>  event="onchange"
> reRender="manufName,manufDescription,manufSource,btnSave,btnDelete" />
> - Third time again the method in f:selectItems gets called which results in
> a database call
> 
>
> I understand its due to JSF Lifcycle. 
>
>
> Any pointers/suggestion on how to Cache the method getManufacturerList() to
> avoid unnecessary database calls will be highly appreciated
>
> Regards
> Bansi
>
>   


Re: Why do managed beans must implement the Serializable interface

2007-05-23 Thread David Delbecq
If you don't want serialized bean, make them request scope bean.
Session scope bean must be serializable whatever happen.

Not sure i understand you last problem, but if you want to link B to A
(so A see the B instance managed by JSF) you can do this in
faces-config.xml, using managed-properties. That way, if A and B are
sessions scope, you are guaranteed they stay together. (This can also
work if B is session scope and A request, JSF will setup A at each request)

Hope this help.

En l'instant précis du 23/05/07 17:39, Trumml s'exprimait en ces termes:
> Thanks for this short reply.
> But this serialization is a little bit problematic for me...
> I have a site with two different backing beans and a command button. The
> command button calls method A.1 from bean A, the site is reloaded (the
> method changes some properties of bean A) and all properties of A are
> renewed within the jsf site. Additionally A.1 changes some properties of
> bean B but those properties are not renewed within the view.
> So I tried to use component binding with bean B but this does not work
> because I can not use HtmlOutputText with my bean B because it is not
> serializable...?
>
> 
> 
> 
>
>
>
>
> Werner Punz-2 wrote:
>   
>> This has to be done due to the jsf inherent state saving and also some
>> app server serialize the sessions for clustering.
>>
>> Werner
>>
>>
>> Trumml schrieb:
>> 
>>> I use MyFaces (1.1.5) with Tomahawk and Facelet support. I added the
>>> following commmand to my xhtlm site:
>>> 
>>> When I press this button an Exception is thrown because the
>>> PatientNavigatorBean is not serializable. My question is: which managed
>>> beans have to be serializable, when and why?
>>> When I add the Serializable interface to my managed bean everything works
>>> fine but I do want to know why I have to do this and are there possibly
>>> any
>>> fields in my bean which might be transient?
>>>
>>> => I already found a forum post but it does not contain the correct
>>> answer
>>> for my question i guess (
>>> http://www.nabble.com/What-requires-implementing-the-Serializable-interface--tf991035.html#a2566919
>>> http://www.nabble.com/What-requires-implementing-the-Serializable-interface--tf991035.html#a2566919
>>> )
>>>
>>> 16:16:37,983 ERROR [JspStateManagerImpl] Exiting serializeView - Could
>>> not
>>> serialize state: at.co.systema.ce.jsf.PatientNavigator
>>> java.io.NotSerializableException: at.co.systema.ce.jsf.PatientNavigator
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
>>> at
>>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
>>> at
>>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
>>> at
>>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
>>> at
>>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
>>> at
>>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
>>> at
>>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
>>> at
>>> java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
>>> at
>>> java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
>>> at
>>> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
>>> at java.util.ArrayList.writeObject(ArrayList.java:569)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:585)
>>> at
>>> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
>>> at
>>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
>>> at
>>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
>>> at
>>> java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
>>> at
>>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
>>> at
>>> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
>>> at java.util.ArrayList.writeObject(ArrayList.java:569)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce

Re: Caching JSF Dropdown Results

2007-05-23 Thread David Delbecq
You need a void setManufacturerList(List l) so saveState can restore the
state.

bansi a écrit :
> Thanks Andrew. As suggested i have placed the snippet right above 
> 
>
>   
>
> It results in following exception
> javax.faces.el.PropertyNotFoundException: /manufacturerForm.xhtml @23,75
> value="#{manufacturerBean.manufacturerList}": Bean:
> com.boeing.nmt.nams.view.bean.ManufacturerBean, property: manufacturerList
> (no write method for property!)
>
> I didnt understood what does it mean by "no write method for property!" . I
> do have getManufacturerList in backing bean
>
> Regards
> Bansi
>
>
>
> Andrew Robinson-5 wrote:
>   
>> How about > />? If you are using a4j:region, you will need to make sure the save
>> state tag in in the region (BTW - I haven't tested this).
>>
>> On 5/23/07, bansi <[EMAIL PROTECTED]> wrote:
>> 
>>> I have  following dropdown
>>>
>>> Code:
>>>
>>> 
>>>   
>>>
>>>   >> value="#{manufacturerBean.selectedManufacturer}" >
>>> 
>>>
>>>   >> />
>>>   >> action="#{manufacturerBean.loadManufacturerDetails}" event="onchange"
>>> reRender="manufName,manufDescription,manufSource,btnSave,btnDelete" />
>>>
>>> 
>>>
>>>
>>> The perfomance issue is Whenever i pick a  value from the dropdown it
>>> results in 3 datbase calls
>>> Here is the sequence of method calls
>>> - First time the method in f:selectItems gets called which results in a
>>> database call
>>> 
>>> - Second time as expected/desired Ajax4JSF onchange event action method
>>> gets
>>> called
>>> >> event="onchange"
>>> reRender="manufName,manufDescription,manufSource,btnSave,btnDelete" />
>>> - Third time again the method in f:selectItems gets called which results
>>> in
>>> a database call
>>> 
>>>
>>> I understand its due to JSF Lifcycle.
>>>
>>>
>>> Any pointers/suggestion on how to Cache the method getManufacturerList()
>>> to
>>> avoid unnecessary database calls will be highly appreciated
>>>
>>> Regards
>>> Bansi
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Caching-JSF-Dropdown-Results-tf3805830.html#a10770409
>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>
>>>
>>>   
>> 
>
>   



Re: Started using Myfaces 1.1.5 and every page is broken (duplicate ID in the faces tree Component)

2007-05-25 Thread David Delbecq
According to the error message you posted, not, all your components have
defined ids:

faces tree. Component : idListForm:idPopupDataTable:_id81, path:

_id81 is an automatically generated id, use when no specific id was
provided. Also, as asked, please provide the xhtml code, it's nearly
impossible to continue to help you without it. And, check your use of
c:forEach tag, it's content gets duplicated for each iteration in the
component tree.


En l'instant précis du 24/05/07 18:24, SiSi'mon s'exprimait en ces termes:
> all includes and all components have an ID where it is permissable.  The
> thing is that there was no problem with 1.1.4 but there is with 1.1.5 and
> everyone seems to be having a problem with it so I see a lot of people
> rolling back because 1.1.5 is utterly useless.
>
> thanks
>
>
>
>
>
> Andrew Robinson-5 wrote:
>   
>> Could you post some of the XHTML code? Also the full error from the
>> duplicate component ID may be helpful. That component path should
>> directly indicate which component is getting the error (it is in a
>> dataTable, and doesn't have an ID assigned to it).
>>
>> Also if you are using facelets includes, you have to make sure that
>> IDs are unique for the entire component tree, not just the include. So
>> if you have:
>>
>> 
>> 
>>
>> the component IDs in a and b have to be unique.
>>
>> Since you are having an issue with an auto-generated ID in a data
>> table, I'm inclined to think it is a component binding issue though.
>>
>> On 5/23/07, SiSi'mon <[EMAIL PROTECTED]> wrote:
>> 
>>> Thanks, I am not quite sure I understand everything in the article.  We
>>> have
>>> ID's on every component in the xhtml.
>>>
>>> Not sure how to implement the suggestion for not using session scoped
>>> beans.
>>>
>>>
>>> Si'mon
>>>
>>>
>>> David Delbecq-2 wrote:
>>>   
>>>> Since you seem to be using facelets:
>>>>
>>>>
>>>> 
>>> http://wiki.java.net/bin/view/Projects/FaceletsFAQ#I_m_getting_Duplicate_ID_Errors
>>>   
>>>> SiSi'mon a écrit :
>>>> 
>>>>> We are getting errors on nearly every page now that we are using
>>>>>   
>>> MyFaces
>>>   
>>>>> 1.1.5.  All seem to point to a duplicate ID problem but checking the
>>>>> xHTML
>>>>> there is no duplicate ID.  This seems to be generated or something.
>>>>>
>>>>> Something seems quite mucked up.  any ideas?
>>>>>
>>>>> ---
>>>>>
>>>>> SEVERE: Error Rendering View[/web/Information.xhtml]
>>>>> java.lang.IllegalStateException: Client-id : _id81 is duplicated in
>>>>>   
>>> the
>>>   
>>>>> faces tree. Component : idListForm:idPopupDataTable:_id81, path:
>>>>> {Component-Path : [C
>>>>>
>>>>> ---
>>>>>
>>>>>   
>>>> 
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Started-using-Myfaces-1.1.5-and-every-page-is-broken-%28duplicate-ID-in-the-faces-tree-Component%29-tf3805053.html#a10771395
>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>
>>>
>>>   
>> 
>
>   



Re: Don't understand getValue code of UISelectItems

2007-05-25 Thread David Delbecq
Hi Mario,

En l'instant précis du 25/05/07 09:36, [EMAIL PROTECTED]
s'exprimait en ces termes:
>
> Hi, i’m looking the method getValue() of UISelectItems:
>
>  
>
> public Object getValue()
>
> {
>
> if (_value != null) return _value;
>
> ValueBinding vb = getValueBinding("value");
>
> return vb != null ? vb.getValue(getFacesContext()) : null;
>
> }
>
>  
>
> And I see that if a value property of the SelectItemsTag is setted
> with a ValueBinding format, then every time I get getValue() the value
> is rebuilded.
>
Correct
>
> This could be a problem for example in the case I have a property
> value of my managed bead used for value binding that access to DB to
> return the result, because in the life cycle of a page, this
> getValue() is called more than one time. My question  is:
>
> Why the getValueBinding("value") result is not cached? For example:
>
>  
>
>  
>
> private Object _vb=null;
>
> private boolean  vbCalculated=false;
>
>  
>
> public Object getValue()
>
> {
>
> if (_value != null) return _value;
>
> if(!vbCalculated) {
>
>  ValueBinding moment = getValueBinding("value");
>
>  _vb= moment.getValue(getFacesContext());
>
>  vbCalculated=true;
>
> }
>
> return _vb;
>
> }
>
>  
>
>  
>
> Ciao
>
> Mario
>
Let's assume it does it and does not break JSF specification (am sure it
would). Because there is no method specified in JSF api, which myface
must respect, to 'invalidate calculated valuebinding', how can your
application tell all select items of the form that the list of values
changed between the validation and the render phase?
You demonstrated how easy it is to cache a value result, then just do it
in your backing bean and you performance problem is solved. There is no
reason to do that in the jsf itself. JSF does what is told to it, use a
"dynamic" value :)
>
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise private information. If you have
> received it in error, please notify the sender immediately and delete
> the original. Any other use of the email by you is prohibited.
>
Useless disclaimer when posting to mailing list ^-^

Regards,
David



Re: Don't understand getValue code of UISelectItems

2007-05-25 Thread David Delbecq
I don't think so, the values in your db can change whenever you want,
that's why the value is evaluated at each request of 'getValue'. But
your proposed change to UISelectItem would break it :)

En l'instant précis du 25/05/07 10:50, [EMAIL PROTECTED]
s'exprimait en ces termes:
> Sorry, change should with could...
>
> Could be a problem if the list of values changed between encodeBegin and 
> encodeEnd phase?
>
> Mario 
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: 25 maggio 2007 10.35
> To: users@myfaces.apache.org
> Subject: RE: Don't understand getValue code of UISelectItems
>
> Should be a problem if the list of values changed between encodeBegin and 
> encodeEnd phase? 
>
> Mario
>
> -Original Message-
> From: David Delbecq [mailto:[EMAIL PROTECTED] 
> Sent: 25 maggio 2007 10.24
> To: MyFaces Discussion
> Subject: Re: Don't understand getValue code of UISelectItems
>
> Hi Mario,
>
> En l'instant précis du 25/05/07 09:36, [EMAIL PROTECTED]
> s'exprimait en ces termes:
>   
>> Hi, i'm looking the method getValue() of UISelectItems:
>>
>>  
>>
>> public Object getValue()
>>
>> {
>>
>> if (_value != null) return _value;
>>
>> ValueBinding vb = getValueBinding("value");
>>
>> return vb != null ? vb.getValue(getFacesContext()) : null;
>>
>> }
>>
>>  
>>
>> And I see that if a value property of the SelectItemsTag is setted
>> with a ValueBinding format, then every time I get getValue() the value
>> is rebuilded.
>>
>> 
> Correct
>   
>> This could be a problem for example in the case I have a property
>> value of my managed bead used for value binding that access to DB to
>> return the result, because in the life cycle of a page, this
>> getValue() is called more than one time. My question  is:
>>
>> Why the getValueBinding("value") result is not cached? For example:
>>
>>  
>>
>>  
>>
>> private Object _vb=null;
>>
>> private boolean  vbCalculated=false;
>>
>>  
>>
>> public Object getValue()
>>
>> {
>>
>> if (_value != null) return _value;
>>
>> if(!vbCalculated) {
>>
>>  ValueBinding moment = getValueBinding("value");
>>
>>  _vb= moment.getValue(getFacesContext());
>>
>>  vbCalculated=true;
>>
>> }
>>
>> return _vb;
>>
>> }
>>
>>  
>>
>>  
>>
>> Ciao
>>
>> Mario
>>
>> 
> Let's assume it does it and does not break JSF specification (am sure it
> would). Because there is no method specified in JSF api, which myface
> must respect, to 'invalidate calculated valuebinding', how can your
> application tell all select items of the form that the list of values
> changed between the validation and the render phase?
> You demonstrated how easy it is to cache a value result, then just do it
> in your backing bean and you performance problem is solved. There is no
> reason to do that in the jsf itself. JSF does what is told to it, use a
> "dynamic" value :)
>   
>> This message is for the designated recipient only and may contain
>> privileged, proprietary, or otherwise private information. If you have
>> received it in error, please notify the sender immediately and delete
>> the original. Any other use of the email by you is prohibited.
>>
>> 
> Useless disclaimer when posting to mailing list ^-^
>
> Regards,
> David
>
>
>
> This message is for the designated recipient only and may contain privileged, 
> proprietary, or otherwise private information.  If you have received it in 
> error, please notify the sender immediately and delete the original.  Any 
> other use of the email by you is prohibited.
>
>
> This message is for the designated recipient only and may contain privileged, 
> proprietary, or otherwise private information.  If you have received it in 
> error, please notify the sender immediately and delete the original.  Any 
> other use of the email by you is prohibited.
>   



Re: Find current component

2007-05-27 Thread David Delbecq
Pich a écrit :
>> The renderer has access to the component and thus the attributes of that
>> 
> component.
>
> This is what I want to do. How do I have accecss to the component and its
> attribute in the code of the rendered method? And remember that I do not use
> one component binding for each component. I have a Map that I
> have all components in. How do I know which one, perhaps out of 10
> components, is calling the rendered attribute?
>
> Best regards
>
> Pichdude
>   
Hi,

i think you have a big design issue. You are mixing the value binding of
the rendered attribute (which is a method use to know if a component
need to be rendered depending on "the state of a given bean"), whith
what andrew told you which is related on the "renderer" (the renderer
has access to current component because it's passed as a parameter).

I think, in you case, as you already have component bindings in a map,
just create another Map for the rendered attribute. JSF by itself do not
write somewhere the "current component". However, as andrew suggested,
the datatable store the current index and current value in a request
scoped bean so that inner component can use it, maybe you can create
your own component bases on this code.

However, as said, rendered attribute should be linked to a bean status,
not the current component, otherwise that would mean you would mix view
logic and buisness logic...


t:panelTabbedPane and data validation

2007-05-29 Thread David Delbecq
Hello,

i have a form with the following structure:

form
 + inputText
 + panelTabbedPane
   + panelTab
 + input (required="true")
   + panelTab
 + input (required="true")
 + commandButton
 + messages

If i am in second tab and i click the submit button, the fields in first
tab are not validated (there is nothing in h:messages). However, if i go
back to first tab and click the submit button, then i get the validation
error message. Is there a way to have all fields of panelTabbedPane
validated (instead of only current panel) and have panelTabbedPane show
the first panel with an error?


Re: Why do managed beans must implement the Serializable interface

2007-05-29 Thread David Delbecq
That's strange, could you tell us where the serialization comes from?
Are you using clientside state saving mecanism? You managed properties
looks good to me, and if serialization occurs under the control of JSF,
the unserialized B and the unserialized A.b should be the same (same
value *and* same instance). Please also provide us with full form, it
might be useful to understand what happen.

En l'instant précis du 29/05/07 15:37, Trumml s'exprimait en ces termes:
> Well, I tried to link my beans with the faces-config.xml (see 
> http://www.jsffaq.com/Wiki.jsp?page=HowToAccessOneManagedBeanFromAnotherManagedBean
> http://www.jsffaq.com/Wiki.jsp?page=HowToAccessOneManagedBeanFromAnotherManagedBean
> ). 
> In my case B is a manged property of A.
>
> Now I press a command button, a property of A is changed and additionally
> properties of B are changed (A accesses B via the managed property
> mechanism). But unfortunately the properties of B aren't updated in my view.
> So I added debug logging and found out, that after pressing the command
> button A is serialized (with B as a member variable) and after the
> deserialization the wrong B bean is updated (using
> System.identityhascode(...).
>
> If I use the faces-config.xml to link the beans, isn't it correct that B is
> a member of A (see my sample below)...?!?!?
>
>
> class B implements Serializable {
>   String name;
>   String address;
>   
>   getName() {
> 
> }
>
> class A implements Serializable {
>   String name;
>   B b; 
>   
>   getB() {
> ...
>
> 
>   A
>   at.co.systema.A
>   session
>   
> b
> at.co.systema.B
> #{b}
>   
> 
>
> 
>   b
>   at.co.systema.ce.B
>   session
> 
>
>
>
> David Delbecq wrote:
>   
>> If you don't want serialized bean, make them request scope bean.
>> Session scope bean must be serializable whatever happen.
>>
>> Not sure i understand you last problem, but if you want to link B to A
>> (so A see the B instance managed by JSF) you can do this in
>> faces-config.xml, using managed-properties. That way, if A and B are
>> sessions scope, you are guaranteed they stay together. (This can also
>> work if B is session scope and A request, JSF will setup A at each
>> request)
>>
>> Hope this help.
>>
>> En l'instant précis du 23/05/07 17:39, Trumml s'exprimait en ces termes:
>> 
>>> Thanks for this short reply.
>>> But this serialization is a little bit problematic for me...
>>> I have a site with two different backing beans and a command button. The
>>> command button calls method A.1 from bean A, the site is reloaded (the
>>> method changes some properties of bean A) and all properties of A are
>>> renewed within the jsf site. Additionally A.1 changes some properties of
>>> bean B but those properties are not renewed within the view.
>>> So I tried to use component binding with bean B but this does not work
>>> because I can not use HtmlOutputText with my bean B because it is not
>>> serializable...?
>>>
>>> 
>>> 
>>> 
>>>
>>>
>>>
>>>
>>> Werner Punz-2 wrote:
>>>   
>>>   
>>>> This has to be done due to the jsf inherent state saving and also some
>>>> app server serialize the sessions for clustering.
>>>>
>>>> Werner
>>>>
>>>>
>>>> Trumml schrieb:
>>>> 
>>>> 
>>>>> I use MyFaces (1.1.5) with Tomahawk and Facelet support. I added the
>>>>> following commmand to my xhtlm site:
>>>>> 
>>>>> When I press this button an Exception is thrown because the
>>>>> PatientNavigatorBean is not serializable. My question is: which managed
>>>>> beans have to be serializable, when and why?
>>>>> When I add the Serializable interface to my managed bean everything
>>>>> works
>>>>> fine but I do want to know why I have to do this and are there possibly
>>>>> any
>>>>> fields in my bean which might be transient?
>>>>>
>>>>> => I already found a forum post but it does not contain the correct
>>>>> answer
>>>>> for my question i guess (
>>>>> http://www.nabble.com/What-requires-implementing-the-Serializable-interface--tf991035.html#a2566919
>>>>> http://www.nabble.com/What-requires-implementing-the-Serializable-interface--tf991035.html#a256

Re: Will myFaces 1.0_9 work with JSF 1.2?

2007-05-30 Thread David Delbecq
Current myfaces releases is not JSF 1.2. Your only solution then to
"upgrade to JSF 1.2" is to replace your current use of myfaces
implementation with the sun RI. You are not supposed to use 2 different
implementations of the JSF specifications at same time (they contains
the same classes, you will get not funny classloader related issues if
you have both at same time).
Robert Lin a écrit :
>
> Hi,
>
>  
>
> I’m planning to upgrade to JSF 1.2, but I still have myFaces 1.0 and
> would like to wait until myFaces 1.2 is officially released to upgrade
> myFaces.  I was wondering if this kind of setup will work, will there
> be any potential problems?
>
>  
>
> Thanks.
>
>  
>
> **__**
>
>  
>
> **Robert I. Lin **
>
> Software Engineer | NextLabs, Inc. (formerly Blue Jungle, Inc.) | San
> Mateo, CA
>
> (650) 577-9101 Ext. 225
>
> http://www.nextlabs.com
>
> http://www.linkedin.com/in/robertlin
>
>  
>



Re: inputFileUpload save state problem

2007-06-05 Thread David Delbecq
Hi,

For security reason, in HTML (not related to JSF), it's impossible to
set an initial value for an upload field.

En l'instant précis du 05/06/07 10:55, ncheltsov s'exprimait en ces termes:
> Hi,
>
> I have the following question about one of myFaces custom components.
> inputFileUpload
>
> I managed to do everything except one thing. I don't know how to save
> the state of the input field where the path to a specified file
> is entered. When I reload the page, I am developing, the state is lost.
>
> Do you know if such feature is supported or will it be implemented at
> some time?



Re: Myfaces - application calling by link which include parameter

2007-06-08 Thread David Delbecq
Easy way to do it without much complicate front-end code is to use a
bean setter to do the initialization job (assuming all you need is the
common data initialization case):

request:
http://server/webapp/something.faces?xyz=abc

faces-config.xml:

..

somebean

com.company.Bean

request

initialRequest
#{params.xyz}

  ..

JSF will automatically evaluate #{params.xyz} upon bean instantiation.

MPF a écrit :
> Hi!
> How can I realize that?
> My application get called with a link that contains a parameter whom i need
> to load data. Need to write a frontcontroller?how?
>
> someone can help?
>
> best regards
>   


Re: why tab pane submits/validates all tabs

2007-06-10 Thread David Delbecq
Well, from my point of view, a tabbedpane is used to split a form in
several panes, not to present several different forms (for that you can
use easily different views) and of course if you submit/validate
surrounding, *all* tabs must be validated (which is not currently the
case, see http://issues.apache.org/jira/browse/TOMAHAWK-1012)


En l'instant précis du 06/06/07 11:33, Jesse Alexander (KSFD 121)
s'exprimait en ces termes:
> I wonder whether it would be possible to define a form "inside" each tab
> to
> force a "partial" submit.
> It just raises the question, whether the tabbed pane automatically adds
> a 
> form around the complete tab-widget, or just on the clickable tabs,...
>
> >From the usability I would argument, that the click on the tab
> automatically should throw away the form-content on the tab, because it
> is not a form-related button (which should be below the input-fields).
> And
> ALL links (which includes the tabs outside the input-form) should be
> considered as
> form-unfriendly navigation => not submitting the form... This would also
> make it 
> possible to get rid of the Javascript on each link (no need to submit a
> form).
>
> regards
> Alexander 
>
> -Original Message-
> From: Alexander Wallace [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, June 05, 2007 11:08 PM
> To: MyFaces Discussion
> Subject: Re: why tab pane submits/validates all tabs
>
> Ok... i guess that's then the expected behavior, just not what I  
> expected...
>
> thanks!
>
> On Jun 5, 2007, at 3:37 PM, Jesse Alexander ((KSFD 121)) wrote:
>
>   
>> well the tabbedPane always renders all components but just displays
>> only one tab. As it uses links it needs the form around the whole and
>> submits it in one piece...
>>
>> hth
>> Alexander
>>
>> -Original Message-
>> From: Alexander Wallace [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, June 05, 2007 10:26 PM
>> To: MyFaces Discussion
>> Subject: Re: why tab pane submits/validates all tabs
>>
>> I guess you meant server side tab switch... i tried that, but when I
>> use it, the action or action listener methods are never visited when
>> buttons are clicked... it is very messed up...
>>
>> thanks!
>>
>> On Jun 5, 2007, at 1:01 PM, Alexander Wallace wrote:
>>
>> 
>>> I'm using server side... But still get the undesired result...
>>>
>>> Any clues?
>>>
>>> On Jun 5, 2007, at 12:35 PM, Mike Kienenberger wrote:
>>>
>>>   
 It's been awhile since I used tabs, but I think if you use server-
 side
 tab switching, only the current tab will be rendered (and submitted
 and validated).

 If you use client-side tab switching, all tabs are rendered (but
 hidden with javascript) and all tabs are submitted.

 On 6/5/07, Alexander Wallace <[EMAIL PROTECTED]> wrote:
 
> I have a MyFaces portlet with 5 or so tabs, each with its own  
> set of
> independent (i would hope) fields and submit buttons... However,  
> all
> elements in all tabs are submitted and validated when either of  
> tabs
> has a submit button clicked...
>
> Is this really how it is supposed to be? I'm using MyFaces 114
>
> Thanks!
>
>
>   
>>>   
>> 
>
>   



Re: Myfaces - application calling by link which include parameter

2007-06-11 Thread David Delbecq
Note: be careful with using this method + session bean, as it will work
only once per session, that is the first time bean named qbk will be
used in user session. It may be intended behaviour, but most people need
a to take into account different value for each request.

En l'instant précis du 11/06/07 09:33, MPF s'exprimait en ces termes:
> Well now it works with:
> #{param.dbk} 
>
> thanks to all and best regards
>
>
>
> MPF wrote:
>   
>> Hi!
>> Well I tried this (but its sound like easy and thats all I need), but the
>> parameter value is always null!
>>
>> try to call with following url:
>> http://localhost:8080/GatheringPlace/jsp/placeDetail.jsf?dbk=1212
>>
>> my code:
>>
>> bean:
>> public class PlaceDetailController {
>>
>>  private String dbk;
>>
>>  public PlaceDetailController() {
>>  // nothing to do
>>  }   
>>  
>>  public String getDbk() {
>>  return this.dbk;
>>  }
>>
>>  public void setDbk(final String dbk) {
>>  this.dbk = dbk;
>>  }
>> }
>>
>> faces config:
>> ...
>> 
>>  placeDetail
>>
>> at.pcd.wam.technologie.controller.PlaceDetailController
>>  session
>>  
>>  dbk
>>  #{params.dbk}
>>  
>> 
>> ...
>>
>>
>>
>> David Delbecq-2 wrote:
>> 
>>> Easy way to do it without much complicate front-end code is to use a
>>> bean setter to do the initialization job (assuming all you need is the
>>> common data initialization case):
>>>
>>> request:
>>> http://server/webapp/something.faces?xyz=abc
>>>
>>> faces-config.xml:
>>> 
>>> ..
>>> 
>>> somebean
>>> 
>>> com.company.Bean
>>> 
>>> request
>>> 
>>> initialRequest
>>> #{params.xyz}
>>> 
>>>   ..
>>>
>>> JSF will automatically evaluate #{params.xyz} upon bean instantiation.
>>>
>>> MPF a écrit :
>>>   
>>>> Hi!
>>>> How can I realize that?
>>>> My application get called with a link that contains a parameter whom i
>>>> need
>>>> to load data. Need to write a frontcontroller?how?
>>>>
>>>> someone can help?
>>>>
>>>> best regards
>>>>   
>>>> 
>>>   
>> 
>
>   



Re: Myfaces - application calling by link which include parameter

2007-06-11 Thread David Delbecq
Note: be careful with using this method + session bean, as it will work
only once per session, that is the first time bean named qbk will be
used in user session. It may be intended behaviour, but most people need
a to take into account different value for each request.

En l'instant précis du 11/06/07 09:33, MPF s'exprimait en ces termes:
> Well now it works with:
> #{param.dbk} 
>
> thanks to all and best regards
>
>
>
> MPF wrote:
>   
>> Hi!
>> Well I tried this (but its sound like easy and thats all I need), but the
>> parameter value is always null!
>>
>> try to call with following url:
>> http://localhost:8080/GatheringPlace/jsp/placeDetail.jsf?dbk=1212
>>
>> my code:
>>
>> bean:
>> public class PlaceDetailController {
>>
>>  private String dbk;
>>
>>  public PlaceDetailController() {
>>  // nothing to do
>>  }   
>>  
>>  public String getDbk() {
>>  return this.dbk;
>>  }
>>
>>  public void setDbk(final String dbk) {
>>  this.dbk = dbk;
>>  }
>> }
>>
>> faces config:
>> ...
>> 
>>  placeDetail
>>
>> at.pcd.wam.technologie.controller.PlaceDetailController
>>  session
>>  
>>  dbk
>>  #{params.dbk}
>>  
>> 
>> ...
>>
>>
>>
>> David Delbecq-2 wrote:
>> 
>>> Easy way to do it without much complicate front-end code is to use a
>>> bean setter to do the initialization job (assuming all you need is the
>>> common data initialization case):
>>>
>>> request:
>>> http://server/webapp/something.faces?xyz=abc
>>>
>>> faces-config.xml:
>>> 
>>> ..
>>> 
>>> somebean
>>> 
>>> com.company.Bean
>>> 
>>> request
>>> 
>>> initialRequest
>>> #{params.xyz}
>>> 
>>>   ..
>>>
>>> JSF will automatically evaluate #{params.xyz} upon bean instantiation.
>>>
>>> MPF a écrit :
>>>   
>>>> Hi!
>>>> How can I realize that?
>>>> My application get called with a link that contains a parameter whom i
>>>> need
>>>> to load data. Need to write a frontcontroller?how?
>>>>
>>>> someone can help?
>>>>
>>>> best regards
>>>>   
>>>> 
>>>   
>> 
>
>   



Re: Myfaces - application calling by link which include parameter

2007-06-12 Thread David Delbecq
It shouldn't be big work to create a request bean that does the job of
setting session bean. The same way you set a property of request bean
from #{param.xxx} you can link the request bean to session bean by
setting a managed property in session bean to an EL pointing to session
bean (eg #{someSessionBean}). The most important part is
to ensure the request bean is used upon request by the view. This could
be done by calling a value of request bean.

En l'instant précis du 11/06/07 14:07, MPF s'exprimait en ces termes:
> Hmm ur right ;( 
> argh..bad bad - but the other things (Filter) didnt worked (i dunno why)..
>
>
> David Delbecq-2 wrote:
>   
>> Note: be careful with using this method + session bean, as it will work
>> only once per session, that is the first time bean named qbk will be
>> used in user session. It may be intended behaviour, but most people need
>> a to take into account different value for each request.
>>
>> En l'instant précis du 11/06/07 09:33, MPF s'exprimait en ces termes:
>> 
>>> Well now it works with:
>>> #{param.dbk} 
>>>
>>> thanks to all and best regards
>>>
>>>
>>>
>>> MPF wrote:
>>>   
>>>   
>>>> Hi!
>>>> Well I tried this (but its sound like easy and thats all I need), but
>>>> the
>>>> parameter value is always null!
>>>>
>>>> try to call with following url:
>>>> http://localhost:8080/GatheringPlace/jsp/placeDetail.jsf?dbk=1212
>>>>
>>>> my code:
>>>>
>>>> bean:
>>>> public class PlaceDetailController {
>>>>
>>>>private String dbk;
>>>>
>>>>public PlaceDetailController() {
>>>>// nothing to do
>>>>}   
>>>>
>>>>public String getDbk() {
>>>>    return this.dbk;
>>>>}
>>>>
>>>>public void setDbk(final String dbk) {
>>>>this.dbk = dbk;
>>>>}
>>>> }
>>>>
>>>> faces config:
>>>> ...
>>>> 
>>>>  placeDetail
>>>>
>>>> at.pcd.wam.technologie.controller.PlaceDetailController
>>>>session
>>>>
>>>>dbk
>>>>#{params.dbk}
>>>>
>>>> 
>>>> ...
>>>>
>>>>
>>>>
>>>> David Delbecq-2 wrote:
>>>> 
>>>> 
>>>>> Easy way to do it without much complicate front-end code is to use a
>>>>> bean setter to do the initialization job (assuming all you need is the
>>>>> common data initialization case):
>>>>>
>>>>> request:
>>>>> http://server/webapp/something.faces?xyz=abc
>>>>>
>>>>> faces-config.xml:
>>>>> 
>>>>> ..
>>>>> 
>>>>> somebean
>>>>> 
>>>>> com.company.Bean
>>>>> 
>>>>> request
>>>>> 
>>>>> initialRequest
>>>>> #{params.xyz}
>>>>> 
>>>>>   ..
>>>>>
>>>>> JSF will automatically evaluate #{params.xyz} upon bean instantiation.
>>>>>
>>>>> MPF a écrit :
>>>>>   
>>>>>   
>>>>>> Hi!
>>>>>> How can I realize that?
>>>>>> My application get called with a link that contains a parameter whom i
>>>>>> need
>>>>>> to load data. Need to write a frontcontroller?how?
>>>>>>
>>>>>> someone can help?
>>>>>>
>>>>>> best regards
>>>>>>   
>>>>>> 
>>>>>> 
>>>>>   
>>>>>   
>>>> 
>>>> 
>>>   
>>>   
>>
>> 
>
>   



SelectOneMenu and null value

2007-06-14 Thread David Delbecq
Hello,

I have a design where, in the select list of SelectOneMenu, i need to
set a blank entry for null value.

For now, i set it up like this

1) the list of available options contain an entry with label="" and
value="[nothing]"
2) A converter is set to this list (based on value class). From
"[nothing]", getAsObject returns null. From a null or an empty String,
getAsString returns "[nothing]". Since SelectOneMenu uses the String to
compare the list items to currentValue, this shouldn't pose problem. I
have seen this solution proposed at several places on the web.

This works nearly perfectly.

1) I can select the blank entry (even if baking bean already has a non
null value), it success validation of component and copy null value to
'localeValue' of UIComponent, that will then be put in backingbean.
2) I can select the blank entry and call an immediate action, the
submitted value is kept and, upon form, redisplay it correctly mark the
blank one as 'selected'

But it fails in this conditions
1) There is already a value in backing bean for this selectOneMenu and i
didn't yet change it  in form (so localValue is not yet set!)
2) There are other component in form
Now if during the same submit i choose the blank value and set a value
in another component that will fail validation, after the validation
error, the selected item is rolled back to previous one.

Note, this error does not happen if i first change the entry to another
one, call an immediate action (now localValue is set and is something
else than null) and then reprocess to the failing operation.

Anybody have any idea why, from time to time, the value change is
ignored (not anymore in submitted, not in localValue)? This is very
annoying as it looks to user like random partial form reset during
validation, reset which happen in fields not marked has having
validation errors.

Regards,
David Delbecq


Re: SelectOneMenu and null value

2007-06-14 Thread David Delbecq
Self responding as i have not friends, you know how it is, too much job,
too much geeky, no friend to send you postcard or birthday cards


Just to tell list and potential future seekers, it seems this problem
was fixed in svn, upgrading from 1.1.5 to 1.1.6-SNAPSHOT fixes the issue.

En l'instant précis du 14/06/07 15:12, David Delbecq s'exprimait en ces
termes:
> Hello,
>
> I have a design where, in the select list of SelectOneMenu, i need to
> set a blank entry for null value.
>
> For now, i set it up like this
>
> 1) the list of available options contain an entry with label="" and
> value="[nothing]"
> 2) A converter is set to this list (based on value class). From
> "[nothing]", getAsObject returns null. From a null or an empty String,
> getAsString returns "[nothing]". Since SelectOneMenu uses the String to
> compare the list items to currentValue, this shouldn't pose problem. I
> have seen this solution proposed at several places on the web.
>
> This works nearly perfectly.
>
> 1) I can select the blank entry (even if baking bean already has a non
> null value), it success validation of component and copy null value to
> 'localeValue' of UIComponent, that will then be put in backingbean.
> 2) I can select the blank entry and call an immediate action, the
> submitted value is kept and, upon form, redisplay it correctly mark the
> blank one as 'selected'
>
> But it fails in this conditions
> 1) There is already a value in backing bean for this selectOneMenu and i
> didn't yet change it  in form (so localValue is not yet set!)
> 2) There are other component in form
> Now if during the same submit i choose the blank value and set a value
> in another component that will fail validation, after the validation
> error, the selected item is rolled back to previous one.
>
> Note, this error does not happen if i first change the entry to another
> one, call an immediate action (now localValue is set and is something
> else than null) and then reprocess to the failing operation.
>
> Anybody have any idea why, from time to time, the value change is
> ignored (not anymore in submitted, not in localValue)? This is very
> annoying as it looks to user like random partial form reset during
> validation, reset which happen in fields not marked has having
> validation errors.
>
> Regards,
> David Delbecq
>   



Re: Validation error with selectitems in latest Myfaces/Tomahawk

2007-06-27 Thread David Delbecq
does testBean.getStatusId() return a String or a Long? If you don't
specify manually a converter, then JSF will try to find a suitable
converter based on the type of the selectonemenu value (not the select
item value!).

To check submitted value validity, as far as i know, myfaces will
compare the selectItem itemValue converte as String with the submitted
string value. Maybe, without converter, value inside your html form
looks like ...?

En l'instant précis du 27/06/07 12:14, Safurudin Mahic s'exprimait en
ces termes:
> Ok - I tried to implement the solution -
>
> value="#{testBean.statusid}">
> itemLabel="Ikke paabegynt" />
> itemLabel="Under arbeid" />
> itemLabel="Kansellert" />
> itemLabel="Utfort" />
>
>
>
> however, I still got the validation error when I didn't use the
> explicit f:convertNumber.
> I'm guessing the #{0} etc are integer valueexpressions, hence
> returning the correct type to the value of
> the selectonemenu. Wouldn't the expected behavior be that it works
> without the explicit converter?
>
> -safi
>
>
> Cagatay Civici skrev:
>> Hi,
>>
>> Sounds like;
>>
>> http://wiki.apache.org/myfaces/Tomahawk_1%2e1%2e4_to_1%2e1%2e5
>>
>> Cagatay
>>
>> On 6/27/07, *Safurudin Mahic* <[EMAIL PROTECTED]
>> > wrote:
>>
>> I'm having problems getting a correct form submittal with a simple
>> selectOneMenu in the latest MyFaces and TomaHawk.
>>
>> After issuing the command button, I'm getting "Validation Error
>> "statusid": Value is not a valid option."
>> The statusid is an Integer value on the backing bean.
>> In previous versions (1.1.1) this works fine. Doesn't
>> MyFaces/Tomahawk
>> in later versions autoconvert strings to integers where appropriate?
>>
>> My form looks like this:
>>
>> 
>> > " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
>>
>> http://www.w3.org/1999/xhtml";
>> xmlns:ui=" http://java.sun.com/jsf/facelets";
>> xmlns:h="http://java.sun.com/jsf/html";
>> xmlns:f="http://java.sun.com/jsf/core
>> "
>> xmlns:t="http://myfaces.apache.org/tomahawk";
>>
>> xmlns:acegijsf="http://sourceforge.net/projects/jsf-comp/acegijsf
>> "
>> xml:lang="en" lang="en">
>>
>> 
>> 
>> 
>> > showSummary="true"/>
>> > value="#{testBean.statusid}"
>>
>> styleClass="inputfield_long">
>> > itemLabel="Test1" />
>> > itemLabel="Test2" />
>> > itemLabel="Test3" />
>> > itemLabel="Test4" />
>> 
>>
>>
>> 
>> 
>> 
>> 
>> 
>> 
>>
>>
>>
>>
>>
>>
>>
>>
>>



Re: t:inputCalendar

2007-06-27 Thread David Delbecq
You can define the timezone in a converter. Here, we define a converter
() with a specific format and timeZone for
both inputCalendar et outputText to keep date correct. And by this we
are sure to always work in our current TimeZone on user interface :D

(PS: i think latest svn version of tomahawk added a timezone attribute)

En l'instant précis du 27/06/07 17:26, galletti s'exprimait en ces termes:
> How can you do that?
> It seems like t:inputCalendar does not have a "timezone" attribute.
>
> Any help?
>
>
> Simon Kitching-3 wrote:
>   
>> The default timezone for date controls is UTC aka GMT.
>>
>> Set the timezone attribute of the component to control what timezone is 
>> used.
>>
>>
>> omidh wrote:
>> 
>>> Hi all,
>>>
>>> I have a little problem with tomahawk...
>>> When Insert a t:inputCalendar field everything works fine...
>>> But when I try to save the Date in a Backing Bean in a Date field, also
>>> these works ;),
>>> but by printing out the Date again, I get all the time one day befor the
>>> selected Date printed out...
>>> Is these a bug in tomahawk? or a config failure, here my Tag:
>>>
>>> 
>>> >> id="inputdate_field"
>>> monthYearRowClass="yearMonthHeader" weekRowClass="weekHeader"
>>> popupButtonStyleClass="standard_bold"
>>> 
>>> currentDayCellClass="currentDayCell"
>>> value="#{datatype.value_date}" 
>>> renderAsPopup="true" 
>>> popupTodayString="Today: "
>>> popupDateFormat="MM/dd/" 
>>> popupWeekString="Week: "
>>> helpText="MM/DD/"/>
>>> 
>>>
>>> you cann also what I described on:
>>> http://www.irian.at/myfaces/calendar.jsf
>>> , click on a date in the Calender Form an look whats printed out.
>>>
>>> thanks in advance,
>>> Omid
>>>   
>>
>> 
>
>   



Expression language, testing size of collections

2007-06-28 Thread David Delbecq
Hello,

i'm facing an issue with EL in JSF. I have a collection of items. I want
to render them as a table header followed by content (using tomahawk
datalist). However, i'd like to skip full table rendering if collection
is empty or null. Problem is that collections in java do not follow the
getters mecanism (size instead of getSize). Are there clean suggested
ways to do it, or will i have to create a pseudo map that does the trick
(rendered ="#{pseudoMapBean.size[bean.someCollection] >0}") ?

Thanks for suggestions.



Re: Expression language, testing size of collections

2007-06-28 Thread David Delbecq
Thanks :D

En l'instant précis du 28/06/07 11:28, Christopher Cudennec s'exprimait
en ces termes:
> Hi David,
>
> try this EL-Expression:
>
> rendered="#{not empty yourCollectionName}"
>
> Cheers,
>
> Christopher
>
> David Delbecq schrieb:
>> Hello,
>>
>> i'm facing an issue with EL in JSF. I have a collection of items. I want
>> to render them as a table header followed by content (using tomahawk
>> datalist). However, i'd like to skip full table rendering if collection
>> is empty or null. Problem is that collections in java do not follow the
>> getters mecanism (size instead of getSize). Are there clean suggested
>> ways to do it, or will i have to create a pseudo map that does the trick
>> (rendered ="#{pseudoMapBean.size[bean.someCollection] >0}") ?
>>
>> Thanks for suggestions.
>>
>>
>>   




Re: Expression language, testing size of collections

2007-06-29 Thread David Delbecq
Thanks :D

En l'instant précis du 28/06/07 11:28, Christopher Cudennec s'exprimait
en ces termes:
> Hi David,
>
> try this EL-Expression:
>
> rendered="#{not empty yourCollectionName}"
>
> Cheers,
>
> Christopher
>
> David Delbecq schrieb:
>> Hello,
>>
>> i'm facing an issue with EL in JSF. I have a collection of items. I want
>> to render them as a table header followed by content (using tomahawk
>> datalist). However, i'd like to skip full table rendering if collection
>> is empty or null. Problem is that collections in java do not follow the
>> getters mecanism (size instead of getSize). Are there clean suggested
>> ways to do it, or will i have to create a pseudo map that does the trick
>> (rendered ="#{pseudoMapBean.size[bean.someCollection] >0}") ?
>>
>> Thanks for suggestions.
>>
>>
>>   



Re: Bug in tag??

2007-07-01 Thread David Delbecq
What does this outputs?

  Should have class: 


Marty Bergerud a écrit :
>
> now if I replace the jsf code with...
>  styleClass="#{ras$jsf$interestRate.searchClosedClass}" >
> 123
> 
> >
>


Re: how to render various components dynamically for a generic editor ?

2007-07-03 Thread David Delbecq
Hi,

I had a similar requirement for a form here.
I had an List of object to visually edit. The objects were carrying
their description, value and type. I created, for each type, a wrapper
bean that provided a method UIComponent createEditor(some environment
stuff); I then created a custom component (let's name

> Hi,
>
>  
>
> I have to create a generic editor with various fields based on a
> configuration(file, database …). Each field can be rendered as a
> different input type, e.g. selectOneCheckbox, selectManyCheckbox,
> selectOneRadio, selectOneMenu, selectManyMenu or even inside a tree2
> structure. Moreover I have to add validators and converters to the
> components, e.g. for numeric input, dates etc.
>
>  
>
> I am currently no sure what's the best approach for this and I would
> be happy about some feedback.
>
> I am sure that some of you have to implement these type of
> requirements and therefore I look forward to your recommendations and
> experiences.
>
>  
>
> I see the following alternatives:
>
> a) loop over the fields in the jsp (with a datalist) and define all
> the possible types of components.
>
>Then the rendered attribute could be used to show/hide them based
> on the configuration.
>
>--> seems not very performant
>
>--> no idea how to add converters and validators because they don't
> offer a rendered attribute
>
>   
>
> b) create the UIComponents and the component tree on serverside and
> use component bindings
>
>   --> complicates the maintenance from my point of view. because
> styleclasses, js-eventhandlers etc must be set in java.
>
>  
>
> c) use some kind of dynamic includes ?
>
>   --> ??
>
>  
>
> d) ???
>
>  
>
> Michael
>



Re: MyFaces Browser Compatibility

2007-07-04 Thread David Delbecq
I don't tink there is.
AFAIK, most myfaces core component don't require javascript and use
html4.01 compliant output, and as such would work with most browsers (am
pretty sure it could even work with lynx). Only exception is the
CommandLink, but it's javascript is quite basic and should also be
compatibile with most existing javascript enabled browser.

Concerning tomahakw, it's more tricky, some components don't require
javascript (like fileupload) but some do havily use javascript. For them
you should check the bugtrack for any reported issue:

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


En l'instant précis du 04/07/07 03:17, mark leung s'exprimait en ces
termes:
> Hi there,
> Is there anybody know the browser compatibility of MyFaces(Tomahawk)?
> I can
> not find the documents about this topic in MyFaces homepage and
> google. While there is only the compatibility about server side
> environment.
>
> _
> 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn 



Re: how to access the properties files from java script

2007-07-04 Thread David Delbecq
Simple example working for most general conditions



Other possible simple suggestion:


var myMessage = "<h:outputText value="#{someBundle['ok.confirm']}"/>";


PS: it's common practice on mailing list to no use the 'reply' button on
a message to create a new subject of discussion. It makes the other
discussion more difficult to read for people, and for you it reduces the
probability someone who can answer you sees your question. Instead,
create new message when you are not replying to someone.

Regards,
David Delbecq

En l'instant précis du 04/07/07 07:59, Arvind Pandey s'exprimait en ces
termes:
>  
>
> Hi all,
>  
>   I am using myfaces 1.1.5 .  We are showing java script
> confirmation dialog box  .
> But We need to show the confirmation message in multilingual format.
> Is there any way to read the property file so that we can show the
> message in multilingual?
> Or is there any other soln for this?
> Any help will be appreciated..
>  
> regards
> Arvind pandey
>
>
>  
>
>
>
> Disclaimer: The information contained in this e-mail and attachments
> if any are privileged and confidential and are intended for the
> individual(s) or entity(ies) named in this e-mail. If the reader or
> recipient is not the intended recipient, or employee or agent
> responsible for delivering to the intended recipient, you are hereby
> notified that dissemination, distribution or copying of this
> communication or attachments thereof is strictly prohibited. IF YOU
> RECEIVE this communication in error, please immediately notify the
> sender and return the original message.
>
>



Re: how to prevent hidden autoScroll from affecting page look

2007-07-04 Thread David Delbecq
Hi,

I took a look at data scroller (as am assuming this is the component you
are using)
In source of html generated from example (at
http://www.irian.at/myfaces/dataScroller.jsf) , i see this





etc.

indeed there are line feed around the input type, but it appear before a
, and as such shouldn't generate extra space. Perhaps it's your css
stylesheet that apply margins or padding to  tags?

Check this in your browser,


test



blabla


blabla










If both tables show same width, you should start to investigate css
rules. If not, then i think you need to have component patched to remove
those linefeeds :)





En l'instant précis du 04/07/07 07:29, Dave s'exprimait en ces termes:
> There are many generated:
> 
>  
> that affects the page looks.
>  
> In html, there is a line break around them. So there is an additional
> space on page.
>  
> How to prevent this from happening?
> Thanks
> Dave
>
> 
> Food fight?
> 
> Enjoy some healthy debate
> in the Yahoo! Answers Food & Drink Q&A.
> 




Re: how i can invalide the session at outputlink

2007-07-04 Thread David Delbecq
Use a commandLink then :)

En l'instant précis du 04/07/07 12:50, MPF s'exprimait en ces termes:
> hi,
>
> ya which action ? outputlink hasnt a action/actionListener..?
>
>
> Benjamin Bratkus wrote:
>   
>> hi,
>>
>> yes this is possible, you have to get the session in the action method and
>> to call the session.invalidate within the method.
>>
>> ben
>> 
>>> Hi!
>>>
>>> [code]
>>> 
>>> >> rendered="#{placeDetail.showBackButton}"
>>> value="#{placeDetail.referer}">
>>> >> styleClass="txtgruen"/>
>>> 
>>> 
>>> [/code]
>>>
>>> is it possible to invalide the session at the outputlink?
>>>
>>> best regards
>>> --
>>> View this message in context:
>>> http://www.nabble.com/how-i-can-invalide-the-session-at-outputlink-tf4023628.html#a11428476
>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>
>>>
>>>   
>> Viele Grüße,
>>
>> Benjamin Björn Bratkus
>> --
>> Orientation in Objects GmbH
>> Weinheimerstr. 68
>> D-68309 Mannheim
>> http://www.oio.de
>> Tel. +49(0)621-71839-0
>> Fax +49(0)621-71839-50
>>
>> Amtsgericht Mannheim
>> HRB 38348
>> Geschäftsführer: Dirk M. Sohn
>>
>>
>> 
>
>   



Re: MyFaces Browser Compatibility

2007-07-04 Thread David Delbecq
Agree, There should ba a page on myfaces wiki where users could post
their borwser name/version and mark compatibility informations they noticed.

En l'instant précis du 04/07/07 13:21, mark leung s'exprimait en ces
termes:
>
> Thanks your promptly reply. Yes, agree your point and actually I hv
> same thought as yours.But I think to a well-known product, there
> should be a list to announce the browser compatibility, instead we
> make the supposition base on our limited information. You know,
> sometimes, we need the official stuff as our reference to support our
> decision.
>
>
>> From: David Delbecq <[EMAIL PROTECTED]>
>> Reply-To: "MyFaces Discussion" 
>> To: MyFaces Discussion 
>> Subject: Re: MyFaces Browser Compatibility
>> Date: Wed, 04 Jul 2007 09:32:01 +0200
>>
>> I don't tink there is.
>> AFAIK, most myfaces core component don't require javascript and use
>> html4.01 compliant output, and as such would work with most browsers (am
>> pretty sure it could even work with lynx). Only exception is the
>> CommandLink, but it's javascript is quite basic and should also be
>> compatibile with most existing javascript enabled browser.
>>
>> Concerning tomahakw, it's more tricky, some components don't require
>> javascript (like fileupload) but some do havily use javascript. For them
>> you should check the bugtrack for any reported issue:
>>
>> http://issues.apache.org/jira/browse/TOMAHAWK
>>
>>
>> En l'instant précis du 04/07/07 03:17, mark leung s'exprimait en ces
>> termes:
>> > Hi there,
>> > Is there anybody know the browser compatibility of MyFaces(Tomahawk)?
>> > I can
>> > not find the documents about this topic in MyFaces homepage and
>> > google. While there is only the compatibility about server side
>> > environment.
>> >
>> > _
>> > 与联机的朋友进行交流,请使用 MSN Messenger:
>> http://messenger.msn.com/cn
>>
>
> _
> 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn 



Re: Problem updating a column using datatable

2007-07-04 Thread David Delbecq
Hello,

Check that

readonly="#{!(disability.id == null or
(disabilityDetail.isEditableRow and disability.id ==
disabilityDetail.instanceParamId))}"

is true, not only at render time, but also, after submission of new
value by user, at processValidation phase. If it's false at render time,
html edit box will be readonly. If it's false at processValidation time,
even if it was true at previous render, the submitted value will be
ignored by component.

regards,
David Delbecq
En l'instant précis du 04/07/07 15:44, mapoitras s'exprimait en ces termes:
> I have a table that displays all rows as readonly.  If the user clicks on the
> edit button on the side, then that column is no longer readonly and they can
> update the value.  However when the instance gets back to the backing bean
> the data for columns that were originaly readonly has not been updated.  Any
> idea?  In the example below, only one column is read only at first.  When
> they click on edit, I update the column but the new data never gets back to
> the backing bean.  If I remove the readonly clause it works, however all the
> rows are now editable.  We can only permit one row to be edited at a time
> because of special validations that need to be done.
>
>   
> 
>   #{msgs.ddListOfDisabilitiesLbl} 
>  
> action="#{disabilityDetail.addRowAction()}" 
>   
> value="#{msgs.ddAddNewDisabilityTypeBtn}" 
>   
> disabled="#{disabilityDetail.isSaveBtnDisabled}" />
>   
>  styleClass="view" headerClass="viewHeader"
>   rowClasses="viewRows" 
>   
> columnClasses="viewColDisabilityCrud,viewColDisabilityCrud,viewColDisabilityType,viewColDisabilityOccCnt">
>   
>rendered="#{!disabilityDetail.isSaveBtnDisabled}">
> 
>action="#{disabilityDetail.removeRowAction()}" 
>   
> rendered="#{!disabilityDetail.isCreatableRow and
> !disabilityDetail.isEditableRow }">
>alt="Remove"
> url="../images/delete.gif"
>   
> onclick="if (!#{disabilityDetail.authorizationMap['12']})
> {alert('#{msgs.authNotAuthorized}'); return false;}" />   
> 
>value="#{disability.id}"/>
>   
>   
>  
>
>   
>rendered="#{disabilityDetail.isCreatableRow or
> disabilityDetail.isEditableRow}"/>
> 
>action="#{disabilityDetail.editRowAction}" 
> rendered="#{!disabilityDetail.isCreatableRow and
> !disabilityDetail.isEditableRow}">
>alt="Edit"
> url="../images/editable.gif"
>   
> onclick="if (!#{disabilityDetail.authorizationMap['12']})
> {alert('#{msgs.authNotAuthorized}'); return false;}" /> 
>value="#{disability.id}"/>  
>   
>  
>
>   
> 
>name="header">#{msgs.ddTypeOfDisabilityTtlLbl}
>value="#{disability.disabilityTypeCode}"
> converter="#{disabilityDetail.disabilityTypeCodePickList.converter}" >
>value="#{disabilityDetail.disabilityTypeCodePickList.pickListMap}"
> />
>   
>   
>name="header">#{msgs.ddNoOfOccupantsWithDisabilityTtlLbl}
>value="#{disability.occupantsCount}" class="rightalign" size="5"
> maxlength="5" readonly="#{!(disability.id == null or
> (disabilityDetail.isEditableRow and disability.id ==
> disabilityDetail.instanceParamId))}">
>   
>styleClass="ahMessages"/>  
>
>  
> 
>
>
>   



Re: Render attribute

2007-07-06 Thread David Delbecq
Hi,

upon submit, during validation phase (the phase that transmit from
component internal state to backing bean) the 'rendered' attribute of
panelGrid is evaluated. If at that time it's 'rendered' attribute is
false, none of it's child participate in the validation phase. The value
of rendered must be true at validation phase for it's submitted value to
be transmitted from inputtext to backingbean.
The same rule applies to the "apply request value" phase, where browser
submitted value are transfered from http request to component internal
state.

En l'instant précis du 06/07/07 10:55, Angel Miralles Arevalo
s'exprimait en ces termes:
> Hi everybody, I have the following code:
>  
> 
> 
> 
>  
> I can't send "property" by request. Alway is null because of the
> panelGrid rendered attribute. Anybody can explain me why is this
> happening and how can I solve this?
>  
> I'm using this scenario in order to show/hide a list's detail.
>  
> Thank you very much. 
>
> 
>
> Sé un Mejor Amante del Cine
> ¿Quieres saber cómo? ¡Deja que otras personas te ayuden!
> .



Re: Render attribute

2007-07-06 Thread David Delbecq
If your #{bean} is request scoped, that can indeed be a problem (value
reset to false at begin of request). Try to set

This will normally validate and transfert the value of field to backing
bean during it's apply request value phase.
Ensure inputHidden is before panelGrid in view so that, during the grid
apply request value phase, value is correctly set.

Or store datas about hidden / visible state of panels in a session
scoped bean.
En l'instant précis du 06/07/07 11:36, Angel Miralles Arevalo
s'exprimait en ces termes:
> And how can I set "rendered" attribute true at these phases
> (validation and apply request)?
>  
> I have a  outside
> panelGrid. I think it solve the second question (apply request phase). 
>  
> Thank you for your answer.
>
> - Mensaje original 
> De: David Delbecq <[EMAIL PROTECTED]>
> Para: MyFaces Discussion 
> Enviado: viernes, 6 de julio, 2007 11:17:30
> Asunto: Re: Render attribute
>
> Hi,
>
> upon submit, during validation phase (the phase that transmit from
> component internal state to backing bean) the 'rendered' attribute of
> panelGrid is evaluated. If at that time it's 'rendered' attribute is
> false, none of it's child participate in the validation phase. The value
> of rendered must be true at validation phase for it's submitted value to
> be transmitted from inputtext to backingbean.
> The same rule applies to the "apply request value" phase, where browser
> submitted value are transfered from http request to component internal
> state.
>
> En l'instant précis du 06/07/07 10:55, Angel Miralles Arevalo
> s'exprimait en ces termes:
> > Hi everybody, I have the following code:
> >  
> > 
> > 
> > 
> >  
> > I can't send "property" by request. Alway is null because of the
> > panelGrid rendered attribute Anybody can explain me why is this
> > happening and how can I solve this?
> >  
> > I'm using this scenario in order to show/hide a list's detail.
> >  
> > Thank you very much.
> >
> > 
> >
> > Sé un Mejor Amante del Cine
> > ¿Quieres saber cómo? ¡Deja que otras personas te ayuden!
> >
> <http://us.rd.yahoo.com/mail/es/tagline/beabetter/*http://advision.webevents.yahoo.com/reto/entretenimiento.html>.
>
>
> 
>
> Sé un Mejor Amante del Cine
> ¿Quieres saber cómo? ¡Deja que otras personas te ayuden!
> <http://us.rd.yahoo.com/mail/es/tagline/beabetter/*http://advision.webevents.yahoo.com/reto/entretenimiento.html>.



Re: commandLink do not work properly after some time

2007-07-06 Thread David Delbecq
Hi
commandlinks works is based on the view they are in. However, because
you use frames for navigation, it may be that the view, associated with
your commandlink, was generated, for example, 25 requests in the past,
all subsequent view request made in other frames. As a result, after
some time, when your try to call the command, JSF is unable to restore
the related view (JSF can not store an infinite number of views in user
session). The suggested workaround just resolve it by not storing view
in session, but better on client. This is not your only solution.

Possibles solutions:

1) don't use command link. Actually a commandlink is used to submit a
form, do you really want to submit a form while what you seem to look
for is just navigation? Simple  outside any form is
enough for most navigation purposes. There are even ways to pass simple
parmeters to new JSF views (eg:
http://server/app/faces/showItem.xhtml?itemId=123)
2) Have the view in the frame refresh on a regular basis, to ensure when
user use commandLinks, those comes from a still active view
3) Redesign your page, change from frames to a menu that appear on each
page, as such you are also sure action come from latest generated view
4) increase the nmber of views in session. This will delay problem but
not remove it:


org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION
20
Only applicable if state saving method is "server" (= 
default).
 Defines the amount (default = 20) of the latest views are 
stored in session.

 


En l'instant précis du 06/07/07 14:13, Tomasz Grobel s'exprimait en ces
termes:
> Hello
>
> I have problem (just like this one
> http://www.mail-archive.com/users@myfaces.apache.org/msg04434.html)
> with commandLink: I am using frames, left and right. In the left frame
> I have menu (commandLinks with target to right frame). After some time
> commandLinks stop invoke action on server but just reload menu. So
> becouse target is set,
> my left menu loads into right frame.
> This situation appears only if STATE_SAVING_METHOD is set to server;
> In my case, I can not use solution STATE_SAVING_METHOD set to client,
> because it is very inefficient (too big post).
>
> Maybe somebody have others ideas?



Re: commandLink do not work properly after some time

2007-07-09 Thread David Delbecq
Several possibilities

1) add a parameter named "refresh=true" to your link, add a life cycle
listener that, upon view creation, refresh the backing bean if it find
this parameter in request
2) do the refresh inside the backing bean, without intervention from the
view, depending on the lifetime of your datas

En l'instant précis du 09/07/07 08:24, Tomasz Grobel s'exprimait en ces
termes:
> I've read your solutions and:
>re 2) of course I have frames to not load menu each time
>re 3) I can not redesign it (it's a long story ;) )
>re 4) yes, I tried do that but as you wrote it only delays problem
>
> I think that solution number one is the best, but I have a little
> problem whit that.
> I have one session backing bean. Each time I clicked menu (by
> commandLink),
> I run method that refreshed some backing bean content (from DB). How
> can I refresh my backing bean now?
> How can I run specific backing bean method using such link? Is it
> possible?
>
>> Hi
>> commandlinks works is based on the view they are in. However, because
>> you use frames for navigation, it may be that the view, associated with
>> your commandlink, was generated, for example, 25 requests in the past,
>> all subsequent view request made in other frames. As a result, after
>> some time, when your try to call the command, JSF is unable to restore
>> the related view (JSF can not store an infinite number of views in user
>> session). The suggested workaround just resolve it by not storing view
>> in session, but better on client. This is not your only solution.
>>
>> Possibles solutions:
>>
>> 1) don't use command link. Actually a commandlink is used to submit a
>> form, do you really want to submit a form while what you seem to look
>> for is just navigation? Simple  outside any form is
>> enough for most navigation purposes. There are even ways to pass simple
>> parmeters to new JSF views (eg:
>> http://server/app/faces/showItem.xhtml?itemId=123)
>> 2) Have the view in the frame refresh on a regular basis, to ensure when
>> user use commandLinks, those comes from a still active view
>> 3) Redesign your page, change from frames to a menu that appear on each
>> page, as such you are also sure action come from latest generated view
>> 4) increase the nmber of views in session. This will delay problem but
>> not remove it:
>>
>> 
>>
>> org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION
>> 20
>> Only applicable if state saving method is
>> "server" (= default).
>>  Defines the amount (default = 20) of the latest
>> views are stored in session.
>> 
>>  
>>
>>
>> En l'instant précis du 06/07/07 14:13, Tomasz Grobel s'exprimait en ces
>> termes:
>>  
>>> Hello
>>>
>>> I have problem (just like this one
>>> http://www.mail-archive.com/users@myfaces.apache.org/msg04434.html)
>>> with commandLink: I am using frames, left and right. In the left frame
>>> I have menu (commandLinks with target to right frame). After some time
>>> commandLinks stop invoke action on server but just reload menu. So
>>> becouse target is set,
>>> my left menu loads into right frame.
>>> This situation appears only if STATE_SAVING_METHOD is set to server;
>>> In my case, I can not use solution STATE_SAVING_METHOD set to client,
>>> because it is very inefficient (too big post).
>>>
>>> Maybe somebody have others ideas?
>>> 



Re: WARN: Invalid tag found: unexpected input while looking for attr name or '/>' in ReducedHTMLParser.java

2007-07-10 Thread David Delbecq
This is not only not standard to put a  inside a body, it heavily
breaks the specifications. Your css might not get interpreted correctly
by browser, your DOM exposed to javascript could be strange (resulting
in scripts inside some tomahawk components to fail) and components
library that rely on interpreting response, like tomahawk or ajax4JSF,
will simply fail because the filter will be unable to convert response
to xhtml. If the rework of your page to be compliant is not possible /
too much work and you can afford random breakage in browsers, the
easiest workaround for this warning is to not use the tomahawk library,
that need to partially parse response to add specific entries
(css/javascript) in the  of document.

See
http://myfaces.apache.org/commons/apidocs/org/apache/myfaces/renderkit/html/util/ReducedHTMLParser.html
for details on the reason of this class.

En l'instant précis du 09/07/07 15:12, Bhagwat, Vinit (Vinit)
s'exprimait en ces termes:
> Hi,
>  
> I am using Tomahawk tree component in our application for navigation
> page. While expanding or collapsing the tree I am getting following error:
>  
> /WARN: Invalid tag found: unexpected input while looking for attr name
> or '/>' in ReducedHTMLParser.java/
>  
> After debugging I found that as we are including.jsp files inside
> other .jsp file the response has  tag starting inside  tag
> because of embedded  tags the parsing throws exception.
>  
> I am getting exception from parse() method of ReducedHTMLParser.java.
> So is there any workaround for this?
> I know embedded html tag is not standard way, but I can't change this
> as it requires lot of code refactor, which is not possible at this
> point of time.
>  
> Thanks and regards,
>  
> Vinit
>  
>  
>  
>  



Re: Position of popup

2007-07-10 Thread David Delbecq
Hi

Have you tried to reposition your popup with javascript after page
rendering. At that moment you know the size of relative container and
could use that information to position the absolute popup.


En l'instant précis du 09/07/07 19:29, Trumml s'exprimait en ces termes:
> I have a problem with the position of the popup!
> The popup is within a div element which is positioned relative. So the
> origin coordinate of the popup is the popups parent div. The problem is,
> that I can not use the  displayAtDistanceX or displayAtDistanceY tag,
> because the content before the relative positioned div is not static!
>
> I tried to solve my problem by using a JS popup library but then I do not
> know how to use my DateConverter for the text of the popup, because it is
> not possible to do something like:
>
> 
> 
> [...]
> 
> 
>
> And if I write
>
> 
>
> my DateConverter is not used!
>
> Any suggestions?
>   



Re: commandLink do not work properly after some time

2007-07-10 Thread David Delbecq
En l'instant précis du 10/07/07 09:48, Tomasz Grobel s'exprimait en ces
termes:
> Hi
> Thank you very much for your help.
> As you suggested, I created life cycle listener, but instead of
> "refresh=true" parameter I am sending "action parameter".
>
>   
> pages/appointments/appointments.jsf?action=appointmentsBean.showAppointments
>
>
> After parsing this string, inside of  listener, I am invoking:
>
>Object o =
> fc.getApplication().getVariableResolver().resolveVariable(fc, bbName);
>o.getClass().getMethod(methodName).invoke(o);
> Now, solution is very generic.
and dangerous :)
User could call any zero argument bean method from command line, this
include non authenticated users could perhaps call methods of your admin
beans
>
> David Delbecq napisał(a):
>> Several possibilities
>>
>> 1) add a parameter named "refresh=true" to your link, add a life cycle
>> listener that, upon view creation, refresh the backing bean if it find
>> this parameter in request
>> 2) do the refresh inside the backing bean, without intervention from the
>> view, depending on the lifetime of your datas
>>
>> En l'instant précis du 09/07/07 08:24, Tomasz Grobel s'exprimait en ces
>> termes:
>>  
>>> I've read your solutions and:
>>>re 2) of course I have frames to not load menu each time
>>>re 3) I can not redesign it (it's a long story ;) )
>>>re 4) yes, I tried do that but as you wrote it only delays problem
>>>
>>> I think that solution number one is the best, but I have a little
>>> problem whit that.
>>> I have one session backing bean. Each time I clicked menu (by
>>> commandLink),
>>> I run method that refreshed some backing bean content (from DB). How
>>> can I refresh my backing bean now?
>>> How can I run specific backing bean method using such link? Is it
>>> possible?
>>>
>>>
>>>> Hi
>>>> commandlinks works is based on the view they are in. However, because
>>>> you use frames for navigation, it may be that the view, associated
>>>> with
>>>> your commandlink, was generated, for example, 25 requests in the past,
>>>> all subsequent view request made in other frames. As a result, after
>>>> some time, when your try to call the command, JSF is unable to restore
>>>> the related view (JSF can not store an infinite number of views in
>>>> user
>>>> session). The suggested workaround just resolve it by not storing view
>>>> in session, but better on client. This is not your only solution.
>>>>
>>>> Possibles solutions:
>>>>
>>>> 1) don't use command link. Actually a commandlink is used to submit a
>>>> form, do you really want to submit a form while what you seem to look
>>>> for is just navigation? Simple  outside any form is
>>>> enough for most navigation purposes. There are even ways to pass
>>>> simple
>>>> parmeters to new JSF views (eg:
>>>> http://server/app/faces/showItem.xhtml?itemId=123)
>>>> 2) Have the view in the frame refresh on a regular basis, to ensure
>>>> when
>>>> user use commandLinks, those comes from a still active view
>>>> 3) Redesign your page, change from frames to a menu that appear on
>>>> each
>>>> page, as such you are also sure action come from latest generated view
>>>> 4) increase the nmber of views in session. This will delay problem but
>>>> not remove it:
>>>>
>>>> 
>>>>   
>>>> org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION
>>>> 20
>>>> Only applicable if state saving method is
>>>> "server" (= default).
>>>>  Defines the amount (default = 20) of the latest
>>>> views are stored in session.
>>>> 
>>>>  
>>>>
>>>>
>>>> En l'instant précis du 06/07/07 14:13, Tomasz Grobel s'exprimait en
>>>> ces
>>>> termes:
>>>>  
>>>>  
>>>>> Hello
>>>>>
>>>>> I have problem (just like this one
>>>>> http://www.mail-archive.com/users@myfaces.apache.org/msg04434.html)
>>>>> with commandLink: I am using frames, left and right. In the left
>>>>> frame
>>>>> I have menu (commandLinks with target to right frame). After some
>>>>> time
>>>>> commandLinks stop invoke action on server but just reload menu. So
>>>>> becouse target is set,
>>>>> my left menu loads into right frame.
>>>>> This situation appears only if STATE_SAVING_METHOD is set to server;
>>>>> In my case, I can not use solution STATE_SAVING_METHOD set to client,
>>>>> because it is very inefficient (too big post).
>>>>>
>>>>> Maybe somebody have others ideas?
>>>>> 



  1   2   3   4   >