Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 490
  • Last Modified:

Menu Login

Hi,

 Can anyone tell me how can i do some error checking on a login command button?
what i need to do is just check if the login is good or not.it should trigger the display of an ALERT with a message if the login information is incorrect.

Another question is, if i retreive values from the data base how can i let the radio button or a combo box change it's state to the corresponding value.
0
Dj_maj
Asked:
Dj_maj
2 Solutions
 
annamalai77Commented:
hi there

just follow the steps given. i assume that u know a bit about forms

Alert Creation.
1. create an alert (say show_message as the alert name).
2. from the alert properties type Error Message in the title row
3. Type message in the Message Row
4. Choose Note in the Alert Style
5. Type OK in the Button 1 Lable
6. Choose Button 1 in the  Default Alert Button row.
7. create a Program Unit with the same name as ur alert name ( same name as ur alert name is for convenience purpose).
8. in the program unit type the following code
PROCEDURE show_message( msg VARCHAR2 )IS
   al_id Alert;
   which_Button number;
BEGIN
   al_id := FIND_ALERT('show_message');
   CHANGE_ALERT_MESSAGE( al_id, msg );
   which_Button := SHOW_ALERT(al_id );
END;

Alert Display when wrong user.

I assume that ur username and password is stored in ur custom table.

when the user enters his login id and password and then presses the login button

in the when-button-pressed of the login button type the following code
declare
cnt number := 0;
begin
   select count(*)
   into cnt
   from <table_name>
   where loginid = ::block_name.loginid field_name>;

   if cnt = 0 then
      show_message('Invalid Login Id');
      raise form_trigger_failure;
  end if;
end;

this will display the alert show_message we have created.

regarding ur second question ie changing the value of ur radio button, u should remember one thing that is the radio button data type should be of the same data type as ur database fields data type.

once u have selected the value from database just store the value in a temporary variable as assign to the radio button value like the statement given below

SET_RADIO_BUTTON_PROPERTY
  (item_name    VARCHAR2,
   button_name  VARCHAR2,
   property     NUMBER,
   value        NUMBER);

where item_name is the radio group name
button name is the radio button name
property will be LABEL
value will be the database field value;

regards
annamalai
0
 
musduCommented:
Hi,

"Another question is, if i retreive values from the data base how can i let the radio button or a combo box change it's state to the corresponding value."

just assign value to a radio group. It'll change it's state according to assigned value;

:MYBLOCK.MYRADIOGROUP := '1'; -- 1 should be one of the values of radio buttons in group

regards



0
 
Dj_majAuthor Commented:

 Thanks for the help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now