RE: General Converter Question

2006-04-27 Thread Frank Russo
Nope. I tried this as well, with the same problem: 
/WEB-INF/sandbox.taglib.xml

I'm going to post to the facelets list... 


Frank Russo
Senior Developer
FX Alliance, LLC


-Original Message-
From: Mike Kienenberger [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 27, 2006 4:31 PM
To: MyFaces Discussion
Subject: Re: General Converter Question

On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> I've tried other sandbox components in the past, but have had similar 
> problems.

Possibly a newline issue in the facelets.LIBRARIES list?

Here's what I have:

web.xml:
==

  facelets.LIBRARIES
 
/WEB-INF/jenia4faces.taglib.xml;/WEB-INF/tomahawk.taglib.xm
l;/WEB-INF/sandbox.taglib.xml
  A semicolon (;) delimitted list of paths to Facelet
tag libraries

==


page code:
==
  xmlns:sandbox="http://myfaces.apache.org/sandbox";
==

sandbox.taglib.xml:
==

http://java.sun.com/dtd/facelet-taglib_1_0.dtd";>


http://myfaces.apache.org/sandbox
==





Re: General Converter Question

2006-04-27 Thread Mike Kienenberger
On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> I've tried other sandbox components in the past, but have had similar
> problems.

Possibly a newline issue in the facelets.LIBRARIES list?

Here's what I have:

web.xml:
==

  facelets.LIBRARIES
  
/WEB-INF/jenia4faces.taglib.xml;/WEB-INF/tomahawk.taglib.xml;/WEB-INF/sandbox.taglib.xml
  A semicolon (;) delimitted list of paths to Facelet
tag libraries

==


page code:
==
  xmlns:sandbox="http://myfaces.apache.org/sandbox";
==

sandbox.taglib.xml:
==

http://java.sun.com/dtd/facelet-taglib_1_0.dtd";>


http://myfaces.apache.org/sandbox
==


RE: General Converter Question

2006-04-27 Thread Frank Russo
I've tried other sandbox components in the past, but have had similar
problems.

Here is my info:

Web.xml entry: 

facelets.LIBRARIES

/WEB-INF/tomahawk.taglib.xml;
/WEB-INF/sandbox.taglib.xml;



Namespace definitions:
http://www.w3.org/1999/xhtml";
xmlns:h="http://java.sun.com/jsf/html";
xmlns:f="http://java.sun.com/jsf/core";
xmlns:ui="http://java.sun.com/jsf/facelets";
xmlns:s="http://myfaces.apache.org/sandbox";
>

Page code:




sandbox.taglib.xml file:

http://java.sun.com/dtd/facelet-taglib_1_0.dtd";>



http://myfaces.apache.org/sandbox

convertBoolean


org.apache.myfaces.custom.convertboolean.BooleanConverter<
/converter-id>




Frank Russo
Senior Developer
FX Alliance, LLC


-Original Message-
From: Mike Kienenberger [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 27, 2006 4:15 PM
To: MyFaces Discussion
Subject: Re: General Converter Question

Only thing I can think of is a missing or incorrect xmlns entry at the
top of the page (or wherever you're specifying them).   Is this the
first sandbox component you're using?

Other than that, your best bet is to post your web.xml facelets library
init param, your page code, and your sandbox.taglib.xml file.

On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> It's definitely not finding the converter. It renders as:
>  falseValue="N">
>
> I've added the tag to the page. I've included the sandbox.taglib.xml 
> file to my web.xml. Both the taglib and the sandbox jar are included 
> in my webapp. Is there something I'm missing?
>
> Frank Russo
> Senior Developer
> FX Alliance, LLC
>
>
> -Original Message-----
> From: Mike Kienenberger [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 27, 2006 3:03 PM
> To: MyFaces Discussion
> Subject: Re: General Converter Question
>
> On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> > Actually, I thought it was working, but it was getting a null, but 
> > the
>
> > checkbox rendered unchecked. When I set a value, I get the exception

> > below. It seems to not be finding the converter, as it's never
called.
> >
> > I've added the sandbox.taglib.xml file to my web-inf directory. I've

> > added the reference to it in my web.xml. I have the sanbox jar in my

> > app's web-inf/lib directory. Am I missing something?
>
> My guess is it's not finding the converter.  Did you add a converter 
> tag to your page?  Does the resulting html still show the tag or was 
> it properly interpreted as a converter?
>
>
>
>





Re: General Converter Question

2006-04-27 Thread Mike Kienenberger
Only thing I can think of is a missing or incorrect xmlns entry at the
top of the page (or wherever you're specifying them).   Is this the
first sandbox component you're using?

Other than that, your best bet is to post your web.xml facelets
library init param, your page code, and your sandbox.taglib.xml file.

On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> It's definitely not finding the converter. It renders as:
>  falseValue="N">
>
> I've added the tag to the page. I've included the sandbox.taglib.xml
> file to my web.xml. Both the taglib and the sandbox jar are included in
> my webapp. Is there something I'm missing?
>
> Frank Russo
> Senior Developer
> FX Alliance, LLC
>
>
> -Original Message-
> From: Mike Kienenberger [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 27, 2006 3:03 PM
> To: MyFaces Discussion
> Subject: Re: General Converter Question
>
> On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> > Actually, I thought it was working, but it was getting a null, but the
>
> > checkbox rendered unchecked. When I set a value, I get the exception
> > below. It seems to not be finding the converter, as it's never called.
> >
> > I've added the sandbox.taglib.xml file to my web-inf directory. I've
> > added the reference to it in my web.xml. I have the sanbox jar in my
> > app's web-inf/lib directory. Am I missing something?
>
> My guess is it's not finding the converter.  Did you add a converter tag
> to your page?  Does the resulting html still show the tag or was it
> properly interpreted as a converter?
>
>
>
>


RE: General Converter Question

2006-04-27 Thread Frank Russo
It's definitely not finding the converter. It renders as: 


I've added the tag to the page. I've included the sandbox.taglib.xml
file to my web.xml. Both the taglib and the sandbox jar are included in
my webapp. Is there something I'm missing? 

Frank Russo
Senior Developer
FX Alliance, LLC


-Original Message-
From: Mike Kienenberger [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 27, 2006 3:03 PM
To: MyFaces Discussion
Subject: Re: General Converter Question

On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> Actually, I thought it was working, but it was getting a null, but the

> checkbox rendered unchecked. When I set a value, I get the exception 
> below. It seems to not be finding the converter, as it's never called.
>
> I've added the sandbox.taglib.xml file to my web-inf directory. I've 
> added the reference to it in my web.xml. I have the sanbox jar in my 
> app's web-inf/lib directory. Am I missing something?

My guess is it's not finding the converter.  Did you add a converter tag
to your page?  Does the resulting html still show the tag or was it
properly interpreted as a converter?





Re: General Converter Question

2006-04-27 Thread Mike Kienenberger
On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> Actually, I thought it was working, but it was getting a null, but the
> checkbox rendered unchecked. When I set a value, I get the exception
> below. It seems to not be finding the converter, as it's never called.
>
> I've added the sandbox.taglib.xml file to my web-inf directory. I've
> added the reference to it in my web.xml. I have the sanbox jar in my
> app's web-inf/lib directory. Am I missing something?

My guess is it's not finding the converter.  Did you add a converter
tag to your page?  Does the resulting html still show the tag or was
it properly interpreted as a converter?


RE: General Converter Question

2006-04-27 Thread Frank Russo
Actually, I thought it was working, but it was getting a null, but the
checkbox rendered unchecked. When I set a value, I get the exception
below. It seems to not be finding the converter, as it's never called. 

I've added the sandbox.taglib.xml file to my web-inf directory. I've
added the reference to it in my web.xml. I have the sanbox jar in my
app's web-inf/lib directory. Am I missing something? 

Here is the stackstrace:

java.lang.IllegalArgumentException: Expected submitted value of type
Boolean for Component : {Component-Path : [Class:
javax.faces.component.UIViewRoot,ViewId:
/manageSettlementEntitiesMap.xhtml][Class:
javax.faces.component.html.HtmlForm,Id: _id2][Class:
javax.faces.component.html.HtmlPanelGrid,Id: _id10][Class:
javax.faces.component.html.HtmlDataTable,Id: mappingTable][Class:
javax.faces.component.UIColumn,Id: _id37][Class:
javax.faces.component.html.HtmlSelectBooleanCheckbox,Id: _id39]}
at
org.apache.myfaces.shared_impl.renderkit.RendererUtils.getBooleanValue(R
endererUtils.java:151)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlCheckboxRendererBase.e
ncodeEnd(HtmlCheckboxRendererBase.java:60)
at
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:537
)
at
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(Rende
rerUtils.java:442)
at
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(Re
ndererUtils.java:419)
at
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(Rende
rerUtils.java:440)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.rend
erColumnBody(HtmlTableRendererBase.java:212)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.enco
deColumnChild(HtmlTableRendererBase.java:181)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.enco
deInnerHtml(HtmlTableRendererBase.java:167)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.enco
deChildren(HtmlTableRendererBase.java:100)
at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.jav
a:525)
at
org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(Rende
rerUtils.java:436)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.rende
rChildren(HtmlGridRendererBase.java:216)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encod
eEnd(HtmlGridRendererBase.java:98)
at
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:537
)
at
com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSuppo
rt.java:242)
at
com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSuppo
rt.java:239)
at
com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSuppo
rt.java:239)
at
com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:5
40)
at
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:367
)
at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)



Frank Russo
Senior Developer
FX Alliance, LLC


-Original Message-
From: Frank Russo 
Sent: Thursday, April 27, 2006 1:30 PM
To: MyFaces Discussion
Subject: RE: General Converter Question

It works like a charm with the following in the facelets taglib:


convertBoolean

 
org.apache.myfaces.custom.convertboolean.BooleanConverter<
/converter-id>




Frank Russo
Senior Developer
FX Alliance, LLC


-Original Message-
From: Frank Russo
Sent: Thursday, April 27, 2006 1:24 PM
To: MyFaces Discussion
Subject: RE: General Converter Question

Can I apply the below to the facelet taglib as is? I'm trying it now, so
hopefully... 


Frank Russo
Senior Developer
FX Alliance, LLC


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Matthias Wessendorf
Sent: Thursday, April 27, 2006 1:17 PM
To: MyFaces Discussion
Subject: Re: General Converter Question

taken from TLD file





convertBoolean

org.apache.myfaces.custom.convertboolean.ConvertBooleanTag
Boolean Converter
Converts a boolean to custom format
(yes/no), (1/0), etc.


trueValue
false
Value representing a boolean true,
e.g. TRUE, yes, 1, etc.



falseValue
false
Value representing a boolean false,
e.g. FALSE, no, 0, etc.





On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> That's it exactly. Is it as simple as putting  trueValue="Y" falseValue="N"/> in my page?
>
> Frank Russo
> Senior Developer
> FX Alliance, LLC
>
>
> -

Re: General Converter Question

2006-04-27 Thread Matthias Wessendorf
Did you looked at [1]

:-)

-Matthias

[1] http://wiki.java.net/bin/view/Projects/FaceletsTaglibsMyfacesSandbox

On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> It works like a charm with the following in the facelets taglib:
>
> 
> convertBoolean
> 
>
> org.apache.myfaces.custom.convertboolean.BooleanConverter<
> /converter-id>
> 
> 
>
>
> Frank Russo
> Senior Developer
> FX Alliance, LLC
>
>
> -Original Message-
> From: Frank Russo
> Sent: Thursday, April 27, 2006 1:24 PM
> To: MyFaces Discussion
> Subject: RE: General Converter Question
>
> Can I apply the below to the facelet taglib as is? I'm trying it now, so
> hopefully...
>
>
> Frank Russo
> Senior Developer
> FX Alliance, LLC
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
> Matthias Wessendorf
> Sent: Thursday, April 27, 2006 1:17 PM
> To: MyFaces Discussion
> Subject: Re: General Converter Question
>
> taken from TLD file
>
> 
>
> 
> 
> convertBoolean
>
> org.apache.myfaces.custom.convertboolean.ConvertBooleanTag ag-class>
> Boolean Converter
> Converts a boolean to custom format
> (yes/no), (1/0), etc.
>
> 
> trueValue
> false
> Value representing a boolean true,
> e.g. TRUE, yes, 1, etc.
> 
>
> 
> falseValue
> false
> Value representing a boolean false,
> e.g. FALSE, no, 0, etc.
> 
> 
>
> 
>
> On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> > That's it exactly. Is it as simple as putting  > trueValue="Y" falseValue="N"/> in my page?
> >
> > Frank Russo
> > Senior Developer
> > FX Alliance, LLC
> >
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> > Of Matthias Wessendorf
> > Sent: Thursday, April 27, 2006 12:54 PM
> > To: MyFaces Discussion
> > Subject: Re: General Converter Question
> >
> > Frank-
> >
> > perhaps [1] is useful to you
> >
> > -Matthias
> >
> > [1]
> > http://myfaces.apache.org/sandbox/apidocs/org/apache/myfaces/custom/co
> > nv
> > ertboolean/BooleanConverter.html
> >
> > On 4/27/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> > > Yes, this should work.   I have the same issue, but I generally deal
> > > with it by converting the String type to a boolean type at the
> > > database layer level.
> > >
> > > But there's no reason you can't create a converter.   You'll need to
> > > manually assign it each place it is used, but that's probably what
> > > you
> >
> > > want to do anyway in this case.
> > >
> > >
> > > On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Is it possible to bind a h:selectBooleanCheckbox component to a
> > > > String field? The string field is coming out of the db as a Y or N
>
> > > > value. This is existing code used in a lot of places, and I can't
> > > > change it. It should have been stored in the object as a boolean
> > > > or Boolean, but I can't change that now.
> > > >
> > > > Any ideas on how to do this? I've read about using converter's,
> > > > but they don't seem to apply here, unless I have to write my own.
> > > > I'd rather use a standard one if I can.
> > > >
> > > > Thanks...
> > > >
> > > >
> > > >
> > > > Frank Russo
> > > > Senior Developer
> > > > FX Alliance, LLC
> > > > 900 Third Avenue, 3rd Floor
> > > > New York, NY 10022
> > > > 646.268.9949
> > > >
> > >
> >
> >
> > --
> > Matthias Wessendorf
> > Aechterhoek 18
> > 48282 Emsdetten
> > http://jroller.com/page/mwessendorf
> > mwessendorf-at-gmail-dot-com
> >
> >
> >
> >
>
>
> --
> Matthias Wessendorf
> Aechterhoek 18
> 48282 Emsdetten
> http://jroller.com/page/mwessendorf
> mwessendorf-at-gmail-dot-com
>
>
>
>
>
>
>


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com


RE: General Converter Question

2006-04-27 Thread Frank Russo
It works like a charm with the following in the facelets taglib:


convertBoolean

 
org.apache.myfaces.custom.convertboolean.BooleanConverter<
/converter-id>




Frank Russo
Senior Developer
FX Alliance, LLC


-Original Message-
From: Frank Russo 
Sent: Thursday, April 27, 2006 1:24 PM
To: MyFaces Discussion
Subject: RE: General Converter Question

Can I apply the below to the facelet taglib as is? I'm trying it now, so
hopefully... 


Frank Russo
Senior Developer
FX Alliance, LLC


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Matthias Wessendorf
Sent: Thursday, April 27, 2006 1:17 PM
To: MyFaces Discussion
Subject: Re: General Converter Question

taken from TLD file





convertBoolean

org.apache.myfaces.custom.convertboolean.ConvertBooleanTag
Boolean Converter
Converts a boolean to custom format
(yes/no), (1/0), etc.


trueValue
false
Value representing a boolean true,
e.g. TRUE, yes, 1, etc.



falseValue
false
Value representing a boolean false,
e.g. FALSE, no, 0, etc.





On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> That's it exactly. Is it as simple as putting  trueValue="Y" falseValue="N"/> in my page?
>
> Frank Russo
> Senior Developer
> FX Alliance, LLC
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf 
> Of Matthias Wessendorf
> Sent: Thursday, April 27, 2006 12:54 PM
> To: MyFaces Discussion
> Subject: Re: General Converter Question
>
> Frank-
>
> perhaps [1] is useful to you
>
> -Matthias
>
> [1]
> http://myfaces.apache.org/sandbox/apidocs/org/apache/myfaces/custom/co
> nv
> ertboolean/BooleanConverter.html
>
> On 4/27/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> > Yes, this should work.   I have the same issue, but I generally deal
> > with it by converting the String type to a boolean type at the 
> > database layer level.
> >
> > But there's no reason you can't create a converter.   You'll need to
> > manually assign it each place it is used, but that's probably what 
> > you
>
> > want to do anyway in this case.
> >
> >
> > On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> > >
> > > Is it possible to bind a h:selectBooleanCheckbox component to a 
> > > String field? The string field is coming out of the db as a Y or N

> > > value. This is existing code used in a lot of places, and I can't 
> > > change it. It should have been stored in the object as a boolean 
> > > or Boolean, but I can't change that now.
> > >
> > > Any ideas on how to do this? I've read about using converter's, 
> > > but they don't seem to apply here, unless I have to write my own.
> > > I'd rather use a standard one if I can.
> > >
> > > Thanks...
> > >
> > >
> > >
> > > Frank Russo
> > > Senior Developer
> > > FX Alliance, LLC
> > > 900 Third Avenue, 3rd Floor
> > > New York, NY 10022
> > > 646.268.9949
> > >
> >
>
>
> --
> Matthias Wessendorf
> Aechterhoek 18
> 48282 Emsdetten
> http://jroller.com/page/mwessendorf
> mwessendorf-at-gmail-dot-com
>
>
>
>


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com








RE: General Converter Question

2006-04-27 Thread Frank Russo
Can I apply the below to the facelet taglib as is? I'm trying it now, so
hopefully... 


Frank Russo
Senior Developer
FX Alliance, LLC


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Matthias Wessendorf
Sent: Thursday, April 27, 2006 1:17 PM
To: MyFaces Discussion
Subject: Re: General Converter Question

taken from TLD file





convertBoolean

org.apache.myfaces.custom.convertboolean.ConvertBooleanTag
Boolean Converter
Converts a boolean to custom format
(yes/no), (1/0), etc.


trueValue
false
Value representing a boolean true,
e.g. TRUE, yes, 1, etc.



falseValue
false
Value representing a boolean false,
e.g. FALSE, no, 0, etc.





On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> That's it exactly. Is it as simple as putting  trueValue="Y" falseValue="N"/> in my page?
>
> Frank Russo
> Senior Developer
> FX Alliance, LLC
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf 
> Of Matthias Wessendorf
> Sent: Thursday, April 27, 2006 12:54 PM
> To: MyFaces Discussion
> Subject: Re: General Converter Question
>
> Frank-
>
> perhaps [1] is useful to you
>
> -Matthias
>
> [1]
> http://myfaces.apache.org/sandbox/apidocs/org/apache/myfaces/custom/co
> nv
> ertboolean/BooleanConverter.html
>
> On 4/27/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> > Yes, this should work.   I have the same issue, but I generally deal
> > with it by converting the String type to a boolean type at the 
> > database layer level.
> >
> > But there's no reason you can't create a converter.   You'll need to
> > manually assign it each place it is used, but that's probably what 
> > you
>
> > want to do anyway in this case.
> >
> >
> > On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> > >
> > > Is it possible to bind a h:selectBooleanCheckbox component to a 
> > > String field? The string field is coming out of the db as a Y or N

> > > value. This is existing code used in a lot of places, and I can't 
> > > change it. It should have been stored in the object as a boolean 
> > > or Boolean, but I can't change that now.
> > >
> > > Any ideas on how to do this? I've read about using converter's, 
> > > but they don't seem to apply here, unless I have to write my own. 
> > > I'd rather use a standard one if I can.
> > >
> > > Thanks...
> > >
> > >
> > >
> > > Frank Russo
> > > Senior Developer
> > > FX Alliance, LLC
> > > 900 Third Avenue, 3rd Floor
> > > New York, NY 10022
> > > 646.268.9949
> > >
> >
>
>
> --
> Matthias Wessendorf
> Aechterhoek 18
> 48282 Emsdetten
> http://jroller.com/page/mwessendorf
> mwessendorf-at-gmail-dot-com
>
>
>
>


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com





Re: General Converter Question

2006-04-27 Thread Mike Kienenberger
On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> That's it exactly. Is it as simple as putting  trueValue="Y" falseValue="N"/> in my page?

Well, that and defining your facelet taglib.  :-)


Re: General Converter Question

2006-04-27 Thread Matthias Wessendorf
taken from TLD file





convertBoolean

org.apache.myfaces.custom.convertboolean.ConvertBooleanTag
Boolean Converter
Converts a boolean to custom format (yes/no), 
(1/0),
etc.


trueValue
false
Value representing a boolean true, e.g. 
TRUE, yes, 1,
etc.



falseValue
false
Value representing a boolean false, e.g. 
FALSE, no, 0,
etc.





On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> That's it exactly. Is it as simple as putting  trueValue="Y" falseValue="N"/> in my page?
>
> Frank Russo
> Senior Developer
> FX Alliance, LLC
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
> Matthias Wessendorf
> Sent: Thursday, April 27, 2006 12:54 PM
> To: MyFaces Discussion
> Subject: Re: General Converter Question
>
> Frank-
>
> perhaps [1] is useful to you
>
> -Matthias
>
> [1]
> http://myfaces.apache.org/sandbox/apidocs/org/apache/myfaces/custom/conv
> ertboolean/BooleanConverter.html
>
> On 4/27/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> > Yes, this should work.   I have the same issue, but I generally deal
> > with it by converting the String type to a boolean type at the
> > database layer level.
> >
> > But there's no reason you can't create a converter.   You'll need to
> > manually assign it each place it is used, but that's probably what you
>
> > want to do anyway in this case.
> >
> >
> > On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> > >
> > > Is it possible to bind a h:selectBooleanCheckbox component to a
> > > String field? The string field is coming out of the db as a Y or N
> > > value. This is existing code used in a lot of places, and I can't
> > > change it. It should have been stored in the object as a boolean or
> > > Boolean, but I can't change that now.
> > >
> > > Any ideas on how to do this? I've read about using converter's, but
> > > they don't seem to apply here, unless I have to write my own. I'd
> > > rather use a standard one if I can.
> > >
> > > Thanks...
> > >
> > >
> > >
> > > Frank Russo
> > > Senior Developer
> > > FX Alliance, LLC
> > > 900 Third Avenue, 3rd Floor
> > > New York, NY 10022
> > > 646.268.9949
> > >
> >
>
>
> --
> Matthias Wessendorf
> Aechterhoek 18
> 48282 Emsdetten
> http://jroller.com/page/mwessendorf
> mwessendorf-at-gmail-dot-com
>
>
>
>


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com


RE: General Converter Question

2006-04-27 Thread Frank Russo
That's it exactly. Is it as simple as putting  in my page?

Frank Russo
Senior Developer
FX Alliance, LLC


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Matthias Wessendorf
Sent: Thursday, April 27, 2006 12:54 PM
To: MyFaces Discussion
Subject: Re: General Converter Question

Frank-

perhaps [1] is useful to you

-Matthias

[1]
http://myfaces.apache.org/sandbox/apidocs/org/apache/myfaces/custom/conv
ertboolean/BooleanConverter.html

On 4/27/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> Yes, this should work.   I have the same issue, but I generally deal
> with it by converting the String type to a boolean type at the 
> database layer level.
>
> But there's no reason you can't create a converter.   You'll need to
> manually assign it each place it is used, but that's probably what you

> want to do anyway in this case.
>
>
> On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> >
> > Is it possible to bind a h:selectBooleanCheckbox component to a 
> > String field? The string field is coming out of the db as a Y or N 
> > value. This is existing code used in a lot of places, and I can't 
> > change it. It should have been stored in the object as a boolean or 
> > Boolean, but I can't change that now.
> >
> > Any ideas on how to do this? I've read about using converter's, but 
> > they don't seem to apply here, unless I have to write my own. I'd 
> > rather use a standard one if I can.
> >
> > Thanks...
> >
> >
> >
> > Frank Russo
> > Senior Developer
> > FX Alliance, LLC
> > 900 Third Avenue, 3rd Floor
> > New York, NY 10022
> > 646.268.9949
> >
>


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com





Re: General Converter Question

2006-04-27 Thread Mike Kienenberger
On 4/27/06, Julian Ray <[EMAIL PROTECTED]> wrote:
> If you use something like the BooleanUtils class from commons-lang, much of
> the technical aspects of conversion from strings to boolean values is done
> for you. All you need is a simple converter wrapper and a taglib.
>
> As this is such a common requirement I'm surprised that no one has pushed
> one into the Tomahawk build.

Well, the trick is not to convert from String to Boolean -- it's to
convert back to String afterward.


On 4/27/06, Matthias Wessendorf <[EMAIL PROTECTED]> wrote:
http://myfaces.apache.org/sandbox/apidocs/org/apache/myfaces/custom/convertboolean/BooleanConverter.html

Yeah!  I'd say that this does what you want.   Note that it has
methods for handling the problem above:

setTrueValue(String)  and setFalseValue(String)


Re: General Converter Question

2006-04-27 Thread Dennis Byrne
If you look at the source there is already a boolean converter, but it does the 
*opposite* of what you need.  It was in sandbox the last time I saw it but it 
may have moved to tomahawk.  Should be quick to implement though.

Dennis Byrne

