1. #11
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    Wait. So you do have an example?

    I don't follow how it would work because the constructor for CompositeCell takes in a list of HasCell objects and if the value provider for a column comes from a PropertyAccess interface implementation there's no way to get a list of HasCell objects.

    Unless....you had your bean define a setter that returns a list of HasCell objects which then tightly couples your POJOs to a UI framework and violates the separation of concerns.

    A POJO needs to be completely and totally independent of any framework and should not be doing any business logic or providing the data in anything other than a standard way. It should not be massaging data for use in a UI.

  2. #12
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    CompositeCell might not work for your custom usecase. However CompositeCell works very well with Grid and GXT.

    If you require to render N objects and have them all clickable, why cannot you create a custom cell that just fits your needs?

  3. #13
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    Fair enough.

    I have a custom cell that renders the items. I have not been able to make them clickable using the API. Making them clickable in HTML, in the render method, would be easy but I don't want to have custom JavaScript calls - there's a term for this, but I can't remember it. I think it's four letters.

  4. #14
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    I again cannot follow you. Why cannot you listen to the click event and check for the target in your custom cell? All cells work like this.

  5. #15
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    I'm sorry I am not being clear.

    Data for each row in my grid comes from GXTs PropertyAccess<T> interface. In my case, T is a bean that has a method that returns a list of M, i.e., another bean type. This list varies in length.

    For the composite cell in question, I cannot simply render the list of M. I essentially need to construct a list of ClickableTextCell objects and render this list.

    I construct my ColumnConfig via ColumnConfig<T, T>(new IdentityValueProvider<T>(), ....);

    When I call setCell(new CompositeCell(...)), I need to pass in a list of HasCell objects and I don't know how to construct them because I don't have an instance of T, all I have is T itself. So, I can't get a list of M objects to be able to construct the list of HasCell objects and I can't think of a way to get them.

  6. #16
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    In that case you need to have a Cell that acepts a list of T as value and can render it. You will need to have a custom cell for this.

    Basicly its a CompositeCell that contains N ClickableTextCell's

  7. #17
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    Just wanted to close this thread out. Colin pointed me to XTemplates (http://sencha.com/examples-dev/#ExamplePlace:templates). IMHO, they're incredibly powerful and WAY more easy to use than CompositeCell - which incidentally, I never was actually able to get working.

  8. #18
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    For the composite cell in question, I cannot simply render the list of M. I essentially need to construct a list of ClickableTextCell objects and render this list.
    A template would exactly do this.


    A Tempalte just renders markup. You still need to have an own cell that makes different actions depening on where you clicked. The composite cell containing multiple clickable cells would not do anything else.

  9. #19
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Another note for others interested in this. If Xtemplate works for this, than you can also use any other cell that can render simpel markup and iterate over the list directly.

    The problem with xtemplate/markup is that you need to make your logic for the click related to the target element on your own.

  10. #20
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    Ahhhhh. Right. I left that bit out. In my custom cell, I check the event type in onBrowserEvent(...) and handle it appropriately based on what was clicked.

    Since our use case doesn't require handlers, i.e., multiple listeners, I simply construct the cell with callback handlers for the pieces I want to listen to. It's not "technically" a composite cell as it's still just one table cell, but it IS far easier to work with since you don't have to have to have your HasCells up front like you do with CompositeCell.

Thread Participants: 1

Tags for this Thread