vamsidharG / openmobster

Automatically exported from code.google.com/p/openmobster
0 stars 0 forks source link

mobileBean unable to update null values in the cloud side #167

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
My mobileBean have some nullable field (user1,user2,user3,user4,user5) if some 
this field come with null value from the cloud side (from database field) is 
not posible update this with some not null value from the client (android) side.

in this case user4,user5 come null from de database 

in this case user4,user5 come null from de database 
-----------------cloud debug fragment----------------------
DEBUG - <SyncML>
<SyncHdr>
<VerDTD>1.1</VerDTD>
<VerProto>SyncML/1.1</VerProto>
<SessionID>4ec5e818-d694-4a97-ab9d-7543f1e457e8</SessionID>
<App>net.synergyca.android.app</App>
<Source>
<LocURI>IMEI:9774d56d682e549cunknownsdksdk</LocURI>
</Source>
<Target>
<LocURI>http://www.openmobster.org/server</LocURI>
</Target>
<MsgID>4</MsgID>
</SyncHdr>
<SyncBody>
<Status>
<CmdID>3</CmdID>
<Data>200</Data>
<MsgRef>3</MsgRef>
<CmdRef>1</CmdRef>
<Cmd>Sync</Cmd>
<TargetRef>pedidos_cliente_channel</TargetRef>
<SourceRef>pedidos_cliente_channel</SourceRef>
</Status>
<Sync>
<CmdID>1</CmdID>
<Source>
<LocURI>pedidos_cliente_channel</LocURI>
</Source>
<Target>
<LocURI>pedidos_cliente_channel</LocURI>
</Target>
<Add>
<CmdID>2</CmdID>
<Item>
<Data><![CDATA[<mobileObject>
<recordId>7DE7E095-0B3C-4894-9AC8-C2D335A354D5</recordId>
<serverRecordId>7DE7E095-0B3C-4894-9AC8-C2D335A354D5</serverRecordId>
<object>
<fields>
<field>
<uri>/cliId</uri>
<name>cliId</name>
<value>627576</value>
</field>
<field>
<uri>/ctaId</uri>
<name>ctaId</name>
<value>01</value>
</field>
<field>
.......
<field>
<uri>/user4</uri>
<name>user4</name>
<value></value>
</field>
<field>
<uri>/user5</uri>
<name>user5</name>
<value></value>
----

-------------------------  android clientScreen-------------------

private void save() 

final Activity currentActivity = Services.getInstance().getCurrentActivity();
// Get the ticket being modified
MobileBean cliente = (MobileBean) 
NavigationContext.getInstance().getAttribute(this.getId(), "cliente");
EditText comments = (EditText) 
ViewHelper.findViewById(currentActivity,"comment");
String comentario ="Static test Comment...";
String fecha = "Time is now";

cliente.setValue("user4", comentario);
cliente.setValue("user5", fecha); 

String u4=cliente.getValue("user4"); <--------- IS NULL
String u5=cliente.getValue("user5"); <-----------IS NULL

----------------------------------- debug android:  cliente value after 
setvalue ---------------------------

Original issue reported on code.google.com by openmobs...@gmail.com on 10 Mar 2013 at 4:21

GoogleCodeExporter commented 9 years ago
This issue is now fixed and available as a patch to 2.4-M2 in the Android SDK. 
It will be fixed later in 2.4-M3 for iOS SDK.

To build the patch from source here are the steps:

* svn co https://openmobster.googlecode.com/svn/branches/2.4-M2-patch167

* Go to 2.4-M2/trunk/cloud/android

* mvn install

This should build and deploy the latest jars into your local maven repository. 
Once this is done, you can write your App linking to the patched SDK.

If you do not want to build from source then download the attached patched jar 
file and install it in your local maven repository by copying the jar file to 
the following location:

.m2/repository/org/openmobster/core/mobileCloud/android/2_0/device-sdk/2.4-M2

Make sure you make a copy of the old jar file in case things don't go as 
planned and you want to revert back to the 2.4-M2 SDK

Original comment by openmobs...@gmail.com on 11 Mar 2013 at 6:48

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by openmobs...@gmail.com on 3 Jun 2013 at 7:15