How does text gets displayed in composer text field?

Hi,

I'm new to TB dev. I stumbled upon this problem while trying to fix bug 309=
708. I am trying to figure out how does a message gets displayed in the com=
poser window? I noticed that when I click edit on a mail in my drafts folde=
r, the text in the uncompleted mail is displayed in the composer. I want to=
 do something similar to this.

Does anyone know how does TB copy the text from the mail and display it on =
the composer window?
Is there like a textField.setText() to put the text into the composer's edi=
ting text field?
In another words, what function should i call to display some text onto the=
 text field of the composer?
Which code in comm-central should I look at for examples of code doing so?

Thanks!
Jason
0
Jason
10/20/2011 10:36:31 AM
mozilla.dev.apps.thunderbird 3464 articles. 0 followers. Post Follow

1 Replies
665 Views

Similar Articles

[PageSpeed] 38

It's a complicated thing, that involves using the nsIMsgComposeService, 
using nsIMsgCompFields and nsIMsgCompParams.

Here's a function that I wrote that sends a message.

https://github.com/protz/thunderbird-stdlib/blob/master/send.js#L223

If that function's popOut parameter is set to true, instead of sending 
the message, it will result in opening a composition window with all 
the settings you asked for, including the body, the recipients, the 
subject, the attachments, etc. All from Javascript. I believe you can 
find useful information from there.

>From a high-level point of view, what you want to do is:

let fields = Cc["@mozilla.org/messengercompose/composefields;1"]
                  .createInstance(Ci.nsIMsgCompFields);
// fill in the fields, including to, cc, subject, body
let params = Cc["@mozilla.org/messengercompose/composeparams;1"]
                  .createInstance(Ci.nsIMsgComposeParams);
// fill in the params, including format, type
params.composeFields = fields;
MailServices.compose.OpenComposeWindowWithParams(null, params);

Here's some references:
★ 
http://mxr.mozilla.org/comm-central/source/mailnews/compose/public/nsIMsgCompFields.idl
★ 
http://mxr.mozilla.org/comm-central/source/mailnews/compose/public/nsIMsgComposeParams.idl

Beware that there's various quirks that you need to take care of (watch 
out your line endings when setting the body field). These are commented 
in my code.

All in all, with the pointer I gave you, you should be able to open a 
compose window fairly easily from Javascript.

I'll gladly answer any other questions you have, since I'm very happy 
to see someone finally tackling that bug :-).

Cheers,

jonathan

On Thu 20 Oct 2011 12:36:31 PM CEST, Jason Yeo :jyeo wrote:
> Hi,
>
> I'm new to TB dev. I stumbled upon this problem while trying to fix bug 309708. I am trying to figure out how does a message gets displayed in the composer window? I noticed that when I click edit on a mail in my drafts folder, the text in the uncompleted mail is displayed in the composer. I want to do something similar to this.
>
> Does anyone know how does TB copy the text from the mail and display it on the composer window?
> Is there like a textField.setText() to put the text into the composer's editing text field?
> In another words, what function should i call to display some text onto the text field of the composer?
> Which code in comm-central should I look at for examples of code doing so?
>
> Thanks!
> Jason
> _______________________________________________
> dev-apps-thunderbird mailing list
> dev-apps-thunderbird@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-apps-thunderbird
0
Jonathan
10/20/2011 11:52:00 AM
Reply:

Similar Artilces:

Text not appearing when typing the text into text field
Name: Maadhavan Email: madhavan_t_patyahoodotcom Product: Firefox Summary: Text not appearing when typing the text into text field Comments: Text not appearing when typing the text into text field or any other field Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.9) Gecko/2009040821 Firefox/3.0.9 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

Large text fields in gridview not displaying all the text
I have a Boundfield in a gridview that is bound to a 'memo' field.  When displayed the field 'grows' to fit all the text, but it removes all carriage return/line feeds.  How can I get it to 'grow' to the needed size to accommodate all the text AND retain the carriage return/line feeds? If I go into Edit mode, the Boundfield only display about the first 25 characters.   How can I get it to 'grow' to the needed size to accommodate all the text AND retain the carriage return/line feeds?    Replace the BoundField Column w...

How to get plain text of currently displayed text
I need to get text of currently displayed page from extension. var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var mainWindow = wm.getMostRecentWindow("navigator:browser"); alert(mainWindow.getBrowser().selectedBrowser.contentDocument.getSelection().toString()) This returns only selected text. I need to get all text content but has no glue how to do this. Please help. Alex On Dec 17, 5:15=A0am, dzen <dze...@inbox.ru> wrote: > I need ...

How do I get the Text of a Text ....
That may sound confusing, but I need to get the text of a Dynamically created text object. For each row the Text objects text might be somthing different, and when I loop through all the rows, I need to see if any of them are a certain Word. When I used Getitemstring, it doesn't like it. dw_1.Describe( 'text_control.text' ) will give you the .text attribute of a text control in a datawindow. How are you getting different values for the .text attributes on different rows? Using an expression or something? -- Paul Horan[TeamSybase] VCI Springfield, MA www.v...

How to get HTML formatted text in SQL Text field
I have a SQL Server table with a colun of type "Text" that contains HTML. How can I load this HTML into some type of html control/container so it can be added to another control on my page using the syntax: ControOnPage.Controls.Add(xxx) The "xxx" is what I don't know how to create from a "Text" field type that contains HTML. Thanks. well one thing you could do is create a new literal control and add that to the page's control collection, just as you wrote, but use a literal control as the container: ControlOnPage.Controls.Add(new LiteralControl...

length or trim ? how can i get textbox.text as text that publichouse to textbox.text as text that public ?
hello friends length or trim ? how can i get textbox.text as text that publichouse to textbox.text as text that public ? second example is ..... textbox1.text is greenhouse.. i want to get green from textbox.text cheer Mark as me if my question or my answer can be helpful for you :) Hi,you can always perform a Trim to a retrieved string to delete the leading and trailing space characters. For your second example where you want to gt a part of the retrieved string you can use the SubString method of the String class.Grz, Kris. Read my blog. Handy Firefox plugins for web developers.Workar...

Text as text
Name: JohnA Boice Email: jaboiceathughesdotnet Product: Firefox Summary: Text as text Comments: You need to do as Safari does and make ALL text, including buttons, links, bookmarks, and general page text actual text so screen readers can interpret and voice the text. Until this occurs, your products are a real pain to use. And I have limited sight. What about those with less or no sight? Browser Details: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 ...

(Urgent) How Get a Text Field and put the result into a text Var
Hi All Iam trying to Get a text field value i wrote this code DECLARE @ptrval varbinary(16) DECLARE @length bigint SELECT @ptrval = TEXTPTR(Template), @length = LEN(Template) FROM #TEMPLATE READTEXT Template.#TEMPLATE @ptrval 0 @length but i need to put the result into a text var is that possible or not and if it possible any one could help me with thatWafi Mohtaseb You could return a text column as part of a result set. Are you trying to get the text back to ASP.NET?Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms ...

ASE text field to ASA text field
Hi I'm having problems populating an ASA text field with data from an ASE text field using CIS(component integration services) from ASE to link up to ASA. After running the SQL statement it appears to put NULLS in the ASA field. All other data types appear to work fine. I know you can use readtext/writetext to read/write text fields properly but it requires a size parameter. Any thoughts or suggestions would be appreciated. Here is the SQL I'm trying to run; insert asa_invt_prod_note select invt_prod_id,note_type,note,fpi_rep_status_flag,created_date,created_by,up...

Format text field and field text box in datagrid
I have a column that allows the user to edit the datagrid.  When the Edit link is clicked, only one column is editable...this works.  The problems are that:1) the text box is only 75% of the width of the column2) when i type text into the text field, the size is a lot larger than the text in other non-editable columns3) the height of the text-box is too high.In summar, how can i format the editable field?I have tried doing so, in the Propery Builder>Format and changing the settings in the 'Edit Mode Items', that does not help.  I'm trying to use the XX-Small text size....

RE: ASA text field to ASA text field
Hi Sorry the versions I was using for the problem below were. Using ASE version 11.9.2.5 Using ASA version 6.0.3.3113 I'm trying to push data from ASE text to ASA text, I also had problems pulling an ASE text field from ASA using proxy tables. I'm having problems populating an ASA text field with data from an ASE text field using CIS(component integration services) from ASE to link up to ASA. After running the SQL statement it appears to put NULLS in the ASA field. All other data types appear to work fine. I know you can use readtext/writetext to read/write...

text field with prepopulated text
I have a web form, there is an address text field, for my purpose, I only need it into this one field for street address city, state, zip. I would like to have something like street address city, state, zip in the text box when page load, but when the user click the text field, it goes blank, so the user can enter their own address. How can I do this? Thanks Hi,this can be done by prefilling it in the page_load for example and then use javascript onfocus event to clear out the value of the textbox. Another way to go is to use the Textboxwatermark extender from the ASP.NET AJAX Control ...

Pasting text from Mac apps into rich text controls pastes plain text
Name: Bob Product: Firefox Summary: Pasting text from Mac apps into rich text controls pastes plain text Comments: Using: Mac OS X 10.6 and Firefox 3.5 and 3.6 beta 1 Steps to reproduce: * Write text in Text Edit, Yojimbo, etc using rich text (e.g. font sizes, bold, italics) * Open Gmail in Firefox and compose an email * Copy and paste the text you created from the other Mac app into Firefox Observed: text is pasted in as plain text Expected: converts the rich text to appropriate rich text in the control, like Safari does This is a huge pain when e.g. writing release n...

How to print long text in text fields
I can use Multi-line Edit to enter long text into text fields in datawindows. However, when printing out in report, the field can only be printed in a single line limited by the width of the field. Is there a way to print the full text out in multiple lines? Hi Alan, I would check the Autosize Height property on the Position tab in the dw painter and also uncheck the Auto Horizontal Scroll on the Edit tab. Don't forget to Autosize Height of the detail band too! hth, Mark On 12/29/2010 10:42 AM, Alan Chow wrote: > I can use Multi-line Edit to enter long text into t...

Web resources about - How does text gets displayed in composer text field? - mozilla.dev.apps.thunderbird

Wikipedia:File copyright tags/Displayed and ranked - Wikipedia, the free encyclopedia
... images in Wikipedia. In order to more easily locate the best copyright tag for any given image, currently available copyright tags are displayed ...

Facebook to adjust calculations for total check-ins displayed on place pages
... go into effect within the next few weeks, and page owners might notice a difference in their total “were here” tally. Total check-ins are displayed ...

CSS3 : What is the best method for adding 2x images to webpages that will be displayed on the new iPad ...
Answer (1 of 14): WebKit deals in logical pixels and a device pixel ratio to render stuff. It knows nothing about the physical pixels of the ...

QuakeFeed Earthquake Map, Alerts and News - World Earthquakes Displayed on Esri Maps on the App Store ...
Get QuakeFeed Earthquake Map, Alerts and News - World Earthquakes Displayed on Esri Maps on the App Store. See screenshots and ratings, and read ...

Is this not bigotry displayed by Houston, TX 3rd grade teacher Angela Box? - YouTube
There is a controversy brewing over third grade elementary school teacher Angela Box. She teaches at Houston Independent School District (HISD) ...

Hoon’s crushed car displayed
Hoon’s crushed car displayed

Surgeon who cut away child's hip bone displayed 'unsatisfactory professional performance'
... orthopaedic surgeon who removed substantial bone from a teenage girl's misaligned hip, further destabilising it and destroying her joint, displayed ...

Wrong flag displayed before North Korea soccer match halts Games
... international incident when the North Korea women's team refused to take the field for more than an hour after the South Korean flag was displayed ...

MH17 plane fragment to be displayed by Russian museum: reports
A fragment of Malaysia Airlines flight MH17 will be put on display despite investigators seeking all debris to find out why it crashed.

Sydney siege: Flag displayed during Martin Place hostage crisis not same as that used by terrorist group ...
The flag displayed during the siege at a Sydney cafe is not the same one used by the Islamic State terrorist group.

Resources last updated: 1/4/2016 3:02:15 PM