iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi Guys,
Looking at the attached mockup screen, is this possible with Crosslight binding? The goal of this is to provide a good user experience. While using a ListView and FormEditor to edit each item, it's not a good user experience to go back and forth from views just to modify a single or few editable values. This is relatively easy with Windows Phone or WinRT in terms of binding and batch update the list once the user clicks Done/Save and/or Back (if IsDirty is true only). But we need to this on iOS and Android as well... so, is this possible with Crosslight binding solutions? Of course, a sample for iOS and Android would be very much appreciated. Thanks!
Hi Jimmy,I create this sample for you please evaluate if this is what you want to acheive, iOS version is in progress.To check you can change the value then save, then clean task manager, open again, it will stay in that value.here is the sample:https://onedrive.live.com/download?resid=9F657B5249D6BB8D!112&authkey=!AF5-5bGuQPZ9EYo&ithint=file%2czipHope that will helps!
For iOS you can check this article about inline-editing http://developer.intersoftsolutions.com/display/crosslight/Using+iOS+UIResizableTextViewCell, you can use my current View Model.Hope that will helps!
Hi Jimmy, You need android:numeric="integer" in your Edit Text, normally it return string even you choose numeric, i don't know why maybe bug from Xamarin.Or you can put it inside a string first then parse it into integer..., if the bug still persist please do tell usHope that will helps!
Hi Jimmy,You can use converter, but from what I try you don't need to do anything in our form builder because it was already handled the numeric value.
Hi Arief,
That's what we're trying to confirm. How does the form builder handle numeric values? Can we apply the same approach when binding to a custom listview item like the one we're trying to accomplish here? Cause right now it only works on string values in which case that is not our goal in this scenario. We need to bind that text field to a nullable numeric value such as int?, decimal?, and/or double?. Here's the layout:
<EditText android:id="@+id/NewRead" android:inputType="number" android:textAppearance="?android:attr/textAppearanceMedium" android:layout_width="fill_parent" android:layout_height="match_parent" android:gravity="right" android:numeric="integer" android:singleLine="true" />
Please lemme know if there's something wrong with this layout. And here's the binding code from the BindingProvider:
p_ItemBinding.AddBinding("NewRead", BindableProperties.TextProperty, new BindingDescription("NewValue", BindingMode.TwoWay, UpdateSourceTrigger.PropertyChanged));
private int _tempQty; public int TempQty{ get{return this.Item.Qty.ToString();} set{if (_tempQty!= value){ _tempQty = value; OnPropertyChanged("TempQty"); this.Item.Qty = int.Parse(_tempQty); } } }
//In your binding please replace Qty with TempQty
Yes can confirm Jimmy here is the sample for ios, please check the view controller and tableviewcell in view, I actually don't need to override, but I still need to register the Item Binding Adapter. https://onedrive.live.com/download?resid=9F657B5249D6BB8D!115&authkey=!AKXcI9Tb9pDU3v4&ithint=file%2czipYou can use your webApi to run the samples.
Awesome! Hey Arief, I'm not sure if you noticed, that when the list is loaded the first time you set focus in a textbox for quantity (based on your samples) the keyboard popups for a split second and the focus from the textbox is lost. In return you need to click the textbox again to bring the keyboard back up. Please confirm and advise how we can fix it... Thanks!
Okay, I think this may be related to the emulator.
Glad it helps! please do inform us if there are a problem with the samples.
Hi Jimmy,Ah very sorry, I remember which bug it is, let me check the solutions.
Hi Jimmy,here is the solutions: you can simply add WindowSoftInputMode = SoftInput.AdjustPan in your activity like this:
[ImportBinding(typeof(ItemListBindingProvider))][Activity(Label = "My Inventory", LaunchMode = LaunchMode.SingleTop, Icon = "@drawable/icon", WindowSoftInputMode = SoftInput.AdjustPan)] public class ItemListActivity : ListActivity<ItemListViewModel> { }
This is actually a bug from Android as you can see here:
https://kb.xamarin.com/customer/portal/articles/1690276
Hi Jimmy,I think I don't get the scrambling value, except one issue which are sometimes when I modify the value for at least 4 items, the top item OldQty already changed into NewQty even though I not yet saved.There is the reason that I think why this happened which like what you said which in my case caused by only having 1 Qty. The best practices if you have two Field to handle NewQty and OldQty, is actually from servers.Here are my solutions it is rather crude but the logic actually very simple, I just send you three files where I change things
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname