#4431 how to alert

R2.5.3
closed
None
5
2007-05-31
2007-05-03
surasak_w
No

on invoice(customer) screen

i have a new column
and i want to verify some condition on it before save

if not valid i want to
1) clear value in text box
2) and pop up alert to user
3) reinput textbox
4) save again

action plan
in MInvoice.java
i used import org.compiere.apps.*;
and add verify process in beforesave function
if not valid alert will popup

problem
1)in file MInvoice.java has specify
"package org.compiere.model;"
so i used "import org.compiere.apps.*;"
it will does not exist (cannot find ADialog.class)
how to used alert

2) shold i verify in savebefore?(if not.. which file to do it)
in that function how to refernce control value in form

thank so much
-_-"

Discussion

  • surasak_w

    surasak_w - 2007-05-04
    • milestone: --> R2.5.3
     
  • surasak_w

    surasak_w - 2007-05-04

    Logged In: YES
    user_id=1784100
    Originator: YES

    i want to verify input form before proceed it
    if not valid how to something(status bar, msgbox, ..) alert user for reinput

     
  • Jorg Janke

    Jorg Janke - 2007-05-04

    Logged In: YES
    user_id=87038
    Originator: NO

    In general, you should not allow to enter invalid values - Compiere provides quite some support for that.
    Use Callout for data entry consequences - before it saves.
    In the beforeSave method, just save the error message via the logging before you return false - see numerous examples in the code.

     
  • Jorg Janke

    Jorg Janke - 2007-05-04
    • status: open --> pending
     
  • surasak_w

    surasak_w - 2007-05-08
    • status: pending --> open
     
  • surasak_w

    surasak_w - 2007-05-08

    Logged In: YES
    user_id=1784100
    Originator: YES

    if invalid value caes, i can set textbox to null in callout step
    pls give me example code in beforesave how to display error message

    thnk you

     
  • surasak_w

    surasak_w - 2007-05-14
    • assigned_to: nobody --> jjanke
     
  • surasak_w

    surasak_w - 2007-05-14

    Logged In: YES
    user_id=1784100
    Originator: YES

    i knowed about your mean
    but invalid value, i can not to told user before save
    in the case
    i 'm used a textbox ,it's not a combo
    so when user want to key 123456
    the callout process for every keypress (1, 12, 123, ...)
    invalid case textbox not set to null(follow coding) untill save button press
    (callout set to it' s self)
    if user key wrong value , user can not reinput it and record has save null aready

    in try to alert case i use command log.log(Level.SEVERE, "XXX");
    the message show in log complete but in screen appear 'could not save' user not knowed which control is wrong

     
  • surasak_w

    surasak_w - 2007-05-14

    Logged In: YES
    user_id=1784100
    Originator: YES

    in callout code how to check keypress = enter press

     
  • Jorg Janke

    Jorg Janke - 2007-05-14

    Logged In: YES
    user_id=87038
    Originator: NO

    Please check the hundreds of examples in the classes Callout*.java

     
  • Jorg Janke

    Jorg Janke - 2007-05-14
    • status: open --> pending
     
  • surasak_w

    surasak_w - 2007-05-15

    Logged In: YES
    user_id=1784100
    Originator: YES

    thank you for your support

    "Callout*.java" that you mean calloutinvoice.java, calloutorder.java, ..?
    in code i see it set log only

    can to explain different about log.log, log.warn, log.info, log.fine ..?

     
  • surasak_w

    surasak_w - 2007-05-15
    • status: pending --> open
     
  • Jorg Janke

    Jorg Janke - 2007-05-23
    • status: open --> pending
     
  • Jorg Janke

    Jorg Janke - 2007-05-23

    Logged In: YES
    user_id=87038
    Originator: NO

    Yep - I use different lig levels for the different severity/info.

     
  • SourceForge Robot

    • status: pending --> closed
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 7 days (the time period specified by
    the administrator of this Tracker).

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks