Hello Massimiliano,

You need you write a custom tag, you can't do it with 
the f:converter tag.

If you look at this thread it's got source code for creating 
a custom tag for a converter.

You will need to pay attention to when the attributes from 
the tag get evaluated (when the valueBinding getValue() occurs).
The example shown will evaluate the attributes when the
converter is created.  Further down the thread there is 
a discussion of how to evaluate the attributes when the 
converter getAsString() is called.

http://thread.gmane.org/gmane.comp.jakarta.myfaces.user/17632/focus=1781
9
 

Greg

-----Original Message-----
From: Massimiliano Cantoni [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 18, 2006 11:58 AM
To: users@myfaces.apache.org
Subject: Converter with parameters

I am trying to develop an application using Myfaces and now I am facing 
this problem:

I am trying to develop a custom converter using the converter tag.
To be more concrete I am trying to convert the name of a document given 
the id.
Unfortunately the name of the document is not depending only on the id 
but also on another customization number and
I do not know how to pass it to the converter.

I tried the following

<h:outputText value="#{obj.id}" >
    <f:converter converterId="MyConverter">
       <f:attribute name="custom" value="#{obj.custom}"/>
    </f:converter>
</h:outputText>

But unfortunately it says that converter must be empty according to TLD.

I tried also the follwing
<h:outputText value="#{obj.id}" >
    <f:attribute name="custom" value="#{obj.custom}"/>
    <f:converter converterId="MyConverter"/>
</h:outputText>

and tried to get custom from MyConverter code without any success.

Am I using the correct approach?

Can someone point me on the right direction?

JSF newbie but not too much

-- 
------------------------------------------
Cantoni Massimiliano

CED Assicom S.p.a. 
email: [EMAIL PROTECTED]
Indirizzo: Via De Cocule 33030 BUIA(UD)
Telefono: 0432/9683
------------------------------------------

Reply via email to