Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    #16
    Originally posted by Isomorphic View Post
    You have client-side criteria that filter on category_text.
    Where? The only client-side criteria I have is:
    Code:
    Criteria c= new Criteria();
    				c.addCriteria("categoryText", "A");
    				personListGrid.fetchData(c);
    Or I am not seeing another one?

    I further have in the datasource:
    Code:
    <field name="category_text" type="text" customSQLExpression="categories.category_text" />
    But I am not filtering on it as a criteria, I am only showing its content.

    You then change the category_id but evidently the data you send back from the server is not including updated values for category_text.
    Why not?

    I just checked in the Developer console and its returning:
    Code:
    [
        {
            data:[
                {
                    person_id:3, 
                    person_name:"anna", 
                    category_id:2
                }
            ], 
            invalidateCache:false, 
            isDSResponse:true, 
            operationType:"update", 
            queueStatus:0, 
            relatedUpdates:[
                {
                    endRow:1, 
                    dataSource:"personListGrid", 
                    totalRows:1, 
                    isDSResponse:true, 
                    invalidateCache:false, 
                    status:0, 
                    operationType:"update", 
                    startRow:0, 
                    data:[
                        {
                            category_id:2, 
                            person_id:3, 
                            person_name:"anna", 
                            category_text:"B"
                        }
                    ]
                }
            ], 
            status:0
        }
    ]
    Here you see that the value for category_text is the updated (correct) one:
    Code:
     category_text:"B"
    I am returning this whereClause:
    Code:
    <tableClause>
    			person left join categories on categories.category_id = person.category_id
    			</tableClause>
    since for the addRelatedUpdate() I am using:
    Code:
    newRequest.setOperationId("fetch_simple");
    and this uses
    Code:
    person left join categories on categories.category_id = person.category_id
    so if the person.category_id changed, this will return also the new category_text (as confirmed by the developer console):
    Code:
    <field name="category_text" type="text" customSQLExpression="categories.category_text" />

    You've got some other more basic issues, like the criteria are targeting "categoryText" but the ListGridField is "category_text".
    Why is this a issue? The category_text is only for showing the value. I am not filtering/making any criteria on category_text, only on categoryText, which acts as a flag. If it is set, the categoryText is used to filter. And the category_text is correctly displayed because of this:

    Code:
    person left join categories on categories.category_id = person.category_id
    To sum up again: this is very simple:

    1. make sure you supply criteria to the ListGrid which will eliminate rows you do not want to see.

    2. make sure the server returns data which contains updated values for all the fields where you have client-side criteria
    If this is so simple, and I have struggled so much with this simple issue, why don't you please just correct my testcase?
    Last edited by edulid; 31 Oct 2013, 07:09.

    Comment


      #17
      We've already pointed out that your code has an issue with two different names for the categoryText field, and yes you do need to fix that.

      This is not a framework issue or gap in the framework, so Support is now bowing out, sorry. If you need code written for you, we do offer Consulting services.

      Comment


        #18
        Originally posted by Isomorphic View Post
        We've already pointed out that your code has an issue with two different names for the categoryText field, and yes you do need to fix that.
        But you didn't tell me why this is an issue.

        The category_text is only for showing the value. I am not filtering/making any criteria on category_text, only on categoryText, which acts as a flag. If it is set, the categoryText is used to filter. And the category_text is correctly displayed because of this:
        person left join categories on categories.category_id = person.category_id

        Comment


          #19
          Did you see my developer console output? It is returning the correct value for category_text. You said :
          evidently the data you send back from the server is not including updated values for category_text.
          Is this then incorrect?

          Comment


            #20
            Actually, we've told you why this is an issue several times.

            If you expect the client-side criteria to eliminate rows, the criteria have to correspond to the Record data. If you just set some criteria that doesn't correspond to a DataSource field at all, and doesn't correspond to the attributes in your Record at all, this criteria will make it to the server but will never eliminate records on the client side.

            We already referred you to the ResultSet docs to understand how client-side filtering works.. We suggest you very carefully review this doc, and Support's repeated statements on the same topic in each of your threads. We have been saying the same thing over and over in several different ways, and it seems that you are just not reading closely enough for it to sink in, and we're at a loss for how we can possibly say something new that will help.

            Comment


              #21
              Originally posted by Isomorphic View Post
              If you just set some criteria that doesn't correspond to a DataSource field at all, and doesn't correspond to the attributes in your Record at all, this criteria will make it to the server but will never eliminate records on the client side.
              Thank you! This is the problem! I reorganized my datasource, so that all criterias correspond to a field. I think this problem is finally gone, works like a charm!
              Sorry if I posted "repeatedly" questions on the same problem. I just struggled a lot to have this problem solved and wasn't able to solve it, until now! Thanks for your patience.

              Comment

              Working...
              X