OOPS text example Doubt
Hi ,
I am training on OOPS which one of the concept is really trouble-shooting to understand.
In the class ...CL_SEND_BCS_EXAMPLE....
There is one Method called ASYNCHRONUS.
When i am chekcing the code inside the mehtod it has written as
TRY.
RAISE EVENT IP_OPS_METHOD~RAISE_ERROR.
ENDTRY.
i KNOW raise event is just like rasing the error which can be caught by
But when i double click..there is notjhing code it is written inside that event
I just want to know why this event is used here???
Sas
Hi saslove,
sometimes it is not required to understand everything.
Method
ASYNCHRONOUS
returns
VALUE( RESULT ) TYPE OS_BOOLEAN
which is a flag that informs you if the send request of the BCS object instance is created for asynchronous (background) processing.
This
ASYNCHRONOUS
is called a functional method.
To determine the RESULT, a functional method of class
CL_SEND_REQUEST_BCS
is called: Method
GET_ASYNCHRONOUS
also returns boolean value RESULT, this is just taken from the attribute, so
result = ASYNCHRONOUS
This is the main function of the method.
The macro
state_read_access
raises event
READ_ACCESS
which is defined in interface
IF_OS_STATE
If in the class or an inherited class a handler for this event has been implemented and set for this event, this will automatically be triggered without any changes to the class.
This is what I tried to explain about the Notifier - Listener concept.
In this case to summarize: The function of Method
ASYNCHRONOUS
is just to return a flag about the processing function (SYNCHRONOUS/ASYNCHRONOUS). As a side-effect, event
READ_ACCESS
is triggered. This may be useful if any listeners are configured.
The Notifier - Listener concept is used when objects have to inform other objects about state changes: This is not hard-coded but implemented via so called loose-coupling. This allows you to exchange classes and objects freely.
[Page 44 ff - the observer pattern|http://books.google.com/books?id=LjJcCnNf92kC&printsec=frontcover&dq=designpatternshead+first&hl=de#v=onepage&q=&f=false]
is just an idea for further studies.
Regards,
Clemens
Similar Messages
-
Can someone post a quick example of an Oracle Text query?
Ben,
Thanks for the quick answer! I was teaching an APEX class and encouraging them to use the forum. I said "I bet someone answers this in an hour or less". You did it in 13 minutes! I tried to ask a question that didn't require any research, so I hope you didn't invest much time in it.
Thanks again,
Tyler
Tyler Muth
http://tylermuth.wordpress.com
"Applied Oracle Security: Developing Secure Database and Middleware Environments": http://sn.im/aos.book -
Hi ,
I am new to oracle text , i have a table which has a text data in one of the column which is been context indexed, now i want to find the frequently appearing words in that column, so i am using the ctx_doc.themes() procedure to achieve it.
I have created a result table 'ctx_themes' which has query_id,themes,weight columns which will get populated after executing the ctx_doc.themes() proc, but i am facing the below error after executing the ctx_doc.themes() proc, so please help me in fixing the issue.
Error starting at line 1 in command:
begin
ctx_doc.themes('text_data_index','e_id','CTX_THEMES',1,full_themes => FALSE,num_themes=>20);
end;
Error report:
ORA-20000: Oracle Text error:
DRG-11445: rowid value is invalid: e_id
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.CTX_DOC", line 210
ORA-06512: at line 2
20000. 00000 - "%s"
*Cause: The stored procedure 'raise_application_error'
was called which causes this error to be generated.
*Action: Correct the problem as described in the error message or contact
the application administrator or DBA for more information.
Thank You.This is meant well: I wouldn't bother posting Oracle Text questions here. It's a specialised area, and not a lot of standard, general DBAs will know much about it. If you click the 'Database' link above, however, and scroll down quite a long way, you'll find a specific Forum for such queries, called 'Text'. Some geniuses in there (Barbara, especially) are extremely knowledgeable on this sort of topic.
-
According to msdn , When dealing with Unicode string constants in SQL Server 2005, you must precede all Unicode strings with a capital letter N. The N prefix stands for National Language in the SQL-92 standard, and must be uppercase. If the N prefix is not used, SQL Server uses the non-Unicode code page of the current database before it uses the string. The following example shows how to use the N prefix in code:
UPDATE TableName SET ColumnName = N'Arabic Text' WHERE id = 1000 INSERT INTO TableName (ColumnName) values(N'Arabic Text')My doubt is, this works fine when we are hardcoding the string, but how i can prefix my string variable with N?
My sample code looks like this:
sql = "insert into static_String1 values (?)";
PreparedStatement statement=connection.prepareStatement(sql);
statement.setString(1,statString); //statString is my string variable
statement.executeUpdate();
statement.close();agreed to each and every point of yours... May be my inability to find the error in the original string drove me to look for alternate solutions.
This is how I am getting my string variable
String fileString = files.toString();
InputStream f = new FileInputStream(fileString);
byte[] b = new byte[fileString.length()];
while(!(f.read(b)== -1))
String str = new String(b);
toProcess = toProcess + str;
b = new byte[fileString.length()];
}I cant understand what might be wrong in this.
I tried using BufferedReader as wellString fileString = files[i].toString();
inputStream = new BufferedReader (new FileReader(fileString));
String str ;
while ((str = inputStream.readLine())!=null){
statString=statString+str;
}Still, no use. -
Significance of Long and short text Objects
Hi all,
I want to know the difference between Long and short texts and scenarios in which long texts are better to use than short texts.long text used for more than 256 character store in db.
long text example,
mm01 t_code sales inform
to save the long text call function `save_text`.
short text.
field Description -
How to edit text in the yellow text box of a URL-link?
Hey guys!
I´m currently working on a website in Iweb.
My current challenge is the following:
- I´ve made a marked text a hyperlink. But when I rollover it, a yellow text box appears and shows the entire URL.
Now, I want it to show a custom edit text.
example:
the link is: www.domainpage.com/home/subfolder/page1234/sweet.html.
the yellow text box SHOULD SAY (example):
"Sweet" tattoo
How do I rename the text in the yellow box?This is a screenshot of what text boxes affect the page title.
If you can't change the necessary text box to reflect the title you want you can add the title via an HTML snippet and the following code:
<script type='text/javascript'>
parent.document.title = "PAGE NAME TO SHOW IN BROWSER TAB/BAR";
</script>
Apply the code via snippet to each page you want to change the name to.
OT -
HTML instead of text for the worksetItems of the SAPUI5 Shell
How to put HTML for the worksetItems?
Now, it is only text (example with the dashboard title):
worksetItems: [new sap.ui.ux3.NavigationItem("WI_home",{key:"wi_home",text:"Dashboard"}),
Do you know how to put HTML instead of text?
I need it to to put an image next to the title with the font :
<span class="icon-statistics"></span>
VincentHi Vincent,
worksetItems accepts only aggrgetion of type sap.ui.ux3.NavigationItem[]
css could be applied for the id of the worksetITem
like
<style>
#WI_home {
background-color: green;
</style>
an example
JS Bin - Collaborative JavaScript Debugging</title> <link rel="icon" href="http://static.jsbin.…
Thanks and Regards, Venkatesh -
Problem removing html tags from the text retrived
Hi there,
I am using jdbc to connect the database and retriving the data. In one of the columns along with the description there are some html tags in few of the recors of that column. is there a way to retrive the text only ignoring the html tags in between. Or can i retrive and then strip off the html code in the text to display only normal text.
example of the data retrived which are pipe seperated and one of the columns has html tags in it:
209|The euphoria |187945-2|http://www.abc/lst.jsp?mktgChannel=I86023&sku=18791-2&siteID=qpF0HYnRugA|http://www.abc.com/assets/images/product/medium/18793-2_198.jpg|Rooftop Singers: Walk Right In | abc Music proudly presents THE FOLK YEARS, an unforgettable era in music history!<BR><BR><B>Featuring:</B><BR>
<LI>The most complete collection of folk and folk-rock songs ever put together -- 132 classics!
<LI>Original hits by the original artists!
Now i need to remove the tags before displaying this on the output. Is there a simple way to do this.
Thanks...Did you read the documentation of the trim() method,
where it describes which whitespace it removes?I believe his problem is that
"Some text here
<blah>
More text"becomes
"Some text here
More text"... and he wants ...
"Some text here
More text"So, your problem is that your regex isn't matching whitespace as well.
See the "Trimming Whitespace" section:
http://www.regular-expressions.info/examples.html -
How to get the long text into text area
Hi,
save_text is working fine .
Now I want to display the text in text area .
am using read_text fm for this and data is coming into the internal table of the function module.
how shd I display that long text into text area and that text shld appear has display mode only and how shd I make all other fields in my subscreen as display mode.
Pls guide me its urgent.
thanks,
krishnaHai.
check this.
Long Texts are stored in tables
STXH - header
STXL - details.
if you want to read the texts you can use Fun Module READ_TEXT
Any Application document Header and Item Long texts are stored in STXH table with the 4 parameters OBJECT,ID,NAME and LANG
These texts are fetched from database using READ_TEXT fun module by passing the above 4 parameters.
Double click on the text, from the text editor menu GOTO-> HEDAER
you will find the all above 4 parameters
so accordingly you have to pass to the fun module READ_TEXT to fetch the texts.
example:
Re: upload longtext from excel file
REPORT zupload_excel_to_itab.
TYPE-POOLS: truxs.
PARAMETERS: p_file TYPE rlgrap-filename.
TYPES: BEGIN OF t_datatab,
col1(30) TYPE c,
col2(30) TYPE c,
col3(30) TYPE c,
END OF t_datatab.
DATA: it_datatab type standard table of t_datatab,
wa_datatab type t_datatab.
DATA: it_raw TYPE truxs_t_text_data.
At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
*START-OF-SELECTION.
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = it_datatab[] "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
END-OF-SELECTION.
END-OF-SELECTION.
LOOP AT it_datatab INTO wa_datatab.
WRITE:/ wa_datatab-col1,
wa_datatab-col2,
wa_datatab-col3.
ENDLOOP.
refards.
sowjanya.b -
How to insert single colon xml text in the xml table
Dear Sir,
how to insert special characters like single colon text example (don't) xml text in to the xml table
please see the following example its giving me error quoted string is not ended properly
SQL> insert into ftr_ctl values (1,
2 xmltype('<po:root xmlns:po="http://www.oracle.com/FC.xsd"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://www.oracle.com/FC.xsd
5 http://www.oracle.com/FC.xsd">
6 <row>
7 <UniqueIdentifier>urn:x-gcs:def:featureType:GFDD::FT_DFDD_100565</UniqueIdentifier>
8 <AlphaCode>ZB032</AlphaCode>
9 <Name>Baseline Point</Name>
10 <Status>Submitted</Status>
11 <Definition>A location that serves as a point on, and which partially defines a segment
of, a national boundary baseline.</Definition>
12 <Description>May be monumented or unmonumented. A national boundary baseline is used fo
r defining the landward edge or margin of a nation's various contiguous zones such as the 3 and 12 n
autical mile limits and the Exclusive Economic Zone (EEZ).</Description>
13 </row>
14 </po:root>'));
ERROR:
ORA-01756: quoted string not properly terminated
how to solve single quotation like (nation's) in xml data insertion
please give me reply as soon as possible
Thanks
KabeerHi,
Use {code} tags to post formatted code on the forum.
That way, your code will be more readable for everyone, and more importantly here, everyone will be able to clearly see what's bothering you :
'sThe single quote was encoded with the character entity reference "&apos;".
The conversion is not mandatory but it happens Oracle is doing it in this case.
It shouldn't be a problem though.
If you want to extract the value afterwards, it'll come as expected :
SQL> create table ftr_ctl (id number, doc xmltype);
Table created
SQL> insert into ftr_ctl values (1,
2 xmltype('<po:root xmlns:po="http://www.oracle.com/FC.xsd"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://www.oracle.com/FC.xsd
5 http://www.oracle.com/FC.xsd">
6 <row>
7 <UniqueIdentifier>urn:x-gcs:def:featureType:GFDD::FT_DFDD_100565</UniqueIdentifier>
8 <AlphaCode>ZB032</AlphaCode>
9 <Name>Baseline Point</Name>
10 <Status>Submitted</Status>
11 <Definition>A location that serves as a point on, and which partially defines a segment of, a national boundary baseline.</Definition>
12 <Description>May be monumented or unmonumented. A national boundary baseline is used for defining the landward edge or margin of a nation''s various contiguous zones such as the 3 and 12 nautical mile limits and the Exclusive Economic Zone (EEZ).</Description>
13 <Alias xsi:nil="true"></Alias>
14 <SourceItemIdentifier>100565</SourceItemIdentifier>
15 <SourceReference>DGIWG DFDD BL 2011-1.00</SourceReference>
16 <SourceURL>https://www.dgiwg.org/FAD/fdd/view?i=100565</SourceURL>
17 </row>
18 </po:root>'));
1 row inserted
SQL> select extractvalue(doc, '/po:root/row/Description','xmlns:po="http://www.oracle.com/FC.xsd"')
2 from ftr_ctl
3 where id = 1
4 ;
EXTRACTVALUE(DOC,'/PO:ROOT/ROW/DESCRIPTION','XMLNS:PO="HTTP://WWW.ORACLE.COM/FC.
May be monumented or unmonumented. A national boundary baseline is used for defi
ning the landward edge or margin of a nation's various contiguous zones such as
the 3 and 12 nautical mile limits and the Exclusive Economic Zone (EEZ).
{code} -
MultiColumn text in JEditorPane.
I'd like to represent solution for the multi column text. It may be used in JEditorPane and JTextPane.
Opinions?
regards,
Stas
import javax.swing.*;
import javax.swing.text.*;
import view.*;
public class Application extends JFrame {
JEditorPane edit=new JEditorPane();
public Application() {
super("Multicolumn text example");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
edit.setEditorKit(new MultiColumnEditorKit());
this.getContentPane().add(new JScrollPane(edit));
this.setSize(200,200);
public static void main(String[] args) {
Application application1 = new Application();
application1.show();
class MultiColumnEditorKit extends StyledEditorKit {
ViewFactory defaultFactory=new MultiColumnFactory();
public ViewFactory getViewFactory() {
return defaultFactory;
class MultiColumnFactory implements ViewFactory {
public View create(Element elem) {
String kind = elem.getName();
if (kind != null) {
if (kind.equals(AbstractDocument.ContentElementName)) {
return new LabelView(elem);
} else if (kind.equals(AbstractDocument.ParagraphElementName)) {
return new MultiColumnParagraphView(elem);
} else if (kind.equals(AbstractDocument.SectionElementName)) {
return new MultiColumnView(elem, View.Y_AXIS);
} else if (kind.equals(StyleConstants.ComponentElementName)) {
return new ComponentView(elem);
} else if (kind.equals(StyleConstants.IconElementName)) {
return new IconView(elem);
// default to text display
return new LabelView(elem);
// root (section) view class
import java.awt.*;
import javax.swing.text.*;
public class MultiColumnView extends BoxView {
int columnWidth=100;
int columnHeight=100;
int majorTargetSpan=0;
int[] majorOffsets=null;
int[] majorSpans=null;
int minorTargetSpan=0;
int[] minorOffsets=null;
int[] minorSpans=null;
Point[] starts;
int columnCount=1;
public MultiColumnView(Element elem, int axis) {
super(elem, axis);
protected void layout(int width, int height) {
columnHeight=height;
super.layout(columnWidth,height);
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {
super.layoutMajorAxis(targetSpan,axis,offsets,spans);
majorTargetSpan=targetSpan;
majorOffsets=offsets;
majorSpans=spans;
performMultiColumnLayout();
for (int i=0; i<offsets.length; i++) {
spans=columnHeight;
offsets[i]=0;
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {
super.layoutMinorAxis(targetSpan,axis,offsets,spans);
minorTargetSpan=targetSpan;
minorOffsets=offsets;
minorSpans=spans;
performMultiColumnLayout();
for (int i=0; i<offsets.length; i++) {
View v=getView(i);
if (v instanceof MultiColumnParagraphView) {
MultiColumnParagraphView par=(MultiColumnParagraphView)v;
spans[i] = par.columnCount*columnWidth;
offsets[i]=par.columnNumber*columnWidth;
protected void performMultiColumnLayout() {
if (majorOffsets==null || minorOffsets==null || minorOffsets.length!=majorOffsets.length) {
return;
int childCount=majorOffsets.length;
int verticalStartOffset=0;
int columnNumber=0;
starts=new Point[childCount];
for (int i=0; i<childCount; i++) {
View v=getView(i);
starts[i]=new Point();
if (v instanceof MultiColumnParagraphView) {
MultiColumnParagraphView par=(MultiColumnParagraphView)v;
par.verticalStartOffset=verticalStartOffset;
par.columnWidth=columnWidth;
par.columnHeight=columnHeight;
par.columnNumber=columnNumber;
par.performMultiColumnLayout();
starts[i].y=verticalStartOffset;
starts[i].x=columnNumber*columnWidth;
verticalStartOffset=columnHeight-par.restHeight;
columnNumber+=par.columnCount-1;
columnCount = columnNumber + 1;
public float getPreferredSpan(int axis) {
if (axis==View.Y_AXIS) {
return columnHeight;
else {
return columnWidth*columnCount;
public float getMinimumSpan(int axis) {
if (axis==View.Y_AXIS) {
return columnHeight;
else {
return columnWidth*columnCount;
public float getMaximumSpan(int axis) {
if (axis==View.Y_AXIS) {
return columnHeight;
else {
return columnWidth*columnCount;
public int viewToModel(float x, float y, Shape a, Position.Bias[] bias) {
//define child container
if (starts!=null) {
for (int i=starts.length-1; i>0; i--) {
if ((starts[i].x<x && starts[i].y<y)
|| (starts[i].x+columnWidth<x)
return getView(i).viewToModel(x,y,a,bias);
return getView(0).viewToModel(x,y,a,bias);
public void paint(Graphics g, Shape a) {
super.paint(g,a);
Rectangle r=a.getBounds();
int shift=columnWidth;
g.setColor(new Color(240,240,240));
while (shift<r.width) {
g.drawLine(r.x+shift,r.y,r.x+shift,r.y+r.height);
shift+=columnWidth;
//paragraph view class
import java.awt.*;
import javax.swing.text.*;
public class MultiColumnParagraphView extends ParagraphView {
protected int verticalStartOffset=0;
protected int columnCount=1;
protected int columnNumber=0;
protected int restHeight=0;
int[] majorOffsets=null;
int[] majorSpans=null;
int[] minorOffsets=null;
int[] minorSpans=null;
protected int columnWidth=100;
protected int columnHeight=100;
Point[] starts;
public MultiColumnParagraphView(Element elem) {
super(elem);
protected void layout(int width, int height) {
super.layout(columnWidth,0);
protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {
super.layoutMajorAxis(targetSpan,axis,offsets,spans);
majorOffsets=offsets;
majorSpans=spans;
performMultiColumnLayout();
offsets=majorOffsets;
protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {
super.layoutMinorAxis(targetSpan,axis,offsets,spans);
minorOffsets=offsets;
minorSpans=spans;
performMultiColumnLayout();
offsets=minorOffsets;
protected void performMultiColumnLayout() {
if (majorOffsets==null || minorOffsets==null || minorOffsets.length!=majorOffsets.length) {
return;
int childCount=majorOffsets.length;
int vo=verticalStartOffset;
int cc=1;
starts=new Point[childCount];
for (int i=0; i<childCount; i++) {
starts[i]=new Point();
if (vo+majorSpans[i]>columnHeight) {
cc++;
vo=0;
starts[i].y=vo;
starts[i].x=(columnNumber+cc-1)*columnWidth;
majorOffsets[i]=vo;
vo+=majorSpans[i];
restHeight=columnHeight-vo;
minorOffsets[i]=(cc-1)*columnWidth;
if (columnCount!=cc) {
columnCount = cc;
preferenceChanged(getView(0),true,true);
public float getPreferredSpan(int axis) {
if (axis==View.Y_AXIS) {
return columnHeight;
else {
return columnWidth*columnCount;
public float getMinimumSpan(int axis) {
if (axis==View.Y_AXIS) {
return columnHeight;
else {
return columnWidth*columnCount;
public float getMaximumSpan(int axis) {
if (axis==View.Y_AXIS) {
return columnHeight;
else {
return columnWidth*columnCount;
public int viewToModel(float x, float y, Shape a, Position.Bias[] bias) {
int ind=getViewIndexAtPoint((int)x,(int)y,a.getBounds());
View v=getViewAtPoint((int)x,(int)y,a.getBounds());
Shape childAlloc=getChildAllocation(ind,a);
return v.viewToModel(x,y,childAlloc,bias);
protected int getViewIndexAtPoint(int x, int y, Rectangle alloc) {
if (starts!=null) {
for (int i=starts.length-1; i>0; i--) {
if ((starts[i].x<x && starts[i].y<y)
|| (starts[i].x+columnWidth<x)){
return i;
return 0;
protected View getViewAtPoint(int x, int y, Rectangle alloc) {
if (starts!=null) {
for (int i=starts.length-1; i>0; i--) {
if ((starts[i].x<x && starts[i].y<y)
|| (starts[i].x+columnWidth<x)){
return getView(i);
return getView(0);
public Shape getChildAllocation(int index, Shape a) {
Rectangle r=super.getChildAllocation(index,a).getBounds();
r.x=starts[index].x+3;
r.y=starts[index].y+3;
return r;If you want to replace the existing text then just use:
setText(DAT); -
ALERT Category Lont Text (email) fomatting
I have Alert Management configured to send an email alert correctly. I need some formatting for the email and therefore I choose to edit the alert category long text using SO10 ( remembering that the Text-id is ALRT ). while editing the Alert's Long Text using SO10, I add bolding, paragraph formatting and some IF statement as I would in a sapscipt for as commands. Print Preview of the newly updated standard text ( example used ALRTFRMWRKTESTL for SAP supplied alert category ASRTFRMWRKTEST ) show the formatting looks great, but when we triger the alert and view the correponding email based on this long text, we find the formatting is lost. Is there a way to hae the formatting show in the email?
Hello,
I Think you are able to send the email with HTML tags.
You can also use the famous FM ZOUTLOOK to send email with the format you want, but you can only do it with you oulook client.
hope this helps
Gabriel -
Increase text area width by typing text in it
Hi all,
I am using a text area i have set its wordwrap property false and horozontal and vertical policy off..What i want is to increase the width or height of text area depending upon the text i am writing
if the text is going to increase more than the width of text area the width of text area should adjust itself according to that..
Take a look to the below example
text area text:-
"this is text example"
text area width:-100
now as the word wrap property is off the text will come upto this for width of 100px:-
"this is text"
The moment i press the next character to type..the text area width should increase according to that ..the width should increase side by side
Is there any event for this via which i can get this done
ThanksI extended TextArea and it works well as a standalone component, but it might not work so well if you use it as an itemRenderer, like in a DataGrid.
I created a Flex Cookbook post on the topic:
http://cookbooks.adobe.com/post_I_want_a_TextArea_that_will_act_like_a_TextInput_t-16596.h tml
If this post answers your question or helps, please mark it as such.
Greg Lafrance
www.ChikaraDev.com
Flex Development and Support Services
------------------------ DynamicWidthTextArea.as -----------------------------
package {
import flash.events.Event;
import mx.controls.TextArea;
public class DynamicWidthTextArea extends TextArea{
public function DynamicWidthTextArea(){
super();
super.horizontalScrollPolicy = "off";
super.verticalScrollPolicy = "off";
super.wordWrap = false;
this.addEventListener(Event.CHANGE, adjustWidthHandler);
private function adjustWidthHandler(event:Event):void{
if(width <= textField.textWidth + textField.getLineMetrics(0).width){
width = textField.textWidth;
validateNow();
override public function set text(val:String):void{
textField.text = val;
validateNow();
width = textField.textWidth;
validateNow();
override public function set htmlText(val:String):void{
textField.htmlText = val;
validateNow();
width = textField.textWidth;
validateNow();
override public function set width(value:Number):void{
if(textField == null){
if(width <= value){
super.width = value;
}else{
trace("width: " + width);
trace("super.maxWidth: " + super.maxWidth);
if (textField.getLineMetrics(0).width<= super.maxWidth){
trace("textField.textWidth: " + textField.textWidth);
trace("textField.getLineMetrics(0).width: " + textField.getLineMetrics(0).width);
if(width <= textField.getLineMetrics(0).width + 10){
super.width = textField.getLineMetrics(0).width + 10;
}else{
super.width = super.maxWidth;
override public function get text():String{
return textField.text;
override public function get htmlText():String{
return textField.htmlText;
override public function set maxWidth(value:Number):void{
super.maxWidth = value;
--------------------- Test.mxml --------------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:comp="*">
<mx:HBox>
<mx:Label text="Font size 8: "/>
<comp:DynamicWidthTextArea width="100" fontSize="8"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="Font size 10: "/>
<comp:DynamicWidthTextArea width="100" fontSize="10"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="Font size 12: "/>
<comp:DynamicWidthTextArea width="100" fontSize="12"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="Font size 20: "/>
<comp:DynamicWidthTextArea width="100" fontSize="20"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="Font size 40: "/>
<comp:DynamicWidthTextArea width="100" height="100" fontSize="40"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="Font size 100: "/>
<comp:DynamicWidthTextArea width="200" height="120" fontSize="100"/>
</mx:HBox>
</mx:Application> -
Text Align ignores whitespaces
Hi.
I have a problem with text align in text field.
Let's say that I have a text field with htmlText:
"Text example "
- when I set align for this text field like this:
var _format:TextFormat = new TextFormat();
_format.align= TextFormatAlign.CENTER;
text_field.setTextFormat(_format);
- it ignores whitespaces at the end of the line.
Same thing for TextFormatAlign.RIGHT.
Can I change this behavior using new text layout framework?I don't think you can. TLF ignores trailing spaces when aligning text as well. And the decisions for where a glyph appears on a line are in the Player - not our actionscript code - so there isn't a way to override this in TLF.
-
Is there a self writing text tool for iBA or do I have to use After Effects?
I am authoring a book that uses a lot of text examples—the idea is to have the examples as interactive text that self writes and highlights the important parts of each example when touched. Problem is that most self writing uses Flash so that is out and AE is horrible to use for more than one or two examples and I have thousands. Is there an easy solution or tool for iBooks Author to achive this easily?
Obviously I did not phrase the question correctly or you don't inderstand what self writing means.
The iBook is complete with all text in place. However, I want to present some example sentences as self writing sentences so that when a reader touches an example, it self writes in situ with important word or characters highlighted.
So for example, if the reader touches the sentence:
The quick brown fox jumps over the lazey dogs.
The sentence disappears for a second and self writes word by word in situ but with the (incorrect) e in lazey highlighted as
The quick brown fox jumps over the lazey dogs.
Is that clear?
And more importantly, is there a tool, plugin, etc., to achieve this easily in iBooks? I know how to do it with flash and After Effects but the many thousands of examples to process makes AE a nightmare.
Maybe you are looking for
-
CUCM 8.6.2 upgrade to CUCM 10.5
Hi, I have to upgrade a virtualized CUCM cluster (PUB, SUB1, SUB2, TFTP) version 8.6.2 SU3 to version 10.5. As per documentation this should be a direct refresh upgrade and no need of PCD to do it. Based on the documentation the main steps of the upg
-
Datagrid styling in Flashbuilder
Hey everyone, I have some issues styling a Datagrid with Flashbuilder. My problem is skinning the Datagrid. I wan't to have the Datagrid transparent, which I used to achieve by setting backgroundAlpha="0" and alternatingItemColors="{[]}" in Flexbuild
-
Profit and Loss Statement vs Budget Profit and Loss Statement
I run the P&L and the P&L Budget report for April 2010. On the P&L Report : Total Sales = R2 043 208.70 on the P&L Budget Report : Total Sales = R2 043 208.70 Budget Total Sales = R 2042 123.70 Why will there be a difference in the Budget repo
-
Good afternoon, I'm attempting to clear hard drive space and realized I have 2,000+ photos in RAW format in my iPhoto library. Is there a way that I can convert all of these to JPEGs within iPhoto 9 and delete the RAW files without having to reorgani
-
Hi, I'm with Dreamweaver 8. How can I find all the linked pages from and to a specific file ? It's easy to find broken links, but how about valid links ?