Right-justify a field
I would like a text field to expand to the left when I type a long string into it. Right now it expands to the right. Is this possible? I tried using the paragraph controls and the anchor controls but no luck.
It is a price field that is near some other text so when a person types in a long string I need it to expand left.
Can anyone help?
Hi,
I have been trying to do something similar and with the help of Niall's wonderful resources, in particular "Expanding textfields maintaining horizontal position" - http://www.assuredynamics.com/index.php/portfolio/expanding-textfields-maintaining-horizon tal-position/ - I managed to work something out. However it only works in quirky way and I can't figure out why. Basically I have a text field that expands or contracts according to how long the entry is. I have set the text field to "Expand to fit". What I am trying to do is keep the text field on the right-hand side of the page but within the page limits of course. So when a long entry is made into the text field it should move to the left to accommodate the long entry. Here is the script I have used (JavaScript, exit event, ES3):
===================================
form1.#pageSet[0].TitlePage.DocNum::exit - (JavaScript, client)
//check to see if text field is empty. If empty do not want field to change at all.
if (this.rawValue != null)
//sets maximum width to empty to allow text field to resize when the entry is shorter than the space allowed
{this.maxW = "";
//get width of text field
var vNewWidth = xfa.layout.w(this, "mm");
//enter width of page
var vPageWidth = "203.65";
//calculate the x positions of the text field after an entry has been made
var vMeasure = vPageWidth - vNewWidth;
//set the x coordinate of the field
this.x = (vMeasure + "mm").toString();}
//resets the text field position if the entry is deleted
else {
this.x = "157.444mm";
this.w = "45.662mm"}
==================================================================
When I enter a value and exit the text field it resizes but does not reposition. If I click back in the text field and then exit it will then reposition. Why isn't this doing it all (resizing and repositioning) the first time around? What am I missing?
Thanks,
Greig
Similar Messages
-
Cursor Doesn't display in numeric right justified fields
We have an aplication that we deployed at a client. Normally the cursor blinks in the field that has focus. However, at this particular client the cursor doesn't show on numeric fields that are right justified. The user can type in the values though. Please help.
AlokHello,
Maybe you can increase the width of field.
Regards,
George
We have an aplication that we deployed at a client. Normally the cursor blinks in the field that has focus. However, at this particular client the cursor doesn't show on numeric fields that are right justified. The user can type in the values though. Please help.
Alok -
Tab delimited and Right justified fields
Hi
My requirement is to produce an output file where the line items consists of 5 fields of variable lengths and all of them are tab delimited and right justified at the same time
for eg.
ABC 123456ghtje 4567.45678 67.45678 pqr
where all the values in the first field 'ABC' and 2nd field '123456ghtje' are right justified and are tab delimited and asme is the case for '4567.45678' , '67.45678' and 'pqr'
they are all separated from each other by a tab but are not fixed lengths
How can i achieve that ? i am using File Receiver Adapter ??
Can it be done without Adapter Module ?
Thanks
Dev
Edited by: sd on Feb 22, 2010 2:25 PM
Edited by: sd on Feb 22, 2010 2:26 PM> they are all separated from each other by a tab but are not fixed lengths
When thay are not fixed length fields, why do you have to worry about left or right justification? In delimetted files, you would only have the delimitter between the fields. You do not need to fill spaces for justifying them.
VJ -
Lpad .. correct use to right justify a char field?
Hi all,
I have a column that's a char type, and I'm trying to manipulate justification within it.
SQL> create table test (test char(14));
Table created.
SQL> insert into test values (' 001234567890');
1 row created.
SQL> select * from test;
TEST
001234567890
..I have no probs making it left justified using ltrim
SQL> update test set test=ltrim(test);
1 row updated.
SQL> select * from test;
TEST
001234567890
...but when I try to right justify using lpad I can't get it to work:
SQL> update test set test=lpad(test,14,' ');
1 row updated.
SQL> select * from test;
TEST
001234567890
..this should pad the column with blanks to make the string 14 in length right?
What am I doing wrong?
Thanks !
AdamHi, Adam,
A CHAR (14) column is always 14 characters long. If you insert a shorter string, it is automatically RPADded.
If LENGTH (test) = 14, then
lpad(test,14,' ')
simply returns test. So your UPDATE statement is equivalent to
update test set test= test;
Every row will get UPDATEd, but nothing will get changed.
To have the strings left-padded, use LPAD before INSERTing, or use UPDATE wtih LPAD and TRIM, like this:
UPDATE test
SET test = LPAD ( RTRIM (test)
, 14
); -
Using Right-justified and left zero-filled condition in message mapping of
Hi,
My Interface is outbound Interface.
Suppose source field named 'MobNumber' is mapped with Target field named 'MobileNumber'.Condition is AS IS(Right-justified and left zero-filled).
How should i do this mapping?
Thanks,
SanghamitraHi Sanghamitra,
Similar question ahs been answered earlier in this thread
Re: Message Mapping using Left justified, right blank/space filled
just replace the filler variable by zero in my post
One small request, if you think your questions are being answered correctly and properly, please kindly, if possible, close down the threads. This way forum members/users who later look up for solutions to similar problem, they know for sure that the problem was finally solved, with the solutions provided in the thread.
regards
Anupam
Edited by: anupamsap on Aug 3, 2011 11:27 AM -
Cursor not right-justifying in Oracle Forms 11.1.1.6.0
Hi All,
A user notice during testing that 'cursor not right-justifying' in a field on a form. There were not such problem in the old forms enviroment 10.1.2.0.2 and clients running JInitiator 1.3.1.22. The new forms enviroment is Oracle weblogic 10.3.6, Oracle forms and report 11.1.1.6.0, using forms demo pack cursorpos.jar and demo90.jar, have try the 11g demo pack but still the same problem, any ideas?
Thanks
OlaA user notice during testing that 'cursor not right-justifying' in a field on a form.What exactly do you mean by "cursor not right-justifying"?
You will find noticable differences between the way the Oracle Jinitiiator and Oracle (Sun) Java work. Remember, the Jinitiator was based on the Sun JRE/JDK 1.3 and Forms 11g will be using either Java 1.6.0 or 1.7.0.
Craig... -
How to get search help results in RIGHT-JUSTIFIED column
I am writing a search help with search help exit. Therefore, I use a table lets say tabA. I don't need all fields of tabA but need some further fields which I fill during exit.
tabA does not have currency or number fields.
I need a currency field and use a char20 field of tabA instead. filling of this field and showing results is o.k., but of-course it is shown left-justified.
I did not find any fields of shlp-fielddescr which sounds like left/centered/right-alignment. Another try was to fill char20 field with leading '_' signs - that looked terrible and was not right-justified either, because of not fixed-size font.
Let's resume: there is no number or currency field which I can use. The shown results appear in a column of not fixed-size font.
Any other idea?Hi, I have the same problem. Did you get to resolve it? . Thanks
-
Wrting data right justified column
Hi
In my application I am using producer consumer loop architechture. In the consumer loop i am writn data from a queue to a file. I want to write data in a certain format to analyze in another program. Now when i write dat to a file it writes left justified in six columns. I want it to write to file like the one i have attached. Can somebody tell me how?
Attachments:
data.PNG 53 KBIdeally, you would just use a tab as delimiter and change the justification in the other program as needed. For example in MS word you can define how the tabs are justified.
If you want the data right justified in simple text displays (wordpad, notepad), you just need to ensure that the field width is sufficient for the widest data.
Try e.g. a format specifier of "%#15_6f' (and make sure that you use a fixed width font for display!)
Message Edited by altenbach on 10-08-2008 09:53 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
formatRight.png 15 KB -
How to do Right Justified in the mappin
Hi friends,
Can you help me to do the right justified for example 39.56- this should right side not from left. this field length is 11. infront of this 39.56 should be blank spaceses paded. how to do this
please help me
Thanks
ramidiRamidi,
Create simple UDF. Let say my input parameter name is "abc" . Write the below code in it
StringBuffer pad= new StringBuffer();
String ret_string="";
int add=0;
int trunc=0;
if(abc.length()<=11)
add =11-abc.length();
if(abc.length()>11)
ret_string =abc.substring(0,11);
else
for(int i=0;i<add;i++)
pad.append(" ");
ret_string = pad.toString()""abc;
return""ret_string"";
Hope it helps!!!
Best regards,
raj. -
Right justify AWT.TextField
Hey,
Can anybody tell me how to right justify text in an awt.texfield?
I know I need to override the paint() method using FontMetrics Class and calculate the new position.
But how does it work efficiently and how do I need to clear the field and set the Cursor etc.
(Bonus answer could be, how does it work in comparison to swing/jfc :-), are there already functions to do this?)
Thanks, Marc
I tried something like this, but it looks pretty ugly...
public class TFieldTest extends Frame{
static TextField t2;
// do something
public static void main(String args[]) {
// create Frame and App here
TextField t2 = new TextField() {
public void paint(Graphics g) {
//super.paint(g);
Font font = TFieldTest.t2.getFont();
FontMetrics fm = FieldTest.t2.getFontMetrics(font);
Dimension size = this.getSize();
int width = fm.stringWidthTFieldTest.t2.getText());
g.setFont(font);
g.drawString(TFieldTest.t2.getText(),size.width-width,fm.getAscent());
System.out.println("Overwritten Paint in TextField t2 - right justyfied");
// do more
}Well for purpose, I had 4 textfields that would show the subtotal, taxs, and grandtotal, that had to be aligned right.
So I use label, and used the Constructor Label(String text, int alignment).
ex:
Label lPrix01 = new Label ("", Label.RIGHT);
lTrans.setBounds(609,387,90,25);
Then with paint I simply drew lines, to have the effect of a textfield
g.setColor(white);
g.drawLine(609,412,699,412); //hor Label transport
g.drawLine(699,387,699,411); //Ver Label transport
g.setColor(noir);
g.drawLine(609,385,699,385); //hor Label transport
g.drawLine(608,387,608,412); //Ver Label transport -
Hi all
I had a paragraph in left alignment sap script , But in this paragraph one field I want to make right justify..
How to do this?
Plz help meHi Velter,,
I checked it well...
i have following fields to print..
ZEILE, MATNR ,CHARG, KOSTL, LGORT, MENGE ,MEINS, maktx,
and format is like:
item matrial batch costcen. sto.
mat desc. qty Un
zeile matnr charg kostl lgort
maktx menge meins
and in this format I want to display menge and meins fields in right alingment ,
Plz help me...
I gave tab like
1 cm left
4 cm right
5 cm left
in paragraph p1.
Plz help me.... -
Right justified data into internal table
**Hello Gurus,**
I have an Internal table having data
abc 10.00; 20.00 30.00
def 20.00 00.00 40.00
Total 30.00 20.00 70.00
I want to align my "Total" word to be right justified.
and if the particular column is having "00.00"; amount it should not be display.
and i want to bold the particular row only. i.e. my "Total" should be bold.
can anybody help me to resolve this problem
Thanks in adv.
KaustubhHi Kaustubh,
As Vijay said, you can specify your display conditions in ALV as the snippet shows...But, In fact u need not even populate the total field in the third row...
While creating the field catalog, just assign 'X' to the do_sum option in the field catalog...then simply pass the internal table containing the first two records in to the REUSE_ALV* FMs and the ALV would sum these columns up and show the total in standard formatting...saves you a lot of code
Eg. Lets say your fieldcatalog structure is wa_fieldcat and its table is it_fieldcat...u will need to do this while preparing the fcat...
WA_FIELDCAT-FIELDNAME = 'WA_ITAB-COL1'. --> the field u want to sum.
WA_FIELDCAT-TABNAME = 'ITAB'. --> Your Internal Table
WA_FIELDCAT-DO_SUM = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'WA_ITAB-COL2'.
WA_FIELDCAT-TABNAME = 'ITAB'.
WA_FIELDCAT-DO_SUM = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
The FM would then generate the ALV with the columns summed up at the bottom. The best part is it takes care of the currency and quantity reference too...
Hope it helps out...
Regards...Jaison -
hi All,
I am having a requirement. client wants to download a record into a .txt file. now the record is AAAASPACEBBBBBDDDD.
now the problem is DDDD is decimal value and i m converting it to character. however though now the client wants the record such as the field DDDD should be right justfied. now i can right justify if decimal value but since i have converted it to character so that i can use concatenate and write to a file on Pc, i am not able to right justify it.
can someone give me some suggestions,
thanks,
gauravHi,
Try with this code.
Data: v_string type string.
Data: v_len type i.
Data: v_int(10) type n.
Data: v_char(10) type c.
CONSTANTS c_six(6) type c value ' '.
v_string = 'Amandeep Sharma1981'.
v_len = strlen( v_string ).
v_len = v_len - 4.
v_int = v_string+v_len(4).
v_char = v_int.
v_char+0(6) = c_six.
Concatenate v_string+0(v_len) v_char into v_string.
I have taken your numerical value as 4 characters. you can modify as and how you want.
Regards,
Aman -
Hello Gurus
I would like to right-justify the column heading. How can I do this? Specifically, this refers to the Quantity field in the Items assignment block in the Opportunities Overview screen.
Regards,
SowmiyaTry using LPAD like
select lpad(object_name,30) from all_objects where rownum < 20; -
FW: Caret Location Right Justified for LI when using HTMLEditorKit
It appears that when using the HTMLEditorKit and inserting any sort of list
item (ordered list or unordered list) into a view (while in edit mode), the
caret is initially *---------| right justified with respect to the bullet
image. If the identical html is loaded all at once however the caret is *-|
left justified with respect to the bullet image. Is this a bug in
HTMLEditorKit?Sure it is. In this special case IBM's JDK does a better job (at least under Linux).
Generally I'm totally disappointed by the whole HTML package. I've been trying to implement a really primitive WYSIWIG-HTML-editor which understands <p>, <ul>, <h1> <b>, <i> and <a href>. It is a nightmare!
- Dynamically modifying the document's structure (e.g., by making a <li> out of a <p>) works more or less, but you have absolutely no control over caret movement, and different JDK's make it differently!
- The HTMLDocument inserts crude "extra-tags" (e.g., those <p-implied>'s. You never know exactly the structure of your document, and after a long debugging session you notice that the HTMLDocument was bluntly inserting yet another artificial element you did not specify. No docs at all what's going on.
- It is nearly unbelievable how complicated so simple things like
are internally modelled.
- Frankly spoken: The whole document model sucks. Has to be harmonized with XML, DOM, JDOM, and all those nice new technologies where Java does a good job (unless you need a GUI...)
If anybody has an idea to make it properly -> pls let me know
thx
Karl
Maybe you are looking for
-
BO XI 3.1 installation and Upgrade activity Steps
Hi Experts, Right now we are using BO XI R2 Version, Planning to uninstall XI R2 and do a fresh installation of BO XI 3.1 with SP3. Do I need to install the Java latest version for XI 3.1? Right now we have the following setting, j2re1.4.2_0
-
Black screen with apple tv icon and usb cable going into itunes logo
Unable to get apple tv to play--never happened before. I upgraded iTunes and still no response. I did note that airplay feature not showing in iTunes.
-
Recently i made a site intro for a good friend of mine. The short intro for her basically was a small animation using masking to make it look like her architect logo was being drawn. after her name faded in i had the logo turn into a button leading t
-
hi im getting an error saying that i have null customers (second here2 test). how do i correct this because i thought by declaring customer = new vector() this would cancel the problem * Constructor for objects of class CustomerInformation p
-
Sending Gift Cards to other countries, how does that work?