Hi Elisabeth,

>>>
The date field is just a text field with a data type of  ULCDateDataType in
a particular date format.  If you input an invalid date format or any
non-sensical value - like "48fk49tk", for example, when you tab out of the
field the value goes blank.  This is the same behaviour as the previous
version of ULC.  However, when you click back into the field to enter a new
value, the old non-sensical value comes back.  As far as I can tell, this is
new behaviour for ULC 6.1.  If there is a way to stop this from happening, I
believe we can fix the problem.
>>>>>

This was the case in 6.0.4 too. If you enter a wrong value, tab out and come
back you will see the wrong value.

>>>
We have made sure that we are actually attempting to put in the correct date
field, but the only thing that we can think is happening is that ULC is
seeing that we are trying to replace an empty date field with an empty date
field, so it is actually leaving the original date field (with its
non-sensical value) in place.
>>>

This is not the case.

I have made a small snippet (see below) to simulate your case. I could not
reproduce your problem. Can you please try it?

Also can you also send me (directly and not on dev list) the piece of code
where you are creating these date textfields and adding and removing the
rows.

Thanks and regards,

Janak

--------------------------------------------

import com.ulcjava.base.application.AbstractApplication;
import com.ulcjava.base.application.ULCBoxPane;
import com.ulcjava.base.application.ULCButton;
import com.ulcjava.base.application.ULCFrame;
import com.ulcjava.base.application.ULCTextField;
import com.ulcjava.base.application.datatype.ULCDateDataType;
import com.ulcjava.base.application.event.ActionEvent;
import com.ulcjava.base.application.event.IActionListener;
import com.ulcjava.base.development.DevelopmentRunner;

public class TestSnippet extends AbstractApplication {

        public void start() {

                final ULCBoxPane content = new ULCBoxPane(true);
        ULCDateDataType date = new ULCDateDataType("dd-mm-yy");
                final ULCTextField f1 = new ULCTextField(10);
                f1.setDataType(date);

                final ULCTextField f2 = new ULCTextField(10);
                f2.setDataType(date);

                content.set(0,0,f1);

                ULCButton b1 = new ULCButton("Add");
                b1.addActionListener(new IActionListener(){
                        public void actionPerformed(ActionEvent event) {
                                content.set(0,1,f2);
                        }
                });

                ULCButton b2 = new ULCButton("Remove");
                b2.addActionListener(new IActionListener(){
                        public void actionPerformed(ActionEvent event) {
                                content.remove(f1);
                        }
                });

                ULCBoxPane buttons = new ULCBoxPane(false);
                buttons.add(b1);
                buttons.add(b2);

                content.set(0,2,buttons);
                ULCFrame frame = new ULCFrame("TestSnippet");
                frame.setDefaultCloseOperation(ULCFrame.TERMINATE_ON_CLOSE);
                frame.add(content);
                frame.setSize(300, 300);
                frame.setVisible(true);

        }

        public static void main(String[] args) {
                DevelopmentRunner
                                .setApplicationClass(TestSnippet.class);
                DevelopmentRunner.run();
        }


}



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Kliman, Elizabeth
Sent: Wednesday, October 18, 2006 9:04 PM
To: ULC Developer List (E-mail)
Subject: [ULC-developer] Strange behaviour in textfield


Hi,
Since we upgraded to ULC 6.1 from ULC 6.0.4, we have noticed some strange
behaviour in a text field and would like to know if it is as a result of
some optimization added in ULC 6.1.
What happens is this:
We have a pane that starts out with a single row with the following data:


(checkbox)  TextField  DateField


There are two buttons at the bottom.  One will add a new row and the other
will delete the rows that are checked off.
The date field is just a text field with a data type of  ULCDateDataType in
a particular date format.  If you input an invalid date format or any
non-sensical value - like "48fk49tk", for example, when you tab out of the
field the value goes blank.  This is the same behaviour as the previous
version of ULC.  However, when you click back into the field to enter a new
value, the old non-sensical value comes back.  As far as I can tell, this is
new behaviour for ULC 6.1.  If there is a way to stop this from happening, I
believe we can fix the problem.  However, there is more to it.
Now after you've entered the non-sensical value into the date field, if you
add another row, that works just fine.  I would then modify the value in the
plain text field to make sure that we can identify the difference between
the two rows.  The table should then look like this:


(checkbox)       (empty text field)       (date field that looks empty, but
when you click into it has the value "48fk49tk" displaying)
(checkbox)       "Row Number 2"       (date field that actually is empty)


Next I would delete the first row (the one with the non-sensical value in
the date field).  The results appear as expected - the empty text field is
gone and the "Row Number 2" row is still there.  However when you click into
the date field in the remaining row, the non-sensical value from the
original first row is there:

(checkbox)       "Row Number 2"       (date field that looks empty, but when
you click into it has the value "48fk49tk" displaying)


We have made sure that we are actually attempting to put in the correct date
field, but the only thing that we can think is happening is that ULC is
seeing that we are trying to replace an empty date field with an empty date
field, so it is actually leaving the original date field (with its
non-sensical value) in place.  Perhaps ULC always did this and the only
change is that now the date field is keeping the non-sensical value?  Or
perhaps it always did keep the non-sensical value and something else has
changed.  Any clues as to what is going on here would help us out greatly.
We would especially like to know how to get that non-sensical value cleared
out of our date field completely.
Thanks.
Elizabeth Kliman, B.Sc., SCJP
Developer / Développeur
Information Technology / Technologie de l'information
Farm Credit Canada / Financement agricole Canada
1800 Hamilton Street, P.O. Box 4320
1800, rue Hamilton, C.P. 4320
Regina SK S4P 4L3
Tel/Tél. : (306) 780-3382 Fax/Télec. : (306) 780-5655
E-mail/Courriel : [EMAIL PROTECTED]
Agriculture. It's all we do. L'agriculture... notre raison d'être.
This message may contain information that is privileged, protected,
confidential or subject to copyright. Using, disclosing, copying or
distributing such information by anyone other than the intended recipient is
strictly prohibited. If you’ve received this message in error, please delete
it and notify me immediately.
Le présent courriel contient des renseignements de nature privilégiée,
protégée, confidentielle ou assujettie à des droits d’auteur. Toute
utilisation, communication, reproduction ou distribution de l’information
contenue dans ce courriel par toute personne autre que le destinataire visé
est strictement interdite. Si vous avez reçu ce courriel par erreur,
veuillez le supprimer et m’en informer immédiatement.

_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer

Reply via email to