Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX contractor : Booking a record

 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Instead of making the JTable's "booked by" field editable, I am planning to show modal DialogBox when user clicks on the button 'book', to take 'user id' from user. I dont like the way editing happens in JTable. (cause users need to get out of that cell after entering value, to make the change effective, which is not really user friendly, as it increases the key stroke or mouse movement)
Does this sound ok? (although I am not sure at this point how to do this)
Thanks,
Manoj
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Manoj,
I dont like the way editing happens in JTable

Agreed.
I am planning to show modal DialogBox when user clicks on the button 'book', to take 'user id' from user.

Sound Ok, but I do it in a separate JTextField. I don't like scaring a user with too many dialogs.
Best,
Vlad
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like using a modal dialog for this too. You can populate the customer ID with the last value used, and make "OK" the default button, so if the user is making multiple bookings for the same customer all they have to do is hit enter. You could also use a JComboBox to have a list of recently-used values. In either case though the fields certainly needs to be editable, since the customer ID may very well be one that has not appeared yet in the DB.
 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vlad, Jim,
Two Points:
1st for Vlad: How are you doing it in a seperate text field? I think it is not pop up window thing? right? Have you put it in cell of Jtable? I am not sure if this can be done. Or is it placed somewhere on the mainwindow and you put focus on it, once user want to book the record?
I am asking this, cause I guess I am ending up popping to many dialog boxes, which may not be appriciated
2nd is for Jim:
As per your answer, it seems that you can book the already booked record. (multiple booking) But as per my assignment if there is any value in this field, the record can not be booked. It reads as
owner: The id value (an 8 digit number) of the customer who has booked this. Note that for this application, you should assume that customers and CSRs know their customer ids. The system you are writing does not interact with these numbers, rather it simply records them. If this field is all blanks, the record is available for sale.
Just want to make sure that I have not misunderstood or missed something.
Thanks,
Manoj
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per your answer, it seems that you can book the already booked record. (multiple booking) But as per my assignment if there is any value in this field, the record can not be booked.
I have the same restriction. But what I meant was, if the customer has jst booked record number 27 to client 12345687, and then they want to book record number 43, I assume there's a good chance they want to book it to the same customer, so I supply the last value of 12345678 as the defult value. This makes sense if the users are customer service reps dealing with one customer at a time, and that one customer may need to book more than one contractor at a time. Which is not unusual IMO - many types of home improvement will require several different types of contractor.
You can also facilitate multiple bookings to the same customer by allowing the user to select multiple items before they press "Book". Then you pop up a single dialog asking what customer ID to use for all the selected records, and when they hit "OK" you can book each record with the same ID. The only complication is this may lead to different errors for different records in some cases, and it may be a bit confusing to show this to the user.
 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jim,
I really liked your idea of showing the number used to book the previous record. I will try to do the same in my app. It is kind of more user firendly.
But I am not allowing multiple row selections for booking. And you are right about it as it will be difficult to show the error message for each of them (in case of exception)
And more issues I need to know about.
1. Are you editing the customer number (should be numeric) just at the time when user enters in the diaglog box?
2. In case are you showing another dialog box if it is invalid entry?
3. Are you using customized dialog box? I looked at the code available at Sun's site (DialogDemo.java) and the code is too long for that.
Manoj
[ September 25, 2003: Message edited by: Jmannu gundawar ]
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you are right about it as it will be difficult to show the error message for each of them (in case of exception)
The way I resolved this is, after user enters customer ID (or accepts default) and hits "OK":
  • Get list of all selected rows
  • Clear all selections from table
  • for each row in list: (a) attempt to book row, and (b) if error, highlight that row only, save row number in a list of errored rows, and display error message pertaining to that row
  • Highligh any & all errored rows from previous step


  • Seems to be clear enough visually, and it only took a little more code, but I had to think about it.
    And more issues I need to know about.
    1. Are you editing the customer number (should be numeric) just at the time when user enters in the diaglog box?

    Yes, this is the only way the user can enter a customer ID.
    2. In case are you showing another dialog box if it is invalid entry?
    Yes, it was easiest to use a JOptionPane.showInputDialog(), followed by an error message if the input was invalid. I suppose I could make a component using a formatted text field for a slightly nicer user experience here, to eliminate the separate message...
    3. Are you using customized dialog box? I looked at the code available at Sun's site (DialogDemo.java) and the code is too long for that.
    I use customized dialogs elsewhere, but not here, yet. That may be one of the last changes I make before submitting - thanks for the reminder.
    [ September 25, 2003: Message edited by: Jim Yingst ]
     
    Vlad Rabkin
    Ranch Hand
    Posts: 555
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Manoj,
    1st for Vlad: How are you doing it in a seperate text field? I think it is not pop up window thing? right? Have you put it in cell of Jtable?


    I have a separate component for booking a record. I have actionally 4 components:
    JTable for search results, Log, Search component (contains JTextFields to enter search criteria and search controls, Book component containing JTextField for Customer ID and Book JButton.
    So, you see customer ids in Jtable as all others fields of the record, but all fields in JTable are not editable and customer ID JTextField in Book component:

    A - JTable
    B - Search Component
    C - Book Component
    D - Log Component
    Best,
    Vlad
     
    Manoj Gundawar
    Ranch Hand
    Posts: 169
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks Jim for the details reply, and Vlad too.
    Jim I guess you are doing lot more than what is asked for. That's great .
    Vlad, that is really creative design. I never thought of that. But I did not find any componenet to add the new record. I am sure it is there, but it just did not come on the list.
    Manoj
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic