String format

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

String format

aa aa-2
Hello,

I've a date field in a xml with yyyy-mm-dd format, and this is ok. Now, I'm trying to show this date with dd-mm-yyyy format in a read only input field, and then, when i save the form, i want this field don't change in my xml file. How can i do that?

Thanks in advance.
Jesús

Consigue el nuevo Windows Live Messenger Pruébalo

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: String format

Alessandro Vernet
Administrator
Jesús,

On 9/27/07, aa aa <[hidden email]> wrote:
> I've a date field in a xml with yyyy-mm-dd format, and this is ok. Now, I'm
> trying to show this date with dd-mm-yyyy format in a read only input field,
> and then, when i save the form, i want this field don't change in my xml
> file. How can i do that?

You can use the xxforms:format attribute on <xforms:output> or
<xforms:input>. (See "2.2.2. xforms:input" and "2.2.3. xforms:output"
on http://www.orbeon.com/ops/doc/reference-xforms-2.)

And if this is something you want to do across your application, you
can set your default formatting in properties.xml, and you don't have
to include that xxforms:format attribute. (See "2.2.4. Default
Formatting" that follows.)

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: [ops-users] String format

aa aa-2
i've tried that and it doesn't work as i want.

The following code is my code:

<xforms:bind readonly=". != ''" nodeset="/documento/Cuenta-04-Simp/Entidad/FAprPres"/>
[.....]
<xforms:input ref="FAprPres"   xxforms:format="format-date(xs:date(.), '[D]-[M]-[Y]', 'es', (), ())">
        <xforms:label class="sort-label">Fecha de aprobación del presupuesto</xforms:label>
</xforms:input>

FAprPres has, for instance, '2007-01-29' and i want to show it like '29-01-2007', but with that code i show it like '2007-01-29'

Thank you

> Date: Thu, 27 Sep 2007 23:46:56 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [ops-users] String format
>
> Jesús,
>
> On 9/27/07, aa aa <[hidden email]> wrote:
> > I've a date field in a xml with yyyy-mm-dd format, and this is ok. Now, I'm
> > trying to show this date with dd-mm-yyyy format in a read only input field,
> > and then, when i save the form, i want this field don't change in my xml
> > file. How can i do that?
>
> You can use the xxforms:format attribute on <xforms:output> or
> <xforms:input>. (See "2.2.2. xforms:input" and "2.2.3. xforms:output"
> on http://www.orbeon.com/ops/doc/reference-xforms-2.)
>
> And if this is something you want to do across your application, you
> can set your default formatting in properties.xml, and you don't have
> to include that xxforms:format attribute. (See "2.2.4. Default
> Formatting" that follows.)
>
> Alex
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> http://www.orbeon.com/


Consigue el nuevo Windows Live Messenger Pruébalo

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: String Format

Hank Ratzesberger
In reply to this post by aa aa-2




Jesús,

Do you use the format-date function?  


<xforms:input ref="start-date" xxforms:format="format-date(xs:date(.), '[Y]-[M01]-[D01]', 'en', (), ())">
<xforms:label>  Start Date: </xforms:label>
</xforms:input>

--Hank
UCSB

On Sep 27, 2007, at 1:04 AM, aa aa wrote:

Hello,

I've a date field in a xml with yyyy-mm-dd format, and this is ok. Now, I'm trying to show this date with dd-mm-yyyy format in a read only input field, and then, when i save the form, i want this field don't change in my xml file. How can i do that?

Thanks in advance.
Jesús

Consigue el nuevo Windows Live Messenger Pruébalo

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042






Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: [ops-users] String format

Adrian Baker
In reply to this post by aa aa-2
Does adding a type of xs:date to the bind help? From memory xxforms:format is only applied to inputs bound to dates.

aa aa wrote:
i've tried that and it doesn't work as i want.

The following code is my code:

<xforms:bind readonly=". != ''" nodeset="/documento/Cuenta-04-Simp/Entidad/FAprPres"/>
[.....]
<xforms:input ref="FAprPres"   xxforms:format="format-date(xs:date(.), '[D]-[M]-[Y]', 'es', (), ())">
        <xforms:label class="sort-label">Fecha de aprobación del presupuesto</xforms:label>
</xforms:input>

FAprPres has, for instance, '2007-01-29' and i want to show it like '29-01-2007', but with that code i show it like '2007-01-29'

Thank you

> Date: Thu, 27 Sep 2007 23:46:56 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [ops-users] String format
>
> Jesús,
>
> On 9/27/07, aa aa [hidden email] wrote:
> > I've a date field in a xml with yyyy-mm-dd format, and this is ok. Now, I'm
> > trying to show this date with dd-mm-yyyy format in a read only input field,
> > and then, when i save the form, i want this field don't change in my xml
> > file. How can i do that?
>
> You can use the xxforms:format attribute on <xforms:output> or
> <xforms:input>. (See "2.2.2. xforms:input" and "2.2.3. xforms:output"
> on http://www.orbeon.com/ops/doc/reference-xforms-2.)
>
> And if this is something you want to do across your application, you
> can set your default formatting in properties.xml, and you don't have
> to include that xxforms:format attribute. (See "2.2.4. Default
> Formatting" that follows.)
>
> Alex
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> http://www.orbeon.com/


Consigue el nuevo Windows Live Messenger Pruébalo


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: [ops-users] String format

aa aa-2
Hello!

It's works almost perfectly but it shows like a label and i want show it like an input text (read only, but in an input text). Is it possible?

Thank you.


Date: Mon, 1 Oct 2007 09:07:24 +1300
From: [hidden email]
To: [hidden email]
Subject: Re: [ops-users] String format

Does adding a type of xs:date to the bind help? From memory xxforms:format is only applied to inputs bound to dates.

aa aa wrote:
i've tried that and it doesn't work as i want.

The following code is my code:

<xforms:bind readonly=". != ''" nodeset="/documento/Cuenta-04-Simp/Entidad/FAprPres"/>
[.....]
<xforms:input ref="FAprPres"   xxforms:format="format-date(xs:date(.), '[D]-[M]-[Y]', 'es', (), ())">
        <xforms:label class="sort-label">Fecha de aprobación del presupuesto</xforms:label>
</xforms:input>

FAprPres has, for instance, '2007-01-29' and i want to show it like '29-01-2007', but with that code i show it like '2007-01-29'

Thank you

> Date: Thu, 27 Sep 2007 23:46:56 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [ops-users] String format
>
> Jesús,
>
> On 9/27/07, aa aa [hidden email] wrote:
> > I've a date field in a xml with yyyy-mm-dd format, and this is ok. Now, I'm
> > trying to show this date with dd-mm-yyyy format in a read only input field,
> > and then, when i save the form, i want this field don't change in my xml
> > file. How can i do that?
>
> You can use the xxforms:format attribute on <xforms:output> or
> <xforms:input>. (See "2.2.2. xforms:input" and "2.2.3. xforms:output"
> on http://www.orbeon.com/ops/doc/reference-xforms-2.)
>
> And if this is something you want to do across your application, you
> can set your default formatting in properties.xml, and you don't have
> to include that xxforms:format attribute. (See "2.2.4. Default
> Formatting" that follows.)
>
> Alex
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> http://www.orbeon.com/


Consigue el nuevo Windows Live Messenger Pruébalo


Busca desde cualquier página Web con una protección excepcional. Consigue la Barra de herramientas de Windows Live hoy mismo GRATUITAMENTE. Pruébalo

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

FW: String format

aa aa-2



From: [hidden email]
To: [hidden email]
Date: Mon, 1 Oct 2007 08:31:37 +0100
Subject: RE: [ops-users] String format

Hello!

It's works almost perfectly but it shows like a label and i want show it like an input text (read only, but in an input text). Is it possible?

Thank you.


Date: Mon, 1 Oct 2007 09:07:24 +1300
From: [hidden email]
To: [hidden email]
Subject: Re: [ops-users] String format

Does adding a type of xs:date to the bind help? From memory xxforms:format is only applied to inputs bound to dates.

aa aa wrote:
i've tried that and it doesn't work as i want.

The following code is my code:

<xforms:bind readonly=". != ''" nodeset="/documento/Cuenta-04-Simp/Entidad/FAprPres"/>
[.....]
<xforms:input ref="FAprPres"   xxforms:format="format-date(xs:date(.), '[D]-[M]-[Y]', 'es', (), ())">
        <xforms:label class="sort-label">Fecha de aprobación del presupuesto</xforms:label>
</xforms:input>

FAprPres has, for instance, '2007-01-29' and i want to show it like '29-01-2007', but with that code i show it like '2007-01-29'

Thank you

> Date: Thu, 27 Sep 2007 23:46:56 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [ops-users] String format
>
> Jesús,
>
> On 9/27/07, aa aa [hidden email] wrote:
> > I've a date field in a xml with yyyy-mm-dd format, and this is ok. Now, I'm
> > trying to show this date with dd-mm-yyyy format in a read only input field,
> > and then, when i save the form, i want this field don't change in my xml
> > file. How can i do that?
>
> You can use the xxforms:format attribute on <xforms:output> or
> <xforms:input>. (See "2.2.2. xforms:input" and "2.2.3. xforms:output"
> on http://www.orbeon.com/ops/doc/reference-xforms-2.)
>
> And if this is something you want to do across your application, you
> can set your default formatting in properties.xml, and you don't have
> to include that xxforms:format attribute. (See "2.2.4. Default
> Formatting" that follows.)
>
> Alex
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> http://www.orbeon.com/


Consigue el nuevo Windows Live Messenger Pruébalo


Busca desde cualquier página Web con una protección excepcional. Consigue la Barra de herramientas de Windows Live hoy mismo GRATUITAMENTE. Pruébalo


¡Ya está aquí Windows Live Spaces! Ahora podrás crear fácilmente tu propio sitio Web. Pruébalo

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

message-footer.txt (352 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [ops-users] String format

Alessandro Vernet
Administrator
In reply to this post by aa aa-2
On 10/1/07, aa aa <[hidden email]> wrote:
> It's works almost perfectly but it shows like a label and i want show it
> like an input text (read only, but in an input text). Is it possible?

If you want to use an xforms:input, you need to bind it to a node that
contains the data already formated. You can do this by having a
"working" instance with a node calculated based on the instance that
contains the real date, e.g.:

<xforms:bind nodeset="instance('work')/date"
calculate="format-date(xs:date(instance('real-instance')/your-date),
'[D]-[M]-[Y]', 'es', (), ())"/>

Because of the "calculate" the node will be made read-only, so your
input field bound to that now will show as read-only.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: [ops-users] String format

aa aa-2
I cann't do that because i only want show the data in this format, and i think if i do that (with calculate), the data is saving with this format in the xml.

> Date: Mon, 1 Oct 2007 11:52:51 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [ops-users] String format
>
> On 10/1/07, aa aa <[hidden email]> wrote:
> > It's works almost perfectly but it shows like a label and i want show it
> > like an input text (read only, but in an input text). Is it possible?
>
> If you want to use an xforms:input, you need to bind it to a node that
> contains the data already formated. You can do this by having a
> "working" instance with a node calculated based on the instance that
> contains the real date, e.g.:
>
> <xforms:bind nodeset="instance('work')/date"
> calculate="format-date(xs:date(instance('real-instance')/your-date),
> '[D]-[M]-[Y]', 'es', (), ())"/>
>
> Because of the "calculate" the node will be made read-only, so your
> input field bound to that now will show as read-only.
>
> Alex
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> http://www.orbeon.com/


Busca desde cualquier página Web con una protección excepcional. Consigue la Barra de herramientas de Windows Live hoy mismo GRATUITAMENTE. Pruébalo

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: [ops-users] String format

Alessandro Vernet
Administrator
On 10/2/07, aa aa <[hidden email]> wrote:
>
>  I cann't do that because i only want show the data in this format, and i
> think if i do that (with calculate), the data is saving with this format in
> the xml.

What you can do is have a separate instance that contains the data in
that format. So you don't change your original instance. You create a
new one, and have an element of that new instance calculated based on
the non-formated value in the original instance. You the bind the
control to the element in the new instance.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: [ops-users] String format

Adrian Baker
Alessandro Vernet wrote:
On 10/2/07, aa aa [hidden email] wrote:
  
 I cann't do that because i only want show the data in this format, and i
think if i do that (with calculate), the data is saving with this format in
the xml.
    

What you can do is have a separate instance that contains the data in
that format. So you don't change your original instance. You create a
new one, and have an element of that new instance calculated based on
the non-formated value in the original instance. You the bind the
control to the element in the new instance.

Alex
  
No fault of yours Alex (rather the spec), but the problem with this sort of solution is that it becomes unworkable as soon as a repeat is involved.


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: [ops-users] String format

Alessandro Vernet
Administrator
Adrian,

On 10/2/07, Adrian Baker <[hidden email]> wrote:
>  No fault of yours Alex (rather the spec), but the problem with this sort of
> solution is that it becomes unworkable as soon as a repeat is involved.

We'll say it is Erik's fault, since he is working on the spec! ;) You
are right; this gets complicated with repeats, especially when you
have to handle insert/delete and maintain this additional instance as
well as the "original" instance. The WG is aware of this, and in fact
this has already been discussed at a meeting I attended earlier this
year. I can't quite remember was the suggestion was; ideally it would
have been capture
(http://www.w3.org/MarkUp/Forms/wiki/XForms_Future_Features), but it
either wasn't or I can't find it.

But if you have suggestions, please pass them along :).

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws