You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Christofer Dutz <du...@c-ware.de> on 2005/10/20 22:54:37 UTC

[CForms] Accessing date-type widget and formating it's output for usage as attribute-value

Hi,

 

Another problem I am having some problems with. I need to add the value of a
date-type widget inside an attribute. Since the simple toString() output
doesn't do the trick, I would like to format the output. How can this be
done.

 

Chris


AW: AW: [CForms] Accessing date-type widget and formating it's output for usage as attribute-value

Posted by Christofer Dutz <du...@c-ware.de>.
I am inside a repeater but I really like your Tipp ... didn't think of that
;)

-----Ursprüngliche Nachricht-----
Von: Mark Lundquist [mailto:ml@wrinkledog.com] 
Gesendet: Freitag, 21. Oktober 2005 18:01
An: users@cocoon.apache.org
Betreff: Re: AW: [CForms] Accessing date-type widget and formating it's
output for usage as attribute-value


On Oct 21, 2005, at 6:53 AM, Christofer Dutz wrote:

> If I use exactly the same code as you I get 
> "[Lorg.w3c.dom.Node;@28e230" as
> value of ${dateFormatted}

ahh.... right, OK.  I guess it would do that.

Well then, the next thing that comes to mind would be to do the 
formatting in the flowscript, using SimpleDateFormat (or, I like to use 
org.apache.commons.text.FastDateFormat) and passing the result in as 
its own parameter.

That's relatively convenient as long as you are not inside a repeater.  
If you are, then you might try passing an instance of SimpleDateFormat 
as a JXTG parameter and then calling it in the template

	<foo bar="${dateFormat.format (someDateInARepeaterWidget)}">

GL,
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: AW: [CForms] Accessing date-type widget and formating it's output for usage as attribute-value

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Oct 21, 2005, at 6:53 AM, Christofer Dutz wrote:

> If I use exactly the same code as you I get 
> "[Lorg.w3c.dom.Node;@28e230" as
> value of ${dateFormatted}

ahh.... right, OK.  I guess it would do that.

Well then, the next thing that comes to mind would be to do the 
formatting in the flowscript, using SimpleDateFormat (or, I like to use 
org.apache.commons.text.FastDateFormat) and passing the result in as 
its own parameter.

That's relatively convenient as long as you are not inside a repeater.  
If you are, then you might try passing an instance of SimpleDateFormat 
as a JXTG parameter and then calling it in the template

	<foo bar="${dateFormat.format (someDateInARepeaterWidget)}">

GL,
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


AW: [CForms] Accessing date-type widget and formating it's output for usage as attribute-value

Posted by Christofer Dutz <du...@c-ware.de>.
If I use exactly the same code as you I get "[Lorg.w3c.dom.Node;@28e230" as
value of ${dateFormatted} ... couldn't find a way around this problem since
all child elements, name, value attributes seem to be empty/not excistent.

-----Ursprüngliche Nachricht-----
Von: Mark Lundquist [mailto:ml@wrinkledog.com] 
Gesendet: Donnerstag, 20. Oktober 2005 22:14
An: users@cocoon.apache.org
Betreff: Re: [CForms] Accessing date-type widget and formating it's output
for usage as attribute-value


On Oct 20, 2005, at 1:54 PM, Christofer Dutz wrote:

> Hi,
>  
> Another problem I am having some problems with. I need to add the 
> value of a date-type widget inside an attribute. Since the simple 
> toString() output doesn’t do the trick, I would like to format the 
> output. How can this be done.
>  
> Chris

<jx:set var="dateFormatted"><jx:formatDate pattern="MMM dd, yyyy" 
value="${somDate}"/></jx:set>
<foo bar="${dateFormatted}"/>

HTH,
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


AW: [CForms] Accessing date-type widget and formating it's output for usage as attribute-value

Posted by Christofer Dutz <du...@c-ware.de>.
I tried that and only got node-objects instead of strings :(

-----Ursprüngliche Nachricht-----
Von: Mark Lundquist [mailto:ml@wrinkledog.com] 
Gesendet: Donnerstag, 20. Oktober 2005 23:14
An: users@cocoon.apache.org
Betreff: Re: [CForms] Accessing date-type widget and formating it's output
for usage as attribute-value


On Oct 20, 2005, at 1:54 PM, Christofer Dutz wrote:

> Hi,
>  
> Another problem I am having some problems with. I need to add the 
> value of a date-type widget inside an attribute. Since the simple 
> toString() output doesn’t do the trick, I would like to format the 
> output. How can this be done.
>  
> Chris

<jx:set var="dateFormatted"><jx:formatDate pattern="MMM dd, yyyy" 
value="${somDate}"/></jx:set>
<foo bar="${dateFormatted}"/>

HTH,
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [CForms] Accessing date-type widget and formating it's output for usage as attribute-value

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Oct 20, 2005, at 1:54 PM, Christofer Dutz wrote:

> Hi,
>  
> Another problem I am having some problems with. I need to add the 
> value of a date-type widget inside an attribute. Since the simple 
> toString() output doesn’t do the trick, I would like to format the 
> output. How can this be done.
>  
> Chris

<jx:set var="dateFormatted"><jx:formatDate pattern="MMM dd, yyyy" 
value="${somDate}"/></jx:set>
<foo bar="${dateFormatted}"/>

HTH,
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org