record store in j2me - java-me

I have 2 forms and the data should be stored in the record store only after filling all the fields in both the forms and if we switch from one form to another the fields in the form should contain whatever the user has entered. So how do I store the previous data and auto populate it when he switches from one form to another?

You need to indicate whether you are actually using LWUIT manually to build the form or using the GUI builder. Also the answer for 1.4 differs from the answer to 1.5.
If you are using LWUIT 1.5 just use LWUIT4IO's Storage classe's writeObject method. Create an object that implements the com.sun.lwuit.io.Externalizable interface and contains your data. You will need to register it using the LWUIT4IO Util class.
There is a sample for serializing data within the Tipster demo in LWUIT, it stores hardcoded and modified data into storage.
If you are using 1.4 just go over the RMS API. Not the most intuitive API in the world but usable for storing data.

You can get the values from RecordStore and populate that values into another Form. Look on the following article for how to read/write/update the record's into RecordStore.
J2ME record management system
Update record's in record store
RMS basics

you can have one public DataObject Class.
Now Create getter & setter public method in it and access them from anywhere in the project.

Related

extension library rest control Xpages

I am using extension library Rest controls ViewJsonservice to provide the data from Notes database, is there a easy way using same control I can provide the data from two databases, I can put the similar view from dbA to dbB
Short answer: no
Long answer:
I presume you want the data from 2 views available in a single endpoint. Either after each other (appended) or somehow merged.
You can do that using code. Check this article for basic info.
In a nutshell: use the ViewNavigator class in both databases to retrieve results and append or merge the data before you return it.
Nice side effect : you can return all the data.

xpages Value picker multiple databaseNames

Is it possible inside a <xe:valuePicker> to declare 2 daatabaseNames ?
I want to concatenate 2 views from 2 different databases and letting the user having the right to select more than one value.
For the first view, I do want all the entries listed.
For the 2nd view, I'd want to grab the entries like:
#Unique(#DbLookup("server!!my.nsf", "vwNumeCP", hehe, 2));
where
var hehe = docProiect.getItemValueString("Comp");
You could use a beanValuePicker data provider, and pull in the data from the two different databases in your managed bean, if you are comfortable working in java. Create a Java class that implements IValuePickerData. See here and here for info on creating a managed bean data provider.
Or you may be able to use a simpleValuePicker data provider, and in the valueList property use SSJS to pull the data in from your two sources.
Otherwise as a work-around/hack-around, the namePicker control has a data provider available to it called namePickerAggregator that allows you to define multiple data providers to be shown in the picker, including using data from different databases. But there's no such provider for a valuePicker. If you were willing to accept the slightly different UI that comes with a name picker versus a value picker, then use the namePickerAggregator with two dominoViewValuePicker data providers. Something like this:
<xe:namePicker id="myPicker" for="inputText1">
<xe:this.dataProvider>
<xe:namePickerAggregator>
<xe:this.dataProviders>
<xe:dominoViewNamePicker databaseName="database1.nsf" viewName="AllNames" labelColumn="Name" label="Database1"></xe:dominoViewNamePicker>
<xe:dominoViewNamePicker databaseName="database2.nsf" viewName="AllNames" labelColumn="Name" label="Database2"></xe:dominoViewNamePicker>
</xe:this.dataProviders>
</xe:namePickerAggregator>
</xe:this.dataProvider>
</xe:namePicker>
An alternative to the beanValuePicker are the mapPicker and listPicker classes that I've added XSnippets for http://openntf.org/XSnippets.nsf/snippet.xsp?id=mappicker-dataprovider-for-vaue-picker. This allows you to pass a Java List, Set or Map in as the source. I've also done a series of blog posts about it http://www.intec.co.uk/tag/selections-tutorial/
The Java classes have been incorporated into OpenNTF Domino API as native dataProviders.

MFC: is it possible to to have view with multiple documents?

Is it possible to associate a view with different documents (not simultaneously of course)?
What I want to achieve: the application can have multiple documents of the same type, that can be added during runtime, and set of suitable views, the main of which is CFormview-based. The user can choose the number of the document to show per combobox in the toolbar. The views then associate themselves with this document and update with data from it.
Is it possible to achieve with CMultiDocTemplate?
If yes, how? especially is it possible to retrieve a document by it order number?
If not I'll probably have to abstain from using the templates altogether, which of course means more coding (and more questions to friendly community), but it will do what I want it to do and not Microsoft thought I should be doing
Yes, you could but not out of the 'box'. Instead I'd recommend a different strategy. Rather than trying to attach a View to an existing CDocument derived class LOAD the Views CDocument with the information you want. That could done by adding a simple Copy method to the CDocument or you could move your actual data into a separate class then just point the CDocument to 'data' you want.
Trying to change the CDocument instance for a CView is going against the MFC grain which normally means lot of ASSERTS.

Xcode 4.3 Core Data how to make a list?

I am new to iOS development (and objective-C & Xcode 4.3) and I want to create an app with profiles for users. I understand how to use Core Data to make a table with entities and that's all fine, but I don't know how I would go about creating a model so that a user can save a list of items (ie a MutableArray).
For example I need to have a username (for the profile) and than a list of strings that are saved to his account.
Would I need to just create an table with username and string item and than just query for all tuples that contain the username. Is there a simple way to serialize an object and save it the same way it's done in java.
Thank You.
You need to create a one-to-many relationship (which makes a NSSet of "destination" objects, or if you want to keep them in the specified order, click Ordered and it will be a NSOrderedSet).
Once you have the relationship, you can add multiple items to it and access it via the set.

bind subsonic object collection to Microsoft report (rdlc)

Has anyone been able to use a SubSonic generated collection as a "business object datasource" with Microsoft report (rdlc)? I have generated the SubSonic class code but for some reason the report datasource window is not seeing the class as a potential object collection datasource.
Is there something I need to do for this to work?
Thanks in advance...vsdotnetguy
I have loaded Reporting Service reports from business objects before (loaded via NHibernate -- which isn't exact but close enough for argument sake).
Couple of key points:
1. return your objects in List, even if you are only returning one object.
2. You want FLAT business objects. You might have to go thru a DTO transformation to get that. By flat, I mean the most complex property you can have in a business object is a string and a number (int, decimal, double). If you are expecting to grab a value like this:
myObject.Customer.Name, forget it. Create a CustomerName property.
3. If you need data from multiple places try to break up your reports into subreports. You key off of the datasource key to figure out what data to return to the report.
I'll add more as I remember, it has been a few months since I've done this.
Yes I've done it, you should only need to make sure the project containing your reports references your SubSonic project (obviously :).
Sometimes I've also found that Visual Studio can get a little borked and require a restart before repopulating the datasource window with SubSonic generated objects.
Thx Chris and Adam,
Here is the answer I found.
In my case I wanted to dynamically set the main and subreport datasources at run time using the SubSonic object collections. However, I also wanted to design the report layout using drag and drop of the datasource columns.
But I was unable to design the report using drag&drop because none of my SubSonic collections were showing up in the Website Data Sources.
However, later while I was doing some control binding using the ObjectDataSource control, I noticed that NOW my SubSonic collections were showing up in the Website DataSources window and I could drag and drop the report layout.
So if you are dynamically setting the report datasources at run time and ARE NOT using the ObjectDataSource control already in your project, you MUST add a dummy ObjectDataSource control to one of your aspx pages. This will then make the business object datasources show up in the report designer.

Resources