Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Editable List view item
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  19 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Thiago Lacerda  
View profile  
 More options Aug 10 2012, 4:41 pm
From: Thiago Lacerda <thiago...@gmail.com>
Date: Fri, 10 Aug 2012 13:41:36 -0700 (PDT)
Local: Fri, Aug 10 2012 4:41 pm
Subject: Editable List view item

Hi Andy,

Now i need to make a list of contacts and i want to make it editable from
the listview itself.
The problem is that the values which i put in the list items are not
reflecting in the bindables...
Is there any way to make it?
Thanks in advance.

Best regards

Thiago Lacerda


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Tsui  
View profile  
 More options Aug 10 2012, 10:04 pm
From: Andy Tsui <gueei....@gmail.com>
Date: Sat, 11 Aug 2012 10:04:03 +0800
Local: Fri, Aug 10 2012 10:04 pm
Subject: Re: Editable List view item

Not too understand:

> list items are not reflecting in the bindables

Can you elaborate more and/or show your vms?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thiago Lacerda Siqueira  
View profile  
 More options Aug 14 2012, 10:01 am
From: Thiago Lacerda Siqueira <thiago...@gmail.com>
Date: Tue, 14 Aug 2012 11:01:03 -0300
Local: Tues, Aug 14 2012 10:01 am
Subject: Re: Editable List view item

Hi Andy,

Excuse about  the delay in the response.
Here is the case:

I have an object that represents a person with an array of contacts:

public class BindablePerson extends Bindable<Person> {
     public final StringObservable name = new StringObservable();
    public final StringObservable socialSecurityNumber = new
StringObservable();
    public final StringObservable mainActivity = new StringObservable();
    public final StringObservable experience = new StringObservable();

    public final ArrayListObservable<BindableContactInformation> contacts =
new
ArrayListObservable<BindableContactInformation>(BindableContactInformation. class);

}

public class BindableContactInformation extends
Bindable<ContactInformation> {

    public final StringObservable description = new StringObservable();
    public final StringObservable remarks = new StringObservable();
    public final Observable<BindablePerson> person = new
Observable<BindablePerson>(BindablePerson.class);

    public BindableContactInformation(BindablePerson person) {
    this.person.set(person);
    }

}

Then i created a listview with person contacts:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:binding="http://www.gueei.com/android-binding/"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?android:attr/activatedBackgroundIndicator"
    android:baselineAligned="false"
    android:focusable="false"
    android:gravity="left|center"
    android:orientation="vertical"
    android:paddingBottom="5dp"
    android:paddingLeft="5dp"
    android:paddingTop="5dp" >

    <ListView
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:binding="http://www.gueei.com/android-binding/"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/contacts_listview"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:choiceMode="singleChoice"
        binding:itemSource="person.contacts"
        binding:itemTemplate="@layout/personedit_contact_items" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="right" >

        <Button
            android:id="@+id/button1"
            android:layout_width="200dp"
            android:layout_height="wrap_content"
            android:text="@string/add"
            binding:onClick="addContact" />
    </LinearLayout>

</LinearLayout>

And its items:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:binding="http://www.gueei.com/android-binding/"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="?android:attr/activatedBackgroundIndicator"
        android:baselineAligned="false"
        android:focusable="false"
        android:gravity="left|center"
        android:orientation="vertical"
        android:paddingBottom="5dp"
        android:paddingLeft="5dp"
        android:paddingTop="5dp" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <EditText
                android:id="@+id/contactedit_description"
                android:layout_width="0dp"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:ems="10"
                android:inputType="text"
                binding:clickable="editMode"
                binding:focusable="editMode"
                binding:text="description" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/textView1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="@string/remarks" />

            <EditText
                android:id="@+id/contactedit_remarks"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:ems="10"
                android:gravity="top"
                android:inputType="textMultiLine"
                android:lines="2"
                binding:clickable="editMode"
                binding:focusable="editMode"
                binding:text="remarks" >
            </EditText>
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="right" >

            <Button
                android:id="@+id/contactedit_btn_edit"
                style="?android:attr/buttonStyleSmall"
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:text="@string/edit"
                binding:onClick="editRecord"
                binding:visibility="NOT(editMode)" />

            <Button
                android:id="@+id/contactedit_btn_save"
                style="?android:attr/buttonStyleSmall"
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:text="@string/save"
                binding:onClick="saveRecord"
                binding:visibility="editMode" />

            <Button
                android:id="@+id/contactedit_btn_cancel"
                style="?android:attr/buttonStyleSmall"
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:text="@string/cancel"
                binding:onClick="cancel"
                binding:visibility="editMode" />

            <Button
                android:id="@+id/contactedit_btn_remove"
                style="?android:attr/buttonStyleSmall"
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:text="@string/delete"
                binding:onClick="deleteRecord"
                binding:visibility="NOT(editMode)" />
        </LinearLayout>
    </LinearLayout>

</LinearLayout>

The VM looks like:

public class PersonEditViewModel extends BaseViewModel {

public final BindablePerson person;

public final Command addContact = new Command() {
 @Override
 public void Invoke(View view, Object... args) {
BindableContactInformation contact = new BindableContactInformation(person);
 person.contacts.add(contact);

}
};

.
.
.

}

The problem is that when i make editions in a contact, the description and
remarks fields informed in contact row will not binds the alterations to
the correspondent item in contacts array of person, its fields remain as
null.

I hope I have been more clear now.
Thanks in advance.

Best regards,

Thiago Lacerda

2012/8/10 Andy Tsui <gueei....@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Tsui  
View profile  
 More options Aug 14 2012, 11:00 am
From: Andy Tsui <gueei....@gmail.com>
Date: Tue, 14 Aug 2012 23:00:33 +0800
Local: Tues, Aug 14 2012 11:00 am
Subject: Re: Editable List view item

I think you better check the log cat output, it seems perfectly valid to me
and it should be working..

On Tue, Aug 14, 2012 at 10:01 PM, Thiago Lacerda Siqueira <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thiago Lacerda Siqueira  
View profile  
 More options Aug 14 2012, 3:01 pm
From: Thiago Lacerda Siqueira <thiago...@gmail.com>
Date: Tue, 14 Aug 2012 16:01:54 -0300
Local: Tues, Aug 14 2012 3:01 pm
Subject: Re: Editable List view item

Log cat tells nothing about it.
When i change the values in contact information fields, the view load the
values, but when i modify the view, the fields in the list item remains the
same...
In debug i can see the observables being notified, but the item instance in
list is not modified in any moment.
I'm a little bit lost, because as you said, the markup and code seems to be
valid...

Best Regards,

Thiago Lacerda

2012/8/14 Andy Tsui <gueei....@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thiago Lacerda Siqueira  
View profile  
 More options Aug 14 2012, 4:06 pm
From: Thiago Lacerda Siqueira <thiago...@gmail.com>
Date: Tue, 14 Aug 2012 17:06:56 -0300
Local: Tues, Aug 14 2012 4:06 pm
Subject: Re: Editable List view item

Now i have sure that the set method of the Observable is never called when
changing the list item in view, i thinking about the observables not are
being registered to be notified when item list is added...
What you think?

Best Regards,

Thiago Lacerda

2012/8/14 Thiago Lacerda Siqueira <thiago...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Tsui  
View profile  
 More options Aug 14 2012, 9:21 pm
From: Andy Tsui <gueei....@gmail.com>
Date: Wed, 15 Aug 2012 09:21:35 +0800
Local: Tues, Aug 14 2012 9:21 pm
Subject: Re: Editable List view item

>  i thinking about the observables not are being registered

That's what I doubt too, and if anything wrong with the markup, log cat
should show something.

On Wed, Aug 15, 2012 at 4:06 AM, Thiago Lacerda Siqueira <

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thiago Lacerda Siqueira  
View profile  
 More options Aug 14 2012, 11:25 pm
From: Thiago Lacerda Siqueira <thiago...@gmail.com>
Date: Wed, 15 Aug 2012 00:25:51 -0300
Local: Tues, Aug 14 2012 11:25 pm
Subject: Re: Editable List view item
The markup is ok then...
The log cat have no error...
Can you try to reproduce this issue? And post me the results?

Best regards,

Thiago Lacerda

2012/8/14 Andy Tsui <gueei....@gmail.com>:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Tsui  
View profile  
 More options Aug 14 2012, 11:58 pm
From: Andy Tsui <gueei....@gmail.com>
Date: Wed, 15 Aug 2012 11:58:30 +0800
Local: Tues, Aug 14 2012 11:58 pm
Subject: Re: Editable List view item

possible.. what you are doing is:

1. have a list of stuff
2. have a button to add
3. after adding, and editing the added item, nothing is changed

is that so?

Andy

On Wed, Aug 15, 2012 at 11:25 AM, Thiago Lacerda Siqueira <

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thiago Lacerda Siqueira  
View profile  
 More options Aug 15 2012, 8:44 am
From: Thiago Lacerda Siqueira <thiago...@gmail.com>
Date: Wed, 15 Aug 2012 09:44:49 -0300
Local: Wed, Aug 15 2012 8:44 am
Subject: Re: Editable List view item
Exactly.
Thanks in advance for your help.
I need to deliver the prototype in this friday and after all i have
tried this trouble is the one that remains yet.

Best regards,

Thiago Lacerda

2012/8/15 Andy Tsui <gueei....@gmail.com>:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Tsui  
View profile  
 More options Aug 15 2012, 9:37 am
From: Andy Tsui <gueei....@gmail.com>
Date: Wed, 15 Aug 2012 21:37:45 +0800
Local: Wed, Aug 15 2012 9:37 am
Subject: Re: Editable List view item

BTW, I suggest you replace Tab View with Bindable Layouts later on.. Tab
View is very hard to maintain and not flexible enough. also I feel that
Google will fade TabView away..

On Wed, Aug 15, 2012 at 8:44 PM, Thiago Lacerda Siqueira <

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thiago Lacerda Siqueira  
View profile  
 More options Aug 15 2012, 11:40 am
From: Thiago Lacerda Siqueira <thiago...@gmail.com>
Date: Wed, 15 Aug 2012 12:40:46 -0300
Local: Wed, Aug 15 2012 11:40 am
Subject: Re: Editable List view item
Hi Andy!

Im using bindable layouts indeed.
My prototype is entirely based in New Markup Demo...
Im using bindable layouts, bindable action bar with list navigation,
metadata files, etc
As i said to you before, i think your implementation of binding
layouts is far better than the fragments one.
Congratulations for the great framework.

Best regards,

Thiago Lacerda

2012/8/15 Andy Tsui <gueei....@gmail.com>:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Tsui  
View profile  
 More options Aug 15 2012, 12:09 pm
From: Andy Tsui <gueei....@gmail.com>
Date: Thu, 16 Aug 2012 00:09:30 +0800
Local: Wed, Aug 15 2012 12:09 pm
Subject: Re: Editable List view item

Thanks.. but I can't take all the credits, bindable layouts are suggested
by other member :)

On Wed, Aug 15, 2012 at 11:40 PM, Thiago Lacerda Siqueira <

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thiago Lacerda Siqueira  
View profile  
 More options Aug 15 2012, 12:17 pm
From: Thiago Lacerda Siqueira <thiago...@gmail.com>
Date: Wed, 15 Aug 2012 13:17:27 -0300
Local: Wed, Aug 15 2012 12:17 pm
Subject: Re: Editable List view item
Well, that is the secret behind open projects... =]

2012/8/15 Andy Tsui <gueei....@gmail.com>:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thiago Lacerda Siqueira  
View profile   Translate to Translated (View Original)
 More options Aug 16 2012, 9:13 am
From: Thiago Lacerda Siqueira <thiago...@gmail.com>
Date: Thu, 16 Aug 2012 10:13:25 -0300
Local: Thurs, Aug 16 2012 9:13 am
Subject: Re: Editable List view item

Hi Andy!
Some success in reproducing the error?

Em quarta-feira, 15 de agosto de 2012, Thiago Lacerda Siqueira<
thiago...@gmail.com> escreveu:

--
Um Abraço,

Thiago Lacerda


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Tsui  
View profile  
 More options Aug 16 2012, 10:28 pm
From: Andy Tsui <gueei....@gmail.com>
Date: Fri, 17 Aug 2012 10:28:10 +0800
Local: Thurs, Aug 16 2012 10:28 pm
Subject: Re: Editable List view item

Hi,

first I have to apologize, the "BindableLayout" email is not mean for you,
I have sent to wrong person :P

Next, that's a point I also forgot, the "EditText"'s text attribute is not
a String, but a CharSequence, which if you put a String there, it will not
serve two way binding.. To make it work, simply put CharSequenceObservable
instead of StringObservable will be fine, I attached the test project I
have to you. Enjoy.

Andy

On Thu, Aug 16, 2012 at 9:13 PM, Thiago Lacerda Siqueira <

  AddAndEditListItem.zip
576K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thiago Lacerda Siqueira  
View profile   Translate to Translated (View Original)
 More options Aug 17 2012, 9:23 am
From: Thiago Lacerda Siqueira <thiago...@gmail.com>
Date: Fri, 17 Aug 2012 10:23:59 -0300
Local: Fri, Aug 17 2012 9:23 am
Subject: Re: Editable List view item
Hi Andy!

You are a life saver!
The strings now are binding like a charm.
You gave me the fish now i want to know to catch it! Can you tell how
the FW does this relation between atribute type and observable is
done? In my model i have some observables of objects and in these
cases the binding is made in one way only.
Thanks a lot for your help.

Best Regards,

Thiago Lacerda

2012/8/16 Andy Tsui <gueei....@gmail.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thiago Lacerda Siqueira  
View profile   Translate to Translated (View Original)
 More options Aug 17 2012, 10:41 am
From: Thiago Lacerda Siqueira <thiago...@gmail.com>
Date: Fri, 17 Aug 2012 11:41:47 -0300
Local: Fri, Aug 17 2012 10:41 am
Subject: Re: Editable List view item
Hi Andy!

Forget it! I found in calculator example the converter concepts and it
is exactly what i needed.
Once more, thanks a lot for your help and congratulations for the
great framework.

Best Regards,

Thiago Lacerda

2012/8/17 Thiago Lacerda Siqueira <thiago...@gmail.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Tsui  
View profile  
 More options Aug 17 2012, 11:12 am
From: Andy Tsui <gueei....@gmail.com>
Date: Fri, 17 Aug 2012 23:12:28 +0800
Local: Fri, Aug 17 2012 11:12 am
Subject: Re: Editable List view item

Basically there are 2 binding types to attributes: one-way and two-way. one
way means you can assign value to view attr but not vice versa, example to
this will be Text, you can put any Observable<Object> to it, and it will
translate to Object.toString(). In this case, of course it cannot go back.

For two-ways, both attr and observable must be exactly the same type,
reason for this is obvious.

In some cases view attributes are readonly, for example clickedItem for
ListViews, but still those I consider them to be two-way.

Yeah, converter is really powerful pattern and I personally found many
interesting situations beyond my intended design. For example, you can add
behavior to a View without subclassing it,  I once made a "SeekBar" and
make it "snap" to integer values, pure accomplished by using converter.

Andy

On Fri, Aug 17, 2012 at 10:41 PM, Thiago Lacerda Siqueira <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »