User Profile & Activity

Jimmy Tungol Member
Page
of 13
Posted: June 3, 2015 3:56 PM
Hi,

I believe this community would be able to help you better if you can express yourself in English. I mean, looking at your post... we won't be able to understand it without using a translator of some kind. If you can translate your issue or concern in English, that would be very much appreciated. And also, if one of us run into a similar issue, we would know where to look.

Gracias!
Hi Yudi,

In relation to this topic, how can we use StringInputAttribute to bind a MaxLength to a field instead of using a pre-defined value? We need to limit the number of character inputs based on the settings of a record or a row (e.g. MaxLength field). Please advise.

Thanks!
Any news or updates about this feature or roadmap?

Clearly... there is something wrong here. Either that... or we're breaking some rules from Android's guidelines. Please take a look at MyInventory_MasterDetail that we modified. Specifically, adding a menu layout named "sold_actions.axml" and modified ItemListFragment.cs to specify MenuLayoutId. Please run the sample on Anroid Tablet for better viewing.

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/MarkSoldButton"
        android:title="@string/MarkAsSold"
        android:showAsAction="ifRoom|withText" />
</menu>

protected override int MenuLayoutId 
{
    get { return Resource.Menu.sold_actions; }
}

Please download the solution by clicking here.

Awesome! Yes, we've though about the first option you mentioned... but that's not going to work on our design, because the fields can be overridden on the client side. Looks like the second option is the way to go. And yes, we also need changes to related entities as you anticipated. We'll give it a try and see how it's going to work.

Many thanks!

Any updates on this? Well, it's almost May now... so we're kinda hoping for some updates, and that all is going well. Thanks!

Hi Leo,

Thank you for the sample. Do you have a flowchart or a document that illustrates the flow of events or delegates used by the EntityContextProvider? We need to understand how and where to put processes within these events as necessary. The sample you have given us illustrates calculations done on WebApi layer, not on the database itself. It does make sense to process calculations that way if calculations are handled on WebApi controller. However, we need to fetch calculated values after the changes have been saved to the database, not before. The reason being... there are calculations being processed ON AFTER UPDATE triggers that rely on incoming data from client side.

Okay, let's try to make things simpler. Let's forget about related entities for the time being. Take a look at the table below, with a trigger. This sample indicates that Gross and CommissionAmount are calculated via trigger. In this design, the mentioned fields can be overriden in case the actual cash is not the same with the calculated value. Be that as it may, whatever values generated for these fields should also be fetched by the EntityContextProvider on its return to the client.

USE [IntersoftSample]
GO

CREATE TABLE [dbo].[Collection](
    [CollectionId] [bigint] IDENTITY(1,1) NOT NULL PRIMARY KEY,
    [Amount] [money] NOT NULL,
    [Refund] [money] NULL,
    [Gross] [money] NULL,
    [CommissionRate] [smallint] NOT NULL,
    [CommissionAmount] [money] NULL
)
GO

CREATE TRIGGER [dbo].[PostCommission]
   ON [dbo].[Collection]
   AFTER UPDATE
AS 
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    -- Insert statements for trigger here
    IF (NOT UPDATE(Gross) AND
        NOT UPDATE(CommissionAmount))
    BEGIN
        UPDATE
            [dbo].[Collection]
        SET
            Gross = INSERTED.Amount - ISNULL(INSERTED.Refund, 0),
            CommissionAmount = (INSERTED.CommissionRate / 100.00) * (INSERTED.Amount - ISNULL(INSERTED.Refund, 0))
        FROM
            [dbo].[Collection] CO INNER JOIN
            INSERTED ON CO.CollectionId = INSERTED.CollectionId
    END
END
GO

Based on the current behavior of EntityContextProvider, is it capable of fetching the calculated values for Gross and CommissionAmount in this scenario if an update is made from client side for Amount, Refund, and/or CommissionRate? Please advise.

Thanks!

Hi Arief,

Can you confirm the same for DataListViewModelBase? The usual bindings are set, and working on iOS... except for Android. BindingProvider contains pairing of both ButtonId and Commands. The buttons are defined for Android using a menu axml, with the same IDs used with that of the iOS' view controllers. Both are sharing the same viewmodel, as intended for cross platform configurations. The only difference between the two platforms is that... on iOS we have to use RegisterViewIdentifier for the button IDs, and we don;t see how that is being used with Android except for the "this.RegisterViewIdentifier("TableView", this.ListView);" statement. I'm guessing the button IDs are registered with view identifier automatically for Android. 

Kindly test this scenario on ListFragment and DataListViewModelBase. As already mentioned, setting the return value of all CanExecute funtions to a static value of true will enable the buttons at runtime, but doesn't change states using dynamic calls. Breakpoints to CanExecute functions suggest that the functions are being called; however, regardless of the values... the buttons don't change to Enabled/Disabled states. That being said, RaiseCanExecuteChanged method are also being called for each delegate commands, but it's not helping.

The current configuration (BindingProvider, ViewModel) works on iOS, but not on Android... so it may be due to the VIEW being used.

Hi,

Any updates on this? Thanks!

Posted: April 23, 2015 8:27 AM

Gracias!

All times are GMT -5. The time now is 7:39 AM.
Previous Next