Results 1 to 8 of 8

Thread: Validation messages

  1. #1
    Join Date
    Aug 2004
    Posts
    203

    Default Validation messages

    Hello,
    I have question about validation and another messages in framework
    Can I get all validation messages in application ?
    I want create special docking view (like eclipse problems) and add all
    validation errors with data:
    severity, bean name , property and message
    I will create view with table , but I don't know can I get this data ?
    If I can do it - how ?

    regards
    Haris Peco

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    335

    Default

    You could write a custom FormComponentInterceptorFactory that simply grabs the formModel casts it to ValidatingFormModel and adds a validation listener which dumps the events to your special view.

    The FormComponentInterceptorFactory would still need to return a valid FormComponentInterceptor but it could be a do nothing implementation.

    HTH

    Ollie

  3. #3
    Join Date
    Aug 2004
    Posts
    203

    Default

    Thanks,
    It work, but how I can grab formId or bean name from event.
    I have more views and errors can be from anyway

    Example screenshots : http://www.snpe.co.yu/dbform.png

    I have problem with TableFormBuilder -
    screenshot form is JPanel with BorderLayout in JScrollPane -
    form is in CENTER, toolbar NORTH and statusBar SOUTH

    Status bar change position after validation error
    screenshot before validation error http://www.snpe.co.yu/dbform1.png

    regards

  4. #4
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    335

    Default

    The ValidationEvent should provide you with the form and the property. From memory you may need to cast the constraint to PropertyConstraint to get at the property name.

    Also do you mind posting a more detailed explanation of the problem you're having with TableFormBuilder. I see the problem in your screen shots.

    Ollie

  5. #5
    Join Date
    Sep 2004
    Location
    Ghent, Belgium
    Posts
    224

    Default

    Haris,

    could you post your code? Looks very interesting.

    regards,

    Peter

  6. #6
    Join Date
    Aug 2004
    Posts
    203

    Default

    Peter,
    I can send code, but it use hibernate and may legacy database. It is unfinish, too.I want smart search functionality and then I send code.I didn't decide for hibernate session handling, yet, but I think that we have to use session for application

    Ollie,
    I grab property name easy from event (I find code from sprin rcp - monkey see monkey do),
    but I don't know how I can grab form name(id) or bean name

    TableFormBuilder problem : second screenshot I get with code like :
    protected JComponent createDbFormControl() {
    SwingFormModel formModel = getFormModel();
    TableFormBuilder formBuilder = new TableFormBuilder(
    formModel);
    //setFormReadOnly(true);
    formBuilder.addSeparator("separator.orders");
    formBuilder.row();
    getPropertyMetadataMap().clear();
    addComponent(formBuilder.add("id","colSpec=40dlu") ,"id");
    addComponent(formBuilder.add("dat","colSpec=80dlu" ),"dat");
    formBuilder.row();
    addComponent(formBuilder.add("rj","colSpec=40dlu") ,"rj");
    addComponent(formBuilder.add("orgRj.ime","colSpec= 150dlu"),"orgRj.ime",true);
    formBuilder.row();
    addComponent(formBuilder.add("zap","colSpec=40dlu" ),"zap");
    addComponent(formBuilder.add("orgZap.imeiprezime", "colSpec=150dlu"),"orgZap.imeprezime",true);
    formBuilder.row();
    addComponent(formBuilder.add("vn","colSpec=40dlu") ,"vn");
    addComponent(formBuilder.add("finVn.ime","colSpec= 150dlu"),"finVn.ime",true);
    formBuilder.row();
    addComponent(formBuilder.add("zak"),"zak");
    addComponent(formBuilder.add("ok"),"ok",true);
    return formBuilder.getForm();
    }

    addComponent is my DatabaseModel method and it isn't important - it add property metadata in model and call formBuilder.add method

    It create panel in CENTER - toolbar (NORTH) is create with spring rcp createtoolbar from CommandGroup,
    StatusBar is extend Spring StatusBar with adding row number and row status
    Error message from valiadation interceptor are added in statusbar message
    When I create view first time it is fine and it is screenscoot 2, but when first message get in status bar then I have problem on screenshoot 2

    regards

  7. #7
    Join Date
    Sep 2004
    Location
    Ghent, Belgium
    Posts
    224

    Default

    I didn't mean the code for the dbform, but for the view containing the validation errors. :lol:

    Peter

  8. #8
    Join Date
    Aug 2004
    Posts
    203

    Default

    Peter,
    This is my currently source code (directory src) : http://www.snpe./co/yu/snpe.tar.bz2
    ProblemsView use interceptor ValidationErrorInterceptor (add in context) and dump set in
    views - from event set I make list event bean Problem and add in table framework in spring jcp

    It is hard for set , yet, but You can see my idea

    regards

Similar Threads

  1. Replies: 4
    Last Post: May 12th, 2006, 02:50 AM
  2. plain error messages on form validation
    By mariuss in forum Web
    Replies: 3
    Last Post: Aug 31st, 2005, 11:37 AM
  3. order of validation messages
    By georgey in forum Swing
    Replies: 0
    Last Post: Aug 31st, 2005, 08:23 AM
  4. Displaying server-side validation messages
    By Jurijus Jarmakas in forum Swing
    Replies: 2
    Last Post: Feb 15th, 2005, 08:57 AM
  5. validation messages 2
    By snpe in forum Swing
    Replies: 0
    Last Post: Nov 10th, 2004, 11:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •