Note that there are some explanatory texts on larger screens.

plurals
  1. PORegistration Screen datefield validation!
    text
    copied!<p>I'm writing code for RegistrationScreen (blackberry mobile app) and i am having problems with the Datefield and it's validation. This is how i get the date:</p> <pre><code> final Date currentDate = new Date(); dateField.setDate(currentDate); dateField = new DateField ("Birthday:", 567993600, DateField.DATE | DateField.FIELD_LEFT){ public void paint(Graphics g){ g.setColor(Color.WHITE); super.paint(g); } };;; </code></pre> <p>(What do i have to modify, if i see that i have too, to get date in my timezone (lisbon))? (It shows the Date in the fallowing format: 14 Aug 2011)</p> <p>Then the rest of the operations considering the datefield and all others, take place inside the <code>SubmitButton</code> <code>setChangeListener</code></p> <pre><code>SubmitButton.setChangeListener( new FieldChangeListener() { public void fieldChanged( Field arg0, int arg1 ) { //I think the fallowing step saves data as a String in bDayString String bDayString = dateField.toString(); </code></pre> <p>Now, to validate the date i have to split it into tokens, which i do invoking the method splitString:</p> <pre><code>String[] formatdate = UILib.splitString(bDayString, ""); </code></pre> <p>Is all this correct? If so, could you help me about this field validation? Creating a class, that i would store in Utilities Class and then call in the Registration screen. I think i have to take the Gregorian Calendar in consideration.</p> <p>example of validation call (but this doesn't work for blackberry)</p> <p>Check Date correctness</p> <pre><code>if (!UILib.isDateValid(bDayString)) { Alert("Register Error", "Invalid date", false); return; } </code></pre> <p>Can anyone help me, please? Thank you!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload