Typing notes in a form [message #545876] |
Fri, 02 March 2012 23:08 |
|
7anona
Messages: 72 Registered: February 2012
|
Member |
|
|
Hello every one,
I need some help in how to insert notes in my form. i defined the column as varchar2(1000) and when running the form and typing, the typing stops at some point and I can't insert additional letter. I set multi-line to yes in the property Platte and tried the two wrap style but there was no obvious change.
I hope someone would respond as soon as possible
thanks in advance
|
|
|
Re: Typing notes in a form [message #545891 is a reply to message #545876] |
Sat, 03 March 2012 05:24 |
|
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
what your trying to do are you typing in a text field or your calling notes from external resources like text documents or .doc etc first u need to know as below
some of my notes on text-data types...
VARCHAR2(size) - Variable-length character string; max of 4000 bytes (or ~4K characters)
NVARCHAR2(size) - Variable-length character string; max of 4000 bytes (or 4K characters)
LONG - Character data of variable length up to 2 gigabytes, but only one per database (?)
LONG RAW - Raw binary data of variable length up to 2 gigabytes
CHAR(size) Fixed length character data ; maximum size is 2000 bytes.
NCHAR(size) Fixed-length character data; maximum size is 2000 bytes.
CLOBs - character large object
BLOBs - A binary large object
Reply With Quote
[Updated on: Sat, 03 March 2012 05:25] Report message to a moderator
|
|
|
Re: Typing notes in a form [message #545904 is a reply to message #545891] |
Sat, 03 March 2012 07:29 |
|
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
now dear here is your solution enjoy
Multi-line Text-Item in an Oracle Form. There is no built-in method to determining how many character.
The Oracle Forms source code demonstrates
how to add a Forms widget to display a running total of the number of characters a user has typed into a Multi-line Text-Item. As a user types, the counter display will update every 2 seconds to show how many characters are remaining. For
example:Remaining: 728 of 1000 characters
1.Open Forms Builder and log into any database.
2.Open Create a new forms module.
3.Create a new Canvas and set the following properties in the
Property Palette:
a.Name: MLINE_COUNTER or leave at default name
b.Width: 380
c.Height: 250
4.Create a new "Non-Base table" data block (do not use the Data Block Wizard to create the block) and change the following block properties in the Property Palette:
a.Name: MLINE_COUNTER or leave at default name
b.Database Data Block: No
c.Query Data Source Type: None
Add three Text-Items to the MLINE_COUNTER block and change the following item properties:
a. ITEM1
i. Name: MLINE_TEXT
ii. Multi-line: Yes
iii. Maximum Length:500
iv. Database Item: No
v. Visible: Yes
vi. Canvas: MLINE_COUNTER
vii. X Position: 35
viii. Y Position: 19
ix. Width: 310
x. Height: 127
xi. Show Vertical Scroll Bar: Yes
b. ITEM2
i. Name:DSP_TEXT_COUNT
ii. Item Type: Display Item
iii. Maximum Length: 100
iv. Database Item:No
v. Visible: Yes
vi. Canvas: MLINE_COUNTER
vii. X Position: 96
viii.Y Position: 150
ix. Width: 188
x. Height: 14
xi. Bevel: None
c. ITEM3
(This item is not required, but was used during development to prove the concept. You can skip this step if you want.)
i. Name: BTN_COUNT_TEXT
ii. Item Type: Push Button
iii. Label: Count
iv. Canvas: MLINE_COUNTER
v. X Position: 156
vi. Y Position: 174
vii. Width: 68
viii.Height: 166.
Now we will add three Program Units to encapsulate the code for the counting process. Again, it is assumed that you familiar enough with Oracle Forms to add a program unit to the Program Units node in the Object Navigator.
FUNCTION get_item_count_f (p_block_item VARCHAR2) RETURN VARCHAR2 IS
nCount NUMBER := 0;
nItmSize NUMBER := 0;
nRemaining NUMBER := 0;
vRetVal VARCHAR2(100);
BEGIN
nItmSize := Get_Item_Property(p_block_item, MAX_LENGTH);
nCount := length(NAME_IN(p_block_item));
nRemaining := nItmSize - nvl(nCount,0);
vRetVal := 'Remaining: '||nRemaining||' of '||nItmSize;
RETURN vRetVal;
END;
--------------------
PACKAGE MyTimer IS
tID TIMER;
v_block_item VARCHAR2(61);
PROCEDURE SET_TIMER (p_item VARCHAR2);
PROCEDURE DEL_TIMER (p_item VARCHAR2);
END;
----------------------
PACKAGE BODY MyTimer IS
-- The value passed to this procedure should be the value of
-- :SYSTEM.CURSOR_ITEM (if Forms version 6i, use
-- :SYSTEM.CURRENT_ITEM)
PROCEDURE SET_TIMER (p_item VARCHAR2) AS
BEGIN
IF ( p_item = v_block_item ) THEN
-- tID is a Package level Variable
tID := Create_Timer('MLINE_TEXT',1000,REPEAT);
-- These ELSIF statements are here only to demonstrate
-- how you can extend this procedure to support multiple items
-- in a Form that you use this method on. They can be excluded
-- if you do not want to include them.
ELSIF ( p_item = 'BLOCK2.Item2' ) THEN
tID := Create_Timer('ITEM2',1000,REPEAT);
ELSIF ( p_item = 'BLOCK2.Item3' ) THEN
tID := Create_Timer('ITEM3',1000,REPEAT);
END IF;
END SET_TIMER;
PROCEDURE DEL_TIMER (p_item VARCHAR2) AS
BEGIN
IF ( p_item = v_block_item ) THEN
-- tID is a Package level Variable
Delete_Timer('MLINE_TEXT');
ELSIF ( p_item = 'BLOCK2.Item2' ) THEN
Delete_Timer('ITEM2');
ELSIF ( p_item = 'BLOCK2.Item3' ) THEN
Delete_Timer('ITEM3');
END IF;
END DEL_TIMER;
END;
---------------
Type at Form level when-timer-Expired
DECLARE
vTimer VARCHAR2(30) := Get_Application_Property(TIMER_NAME);
BEGIN
IF ( vTimer = 'COUNTER' ) THEN
:MLINE_COUNTER.DSP_TEXT_COUNT :=
get_item_count_f(:SYSTEM.CURSOR_ITEM);
END IF;
END;
cheer
If you are still dont understand then let me know i will send u a .FMB file
Thanks
[Updated on: Sat, 03 March 2012 07:50] Report message to a moderator
|
|
|
|
Re: Typing notes in a form [message #545962 is a reply to message #545961] |
Sat, 03 March 2012 14:57 |
|
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
Yes sorry to forget answer of this question specially
in property palete of text_item
Multi-Line: Yes
Data Type: Long
Maximum Length: 1000
here is example .FMB file of using space of Varchar2(1000)
Hope answered the question this time and Thanks to Mr Little foot for reminding me.
Best Regards
[Updated on: Sat, 03 March 2012 15:02] Report message to a moderator
|
|
|
|
|
|