Solved

Menu Login

Posted on 2004-04-17
3
480 Views
Last Modified: 2012-08-14
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
Comment
Question by:Dj_maj
3 Comments
 
LVL 8

Accepted Solution

by:
annamalai77 earned 105 total points
Comment Utility
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
 
LVL 6

Assisted Solution

by:musdu
musdu earned 20 total points
Comment Utility
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
 

Author Comment

by:Dj_maj
Comment Utility

 Thanks for the help.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now