FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Dynamically set message string in SMSComposer

 
Post new topic   Reply to topic    NetBeans Forums -> Java ME Users
View previous topic :: View next topic  
Author Message
BliXem



Joined: 01 Sep 2009
Posts: 3
Location: South Africa

PostPosted: Tue Sep 01, 2009 9:02 am    Post subject: Dynamically set message string in SMSComposer Reply with quote

Hi guys,

I'm new to J2ME, so please be patient with me Smile

I'm trying to do a simple app for a friend to make life a bit easier for him. He likes to take part in a competition being run by a cellphone SP here in South Africa and it requires random codes of 9 characters to be sent via SMS to a certain number.

The basic setup of the app thus far is:

A form with a simple table containing 20 randomly generated codes.
An SMSComposer control that has the number hard coded.

When you select a code and use the Send SMS command then it opens the SMS Composer.

I get everything working except this:

With the first code you select, it adds that code as the message to the SMSComposer, but when you try it with another item, the first code is still there and I cannot for the life of me get it to replace the old code with the new one....

Any suggestions?

Thanks.
BliXem[/list]
Back to top
View user's profile Send private message
Karol Harezlak
Posted via mailing list.





PostPosted: Tue Sep 01, 2009 2:24 pm    Post subject: Dynamically set message string in SMSComposer Reply with quote

Hi,
I'm not sure if I understand. You are not able to replace first sms
message with new one? Are you experiencing problems while you are
creating application in Visual Designer or there is something wrong with
your application?

K.

BliXem wrote:
Quote:
Hi guys,



I'm new to J2ME, so please be patient with me :)



I'm trying to do a simple app for a friend to make life a bit easier for him. He likes to take part in a competition being run by a cellphone SP here in South Africa and it requires random codes of 9 characters to be sent via SMS to a certain number.



The basic setup of the app thus far is:



A form with a simple table containing 20 randomly generated codes.

An SMSComposer control that has the number hard coded.



When you select a code and use the Send SMS command then it opens the SMS Composer.



I get everything working except this:



With the first code you select, it adds that code as the message to the SMSComposer, but when you try it with another item, the first code is still there and I cannot for the life of me get it to replace the old code with the new one....



Any suggestions?



Thanks.

BliXem[/list]












--
Karol Harezlak <address-removed>
Sun Microsystems, Inc. NetBeans Mobilty/JavaFX
Back to top
BliXem



Joined: 01 Sep 2009
Posts: 3
Location: South Africa

PostPosted: Wed Sep 02, 2009 6:12 am    Post subject: Dynamically set message string in SMSComposer Reply with quote

Hi Karol,

During Runtime in the emulator, it does not replace the old message with the new one. Honestly I'm not sure how to go about doing that either. Like I said, I'm quite new to J2ME, so any guidance will be appreciated.

I'll upload the project so that you can have a better idea of what I mean. I did everything in Netbeans 6.5.1.

Thank you very much.

Regards,
BliXem



YeboMillionares.zip
 Description:

Download
 Filename:  YeboMillionares.zip
 Filesize:  211.68 KB
 Downloaded:  26 Time(s)

Back to top
View user's profile Send private message
Karol Harezlak
Posted via mailing list.





PostPosted: Thu Sep 03, 2009 10:20 am    Post subject: Dynamically set message string in SMSComposer Reply with quote

Hi,
There is nothing wrong with SMSComposer component. You have to call
method which sets new message text to the smsComposer every time you
make a selection in the table.

public void commandAction(Command command, Item item) {
// write pre-action user code here
if (item == tblCodes) {
if (command == icomSendSMS) {
if (smsComposer != null) {
SetSMSText();
}
switchDisplayable(null, getSmsComposer());
// write post-action user code here
}
}
// write post-action user code here
}

K.

BliXem wrote:
Quote:
Hi Karol,



During Runtime in the emulator, it does not replace the old message with the new one. Honestly I'm not sure how to go about doing that either. Like I said, I'm quite new to J2ME, so any guidance will be appreciated.



I'll upload the project so that you can have a better idea of what I mean. I did everything in Netbeans 6.5.1.



Thank you very much.



Regards,

BliXem




Attachments:
http://forums.netbeans.org//files/yebomillionares_121.zip









--
Karol Harezlak <address-removed>
Sun Microsystems, Inc. NetBeans Mobilty/JavaFX
Back to top
BliXem



Joined: 01 Sep 2009
Posts: 3
Location: South Africa

PostPosted: Thu Sep 03, 2009 1:42 pm    Post subject: Reply with quote

Hi Karol,

Thanks a million, that worked perfectly.

Regards,
BliXem
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java ME Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB