AIR App. need to read textBox text into ....
Hi there,
After several days of searching and going through my collection of Flex database files I can't seem to find anything about writing from several different textBoxes into ONE only Text file OR even writing from an Xml file into plain text with line breaks.
If anybody has any suggestions please do not hesitate to pass them on as I get now quiet frustrated to get hung out to dry on this.
What I was after are several items, but I would be happy if I could make some of these work !
I JUST HAVE WORKED OUT ALL ITEMS STATED BELOW (1 TO 3 AND 6) YET WOULD BE STILL INTERESTED TO FIND OUT MORE ABOUT THE ITEM NUMBER 4 IF THERE IS A DIRECT WAY OF READING A DATAGRID ROW INTO A TEXT FILE ???
AND IF YES WOULD IT BE POSSIBLE TO HAVE ALSO LINE BREAKS ???
My options would be:
Read out of several different textBoxes with each readout having a line break.
Possibly not with all the guff of the htmlText just plain text from the input would be fine.
Or a direct readout from Xml file into a text.txt if that would be possible.
Or a direct readout from a gatagrid row into a text.txt if that would be possible.
Saving of a file automatically as a text.txt file without asking first or any other interaction, and Saving to a specific directory folder on the desktop.
I have come up with something which started me off yet uses 'htmlText' or plain text without line breaks.
OK, here is some of the code I have with the 'htmlText' readout:
<TEXTFORMAT LEADING="2">
<P ALIGN="LEFT">
<FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">
The Text which was used in textBox ....
</FONT>
</P>
</TEXTFORMAT>
<mx:Script>
<![CDATA[
private const textFilter:FileFilter = new FileFilter("Text Files (txt, html, htm, ods)","*.txt;*.html;*.htm;*.ods;");
]]>
</mx:Script>
<mx:TextInput id="inputOne"/>
<mx:Button>
<mx:click>
var f:File = File.desktopDirectory;
f.browseForSave("Save As");
f.addEventListener(Event.SELECT, function (event:Event):void {
var stream:FileStream = new FileStream();
stream.open((event.target as File),FileMode.WRITE);
stream.writeUTFBytes(inputOne.htmlText);
stream.close();
</mx:click>
</mx:Button>
Thanks kglad.com. I will try this and see if it works. Can you check my code a bit to see if it's right?
var continueFile:File = new File(File.applicationStorageDirectory.resolvePath("savedgames/continueGames.txt").nativePath.toString());
Does this look right to work across all desktop OS?
Similar Messages
-
I am running an Air App I did for the desktop, from the actual installed executable already deployed in the machine (Not from Flash Pro / Flex dev. environment). For some reason the app will not read a text file stored in the same application folder unless I run my app as administrator from the OS.
When I run the app as admin, or within the development environment it works fine. Maybe this is related to some security issue? I read the adobe air documentation, and this should work...
I am using openAsync/readUTFBytes on user as shown here:
var continueGamesConnection:FileStream();
var continueFile:File = new File(File.applicationDirectory.resolvePath("continueGames.txt").nativePath.toString());
continueGamesConnection.addEventListener(Event.COMPLETE, openSavedGames);
continueGamesConnection.openAsync(continueFile, FileMode.UPDATE);
function openSavedGames(event:Event):void
continueGamesConnection.removeEventListener(Event.COMPLETE, openSavedGames);
var content:URLVariables = new URLVariables();
var loadedContent:String = new String();
loadedContent = continueGamesConnection.readUTFBytes(continueGamesConnection.bytesAvailable);
content.decode(loadedContent);
variableX = content. variableX
//etc, etc.
continueGamesConnection.close();
By the way, I have also, tried using FileMode.READ, and others, and it still gives me the same problem. Only works if ran on admin mode or from the dev. environment.
It's very frustrating, I tried reading other posts without any luck... What solutions do people use for this kind of problem?
I have seen that you can set the app to run as admin somehow, and I guess that could work. However, this should work just fine, since it doesn't seem to violate any of the security APIs of Air. Seems like an overkill. But even so, how do I do that?
You help is greatly appreciated!Thanks kglad.com. I will try this and see if it works. Can you check my code a bit to see if it's right?
var continueFile:File = new File(File.applicationStorageDirectory.resolvePath("savedgames/continueGames.txt").nativePath.toString());
Does this look right to work across all desktop OS? -
Need help reading a text file!!!!
What i need is a simple example of how to read data
from a text file into a applet
so i can put the values in the file into a array
the file will be in the same folder as the the applet
say i have a file myfile.txt with the following values written in it
5
10
15
20
i want to read them into a simple array myarray[]
for later use
everything ive tryed wont work and i havent gotten a response in the the new to java forum//set up file reader
java.io.BufferedReader in = new java.io.BufferedReader( new java.io.FileReader("myfile.txt") );
//set up vector as we dont know how many lines there are in file
java.util.Vector vect = new java.util.Vector();
//store lines in vector
while(in.ready())
vect.add( in.readLine().trim() );
//close file
in.close(); -
Need to pull LONG TEXT into Sales Invoice
Hi All,
We have a Projects and we maintain some long text for these WBSes of projects. Now we need to move them to Invoices. Is there any table where in we can store these texts and then we pull in Invoice ? We can also move to Debot Memo request and then to Invoice. How do I store TEXT as its a structure where in it gets stored.
rgds..AmeetHi,
Following are some of the tables (PRTX, PSTX, PSTXB, PSTXH) where you can find the references for PS Text in WBS Elements.
Regards
Sreekanth -
Try to print from windows to a special printer needs to read text
dear sir or madam,
I am trying to print a pdf file with greek text in it to a printer that needs to read the text and process it at some other task.
I can print from any Windows program to that special printer and if I have a document with images and text, the images are striped down and the text is shown to the output file.
When I try to print a pdf file all the text is shown as images. I can copy and paste the text with no problem why it is not printed as text???
I try to do this with the command line. Is there are other switches I could try?1: I am sorry about the inconvinience.
The reason you find a check mark on a printer icon is to indicate that its a default printer. If the fax icon has a check mark, everytime you print a fax template will come up.
SOlution: Just right click on the other icon and select it as the default printer.
2: Black lines while printing photos.
CLick on the link below and check if the solution helps you.
http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&lc=en&dlc=en&docname=c01957673
Say "Thanks" by clicking the Kudos Star in the post that helped you.
Please mark the post that solves your problem as "Accepted Solution"
(Although I am employed by HP, I am speaking for myself and not for HP) -
Cannot install AIR app in an existing folder
Hi to all, I'm trying to create a setup for my AIR application. I have an NSIS script that install all the files that the AIR app needs in the targer folder. The AIR app is copied in a temp dir and then is lauched for installation but the installer said that it cannot install the application because the target folder is existing? What can I do to remove this check?
Thanks a lot,
AndreaCorrection to above.
Can't find folders to choose to place bookmarked item into. There is no list like I had in my XP laptop. -
Copying a standard text into another text in so10
Hello Gurus,
I have an issue where i need to track offer letter,i have a standard text which is been automatically used in pb40 while generating offer letter and that is ww-offer-contract in which i need to change the code ( in textid palt )but it is read only document. i need to copy the text into another text.So that i can do the changes required in that.
If i go with Utilities-->copy from client then it is allowing me to copy but not allowing me to change into it.it is giving me the dump.Since it is asking for the permission,i went for stop protection.but still it is giving me the dump.
Any one plzz help me out with this.
Thank you all.
Edited by: BHAVANI MADIREDDY on Feb 12, 2008 12:34 PMThere is a selection screen parameter
parameters: par_bi like rfpdo1-f100buch default ' '.
Comment this and declare a variable and pass 'X' or space into that as per the requirement. -
I have a requirement where I need to insert some text into a JTextPane within its DocumentListener. I read somewhere that this is not a good practice. What would be the right way of doing this?
Basically, I'm listening to what user is typing and helping him by inserting some text automatically based on user choice.
Please provide code samples.Hmmm - not knowing anything about the document listener - maybe they were talking about some kind of loop, where you insert text and then it triggers the listener to insert text which triggers the listener to insert text.... etc.
Maybe there are some other user input listeners, such as the keyListeners which might be better?
I haven't even had a look at the JTextPane API at the moment, so I don't know what I'm talking about.
Cheers,
Rene -
Hi,
We need to get Free text into BW which has length greater than 60 characters and also display it in BEx reports..
I am aware of the 60 char length limitation..
Anyone of you out there have figured out a way top overcome this..
Ashish..Hi Ashwin/Bhanu,
Thanks for your inputs..
Somehow we are not too kneen on using documents as we need to display the text at every line level..
Just wanted to know your thoughts on the following approach..
Having the text split into fields of length 60 char and populate them into attributes of master data infoobject..
My question is ..will it be possible to concatenate these fields in the BEx Workbook somehow..If we can concatenate 2 fields I guess we will be fine..
Looking forward to your responses..
Thanks a Lot
Ashish. -
Automated insertion of text into Sales order header
Hi Guru's,
we are recently working on specific request for automated creation of sales documents.
On each sales order there is a need to update specific fields on header level with default values - no problem.
There is also need to insert specific text into Header text: "Service reendered YYYY-MM-DD" into each single order generated by this automated way.
Do you know any functionality that we can implement into our solution or any other solution which is coming to your mind?
THANK YOU!!!Hi
Please try with the following user exits.
USEREXIT_MOVE_FIELD_TO_TVCOM_H
You can use this user exit to influence text determination for header texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
USEREXIT_MOVE_FIELD_TO_TVCOM_I
You can use this user exit to influence text determination for item texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
Regards,
P Gomatheeswaran. -
How to read two text files using the Read from spreadsheet.vi and then plot it
I need to read two text files using the read from spreadsheet function and then plot these files over time.
The file with the .res extention is the RMS values (dt and df) and the second file contains the amplitude of a frequency spectrum.
I really appreciate any help..thanks
Attachments:
RMS.txt 1 KB
FREQUENCY.txt 1 KBFrom NI Example Finder:
Write to Text File.vi
Read from Text File.vi
Jean-Marc
LV2009 and LV2013
Free PDF Report with iTextSharp -
I hate to ask this because I see at least 5 posts related to this, however I cannot get any of the examples to work except one which does not apply in my case.
I am trying to read the file in KM from a MetaData Extension.
I cannot read the file using the URL class.
Doesn't SAP provide an easy way to read a file from KM?
If someone can help me out I would appreciate it. Down in the method "getAllowedValues" is where I have to read the file.
package com.hersheys.all;
import java.util.Locale;
import java.util.ResourceBundle;
import com.sap.tc.logging.Location;
import com.sapportals.portal.prt.component.IPortalComponentRequest;
import com.sapportals.wcm.service.propertyconfig.IMetaContext;
import com.sapportals.wcm.service.propertyconfig.IMetaModel;
import com.sapportals.wcm.service.propertyconfig.IMetaName;
import com.sapportals.wcm.service.propertyconfig.IMetaValue;
import com.sapportals.wcm.service.propertyconfig.IMetaValueList;
import com.sapportals.wcm.service.propertyconfig.PropertyConfigurationServiceException;
import com.sapportals.wcm.service.propertyconfig.metadataextension.IDynamicValues;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import com.sap.security.api.IUser;
import com.sap.security.api.UMFactory;
import com.sap.security.api.umap.IUserMappingData;
import com.sap.security.api.umap.NoLogonDataAvailableException;
public class DynamicMetadataProvider implements IDynamicValues
private static final Location log = Location.getLocation(DynamicMetadataProvider.class);
private IMetaModel model = null;
public DynamicMetadataProvider(IMetaModel model)
this.model = model;
* Gets a label for a property value depending on the input locale.
* @param metaValue metaValue for that a label is requested
* @param locale locale to determine the lable language
* @return label for a property value, returns null if no label can be found for the value
public String getValueLabel(IMetaValue metaValue, Locale locale) throws PropertyConfigurationServiceException
String value = metaValue.getValue();
try
value = ResourceBundle.getBundle(this.getClass().getName(), locale).getString("value.lbl."+value);
catch (Exception ex)
log.errorT("getValueLabel", ex.getMessage());
return value;
* Returns values depending on the meta name.
* @param metaName meta model information of a property
* @return list of relevant values (incl. empty list) or null if there is no value domain
public IMetaValueList getAllowedValues(IMetaName metaName) throws PropertyConfigurationServiceException
return this.getAllowedValues(metaName, null);
* Returns values depending on the meta name and the resource.
* @param metaName meta model information of a property
* @param metaContext context information
* @return list of relevant values (incl. empty list) or null if there is no value domain
public IMetaValueList getAllowedValues(IMetaName metaName, IMetaContext metaContext) throws PropertyConfigurationServiceException
IMetaValueList valueList = this.model.createEmptyMetaValueList();
//Here is where I need to read the text file and set the value to the MetaData Extension like this: valueList.add(model.createMetaValue(model, metaName, this, "string of value to add"));
* Returns a default value depending on the meta name.
* @param metaName meta model information of a property
* @return default value or null
public IMetaValue getDefaultValue(IMetaName metaName)
return this.model.createMetaValue(this.model, metaName, this, "");
* Gets a label for the property name depending on the input locale.
* @param metaName meta name for that the label is requested
* @param locale locale to determine the lable language
* @return label for a property name, returns null if no label can be found for the name
public String getPropertyLabel(IMetaName metaName, Locale locale) throws PropertyConfigurationServiceException
String value = metaName.getName();
try
value = ResourceBundle.getBundle(this.getClass().getName(), locale).getString("property.lbl."+value);
catch (Exception ex)
log.errorT("getPropertyLabel", ex.getMessage());
return value;
* Gets a description for a property depending on the input locale.
* @param metaName meta name for that the description is requested
* @param locale locale to determine the description language
* @return description for a property, returns null if no description can be found for the property
public String getPropertyDescription(IMetaName metaName, Locale locale) throws PropertyConfigurationServiceException
String value = metaName.getName();
try
value = ResourceBundle.getBundle(this.getClass().getName(), locale).getString("property.desc."+value);
catch (Exception ex)
log.errorT("getPropertyDescription", ex.getMessage());
return value;
public IMetaValue searchMetaValue(String value) throws PropertyConfigurationServiceException
return null;Here is my working code incase anyone else would like to see exactly how I did this.
public IMetaValueList getAllowedValues(IMetaName metaName, IMetaContext metaContext) throws PropertyConfigurationServiceException
IMetaValueList valueList = this.model.createEmptyMetaValueList();
try
RID rid = RID.getRID("/documents/MetaDataStore/" + metaName.getName() + ".txt");
IResourceContext rContext = metaContext.getResourceContext();
com.sapportals.wcm.repository.IResource resource;
resource = ResourceFactory.getInstance().getResource(rid, rContext);
IContent content = resource.getContent();
BufferedReader in = new BufferedReader(new InputStreamReader(content.getInputStream()));
String valuesFromFile = "";
valuesFromFile = in.readLine();
String[] values = valuesFromFile.split(";");
for(int i=0;i<values.length;i++)
valueList.add(model.createMetaValue(model, metaName, this, values<i>));
catch(Exception e)
valueList.add(model.createMetaValue(model, metaName, this, "NO_VALUE_FOUND"));
return valueList; -
Convert HTML/javascript AIR app to flex-based AIR app?
Hi all,
I've already built an AIR app using HTML/javascript that I
would like to monetize.
I would like to use O2app's E-Commerce framework, which right
now only supports Flex-created AIR apps.
My question: Is there a simple way to "convert" an
HTML/javascript AIR app to Flex 3 format? I'd rather not have to
rebuild the app from scratch in Flex 3 if I don't have to. :)
Thanks,
AlHi,
There's no simple way to convert an HTML AIR app to flex.
But it is possible to create HTML Root windows from a Flex
AIR App. By root window, I mean the same kind of window that is
launched when you launch an HTML AIR App.
For more info, look at the HTMLLoader.createRootWindow()
call. (This will be available from a Flex AIR app as well) -
Embedding swf into HTML+JS AIR app
Hi
I'm trying to embed swf into HTML+JS AIR app with no luck.
First, I created flash library with this class in default package.
package
import mx.controls.Alert;
public class Utilities
public function Utilities()
//asdfasdf
Alert.show("asdasd","");
Then I compiled the project with Flash Builder and got library.swc as result. Then I extracted swf file.
After this is added required code into my html:
<html>
<head>
<script type="text/javascript" src="AIRAliases.js"></script>
<script type="text/javascript" src="AIRIntrospector.js"></script>
<script type="text/javascript" src="jquery-1.6.2.js"></script>
<script src="library.swf" type="application/x-shockwave-flash"></script>
<script type="text/javascript">
$(document).ready(function () {
alert('loaded');
air.Introspector.logError("aaa");
var v = new runtime.Utilities();
</script>
</head>
<body>
</body>
</html>
Then after I run application, I get error that result of expression is not constructor, function etc.
Could you help me please? Thanks in advance.
Here is sample code:
http://depositfiles.com/files/jztpnlb3aNo. I mean that the Flex framework makes certain assumptions about the environment it is running in -- like having a stage to work with. The Alert function, for example, works by creating a sprite and adding it to the Flash display list. Since your embedded SWF is not on a stage, there's no way for it to work.
You can can possibly use certain non-visual parts of the framework, such as the rpc package, but I can't guarantee it. -
Is there a text to speech app that can read text books to me?
Is there a text to speech app that can read text books to me?
The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
You don't need an app for that text to speech is biult into OS X.
http://osxdaily.com/2010/03/28/how-to-make-your-mac-talk-text-to-speech/
Maybe you are looking for
-
C: drive filling up after using WebDAV ("Remote dr...
Hi, the C: drive on my E55 had very low free space at some point. I started the file manager and the memory details reported "32 MB" for "Other files". I looked around on C: using the file manager, but didn't found anything. I removed and reinstalled
-
Why do I have duplicate images in my projects
Hi, Here is the issue. I have all my pictures or files in projects because is how I organized my pictures. But I created an album to share it in the cloud, and the images that were selected to be in the album are shown twice "duplicated" in the proje
-
Hi All, How can I find the average daily growth of a database for the last one year? Database version:11.2.0.2 OS:HP-UX
-
Schedule to restart a managed server
Hi Is there anyway we can make a managed server restart on a specified day in a week. I am using the AS/400 as the backend and after we IPL the AS400 during the weekend , the application stops working. If I restart the server , it will work . So i wa
-
Can anybody spot an obvious error?
Hello I would appreciate any help with the following error message I am getting while trying to compile a file. The following shows up in DOS: C:\jdk1.3.1\bin>javac javaPost.java javaPost.java:129: cannot resolve symbol symbol : method newInputStream