>-Original Message-
>From: Frank Russo [mailto:[EMAIL PROTECTED]
>Sent: Thursday, April 27, 2006 12:35 PM
>To: 'MyFaces Discussion'
>Subject: General Converter Question
>
>Is it possible to bind a h:selectBooleanCheckbox component to a String
>field? The string field is coming out of the db as a Y or N value. This
>is existing code used in a lot of places, and I can't change it. It
>should have been stored in the object as a boolean or Boolean, but I
>can't change that now.
>
>Any ideas on how to do this? I've read about using converter's, but they
>don't seem to apply here, unless I have to write my own. I'd rather use
>a standard one if I can.
>
>Thanks...
>
>Frank Russo
>Senior Developer
>FX Alliance, LLC
>900 Third Avenue, 3rd Floor
>New York, NY 10022
>646.268.9949
>
>
>




Re: General Converter Question

2006-04-27 Thread Matthias Wessendorf
Frank-

perhaps [1] is useful to you

-Matthias

[1] 
http://myfaces.apache.org/sandbox/apidocs/org/apache/myfaces/custom/convertboolean/BooleanConverter.html

On 4/27/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> Yes, this should work.   I have the same issue, but I generally deal
> with it by converting the String type to a boolean type at the
> database layer level.
>
> But there's no reason you can't create a converter.   You'll need to
> manually assign it each place it is used, but that's probably what you
> want to do anyway in this case.
>
>
> On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
> >
> > Is it possible to bind a h:selectBooleanCheckbox component to a String
> > field? The string field is coming out of the db as a Y or N value. This is
> > existing code used in a lot of places, and I can't change it. It should have
> > been stored in the object as a boolean or Boolean, but I can't change that
> > now.
> >
> > Any ideas on how to do this? I've read about using converter's, but they
> > don't seem to apply here, unless I have to write my own. I'd rather use a
> > standard one if I can.
> >
> > Thanks...
> >
> >
> >
> > Frank Russo
> > Senior Developer
> > FX Alliance, LLC
> > 900 Third Avenue, 3rd Floor
> > New York, NY 10022
> > 646.268.9949
> >
>


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com


RE: General Converter Question

2006-04-27 Thread Julian Ray
If you use something like the BooleanUtils class from commons-lang, much of
the technical aspects of conversion from strings to boolean values is done
for you. All you need is a simple converter wrapper and a taglib.  

As this is such a common requirement I'm surprised that no one has pushed
one into the Tomahawk build.

-Original Message-
From: Mike Kienenberger [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 27, 2006 12:40 PM
To: MyFaces Discussion
Subject: Re: General Converter Question

Yes, this should work.   I have the same issue, but I generally deal
with it by converting the String type to a boolean type at the database
layer level.

But there's no reason you can't create a converter.   You'll need to
manually assign it each place it is used, but that's probably what you want
to do anyway in this case.


On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
>
> Is it possible to bind a h:selectBooleanCheckbox component to a String 
> field? The string field is coming out of the db as a Y or N value. 
> This is existing code used in a lot of places, and I can't change it. 
> It should have been stored in the object as a boolean or Boolean, but 
> I can't change that now.
>
> Any ideas on how to do this? I've read about using converter's, but 
> they don't seem to apply here, unless I have to write my own. I'd 
> rather use a standard one if I can.
>
> Thanks...
>
>
>
> Frank Russo
> Senior Developer
> FX Alliance, LLC
> 900 Third Avenue, 3rd Floor
> New York, NY 10022
> 646.268.9949
>



Re: General Converter Question

2006-04-27 Thread Mike Kienenberger
Yes, this should work.   I have the same issue, but I generally deal
with it by converting the String type to a boolean type at the
database layer level.

But there's no reason you can't create a converter.   You'll need to
manually assign it each place it is used, but that's probably what you
want to do anyway in this case.


On 4/27/06, Frank Russo <[EMAIL PROTECTED]> wrote:
>
> Is it possible to bind a h:selectBooleanCheckbox component to a String
> field? The string field is coming out of the db as a Y or N value. This is
> existing code used in a lot of places, and I can't change it. It should have
> been stored in the object as a boolean or Boolean, but I can't change that
> now.
>
> Any ideas on how to do this? I've read about using converter's, but they
> don't seem to apply here, unless I have to write my own. I'd rather use a
> standard one if I can.
>
> Thanks...
>
>
>
> Frank Russo
> Senior Developer
> FX Alliance, LLC
> 900 Third Avenue, 3rd Floor
> New York, NY 10022
> 646.268.9949
>


General Converter Question

2006-04-27 Thread Frank Russo



Is it possible to 
bind a h:selectBooleanCheckbox component to a String field? The string field is 
coming out of the db as a Y or N value. This is existing code used in a lot of 
places, and I can't change it. It should have been stored in the object as a 
boolean or Boolean, but I can't change that now.
 
Any ideas on how to 
do this? I've read about using converter's, but they don't seem to apply here, 
unless I have to write my own. I'd rather use a standard one if I can. 

 
Thanks...

Frank 
RussoSenior DeveloperFX Alliance, LLC900 Third Avenue, 3rd 
FloorNew York, 
NY 10022646.268.9949