[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Menu Login

Posted on 2004-04-17
3
Medium Priority
?
488 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 420 total points
ID: 10848291
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 80 total points
ID: 10848563
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
ID: 10849044

 Thanks for the help.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

831 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