You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2008/02/14 07:35:07 UTC

Re: MySQL "Year" vs CForms "Date"

Is anyone else able to reproduce this problem?  Or I am 
missing something simple?

>>> On 2008/01/14 at 08:01, in message <47...@csir.co.za>, "Derek Hohls" <DH...@csir.co.za> wrote:
Joerg
 
I am not sure what you are asking - if I use MySQL "Year" column and
Cocoon Forms "integer" type together, then the forms validator complains
that the widget is not a date type. OTOH, if I set the type to "date", then
an entry containing just a year value (e.g. 2007) is not accepted as a 
proper date. 
 
Derek

>>> Joerg Heinicke <jo...@gmx.de> 2008/01/13 02:47 AM >>>
On 09.01.2008 08:49, Derek Hohls wrote:

> I am trying to get a database submission to work with Cocoon Forms.  
> Up to now, all the data types have mapped well to the database column
> types.  However, now that I am trying to use the MySQL "Year" column
> type, I have run into a problem.  The Cocoon Forms definition validator 
> will not accept an "integer" type and, if I set the type to "date", then
> an entry containing just a year value (e.g. 2007) is not accepted as a 
> proper date.  How can I resolve this impasse between the two systems?

Why should it not work with integer?

Joerg

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


-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. 

This message has been scanned for viruses and dangerous content by MailScanner ( http://www.mailscanner.info/ ), 
and is believed to be clean. MailScanner thanks Transtec Computers ( http://www.transtec.co.uk/ ) for their support. 


-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: MySQL "Year" vs CForms "Date"

Posted by Derek Hohls <DH...@csir.co.za>.
Tobia
 
Well, in that case, I am really not sure - I use a "stock
standard" Cocoon 2.1.8 installation and this is the first
time I have had problems with form <-> database 
relationships.
 
If you have an example of some simple code that 
works on your side, I can try it out.
 
Derek

>>> On 2008/02/15 at 04:38, in message <36...@linux.it>, Tobia Conforto <to...@linux.it> wrote:
Derek Hohls wrote:
> Case 2:
> <fd:field id="Year">
>  <fd:label>Year</fd:label>
>  <fd:datatype base="integer"/>
> </fd:field>
> Cocoon will not accept this as a valid forms definition, when trying  
> to access the form via the browser.

I still can't see what's wrong with this form definition.
I use <fd:datatype base="integer"/> all the time with no problems.

You must be using this definition along with some incompatible Jx,  
Flowscript, or other binding.


Tobia

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


-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


Re: MySQL "Year" vs CForms "Date"

Posted by Tobia Conforto <to...@linux.it>.
Derek Hohls wrote:
> Case 2:
> <fd:field id="Year">
>  <fd:label>Year</fd:label>
>  <fd:datatype base="integer"/>
> </fd:field>
> Cocoon will not accept this as a valid forms definition, when trying  
> to access the form via the browser.

I still can't see what's wrong with this form definition.
I use <fd:datatype base="integer"/> all the time with no problems.

You must be using this definition along with some incompatible Jx,  
Flowscript, or other binding.


Tobia

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


Re: MySQL "Year" vs CForms "Date"

Posted by Derek Hohls <DH...@csir.co.za>.
Tobia
 
In terms of code - assuming I have a MySQL "Year-type" column;

Case 1:
<fd:field id="Year">
  <fd:label>Year</fd:label>
  <fd:datatype base="date"/>
</fd:field>	

Cocoon will not accept a form entry with just a "year" value (e.g. 2007)
and flags the entry field for the user to reenter the number.

Case 2:
<fd:field id="Year">
  <fd:label>Year</fd:label>
  <fd:datatype base="integer"/>
</fd:field>	

Cocoon 	will not accept this as a valid forms definition, when trying
to access the form via the browser.

As an interim solution I have used MySQL integer column, with 4 digits
and set a min/max range to the cocoon form widget.

>>> On 2008/02/14 at 04:32, in message <D5...@linux.it>, Tobia Conforto <to...@linux.it> wrote:
Derek Hohls wrote:
> if I use MySQL "Year" column and Cocoon Forms "integer" type  
> together, then the forms validator complains that the widget is not  
> a date type.

This part I don't understand.  Are you trying to apply some sort of  
date widget or date formatting or date validation to the integer  
field?  (You shouldn't.)  What component "complains that the widget is  
not a date type"?  Does a simple integer text field work?


Tobia

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



-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: MySQL "Year" vs CForms "Date"

Posted by Tobia Conforto <to...@linux.it>.
Derek Hohls wrote:
> if I use MySQL "Year" column and Cocoon Forms "integer" type  
> together, then the forms validator complains that the widget is not  
> a date type.

This part I don't understand.  Are you trying to apply some sort of  
date widget or date formatting or date validation to the integer  
field?  (You shouldn't.)  What component "complains that the widget is  
not a date type"?  Does a simple integer text field work?


Tobia

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