Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: link in header of dataTable

  1. #1

    Exclamation link in header of dataTable

    Hello,

    when I put a commandLink into <f:facet name="header"> after clicking that link I get an Exception:

    Code:
    java.lang.IllegalArgumentException: class org.springframework.faces.model.OneSelectionTrackingListDataModel is in an illegal state - no row is available at the current index.
            at org.springframework.util.Assert.isTrue(Assert.java:65)
            at org.springframework.faces.model.SerializableListDataModel.getRowData(SerializableListDataModel.java:59)
            at org.springframework.faces.model.OneSelectionTrackingListDataModel.setSelected(OneSelectionTrackingListDataModel.java:67)
            at org.springframework.faces.model.SelectionTrackingActionListener.trackSelection(SelectionTrackingActionListener.java:67)
            at org.springframework.faces.model.SelectionTrackingActionListener.processAction(SelectionTrackingActionListener.java:54)
            at javax.faces.component.UICommand.broadcast(UICommand.java:383)
            at javax.faces.component.UIData.broadcast(UIData.java:854)
            at org.springframework.faces.ui.AjaxViewRoot.broadCastEvents(AjaxViewRoot.java:262)
            at org.springframework.faces.ui.AjaxViewRoot.processApplication(AjaxViewRoot.java:153)
            at org.springframework.faces.webflow.FlowLifecycle.invokePhase(FlowLifecycle.java:122)
            at org.springframework.faces.webflow.FlowLifecycle.execute(FlowLifecycle.java:65)
            at org.springframework.faces.webflow.JsfView.processUserEvent(JsfView.java:110)
            at org.springframework.webflow.engine.ViewState.resume(ViewState.java:187)
            at org.springframework.webflow.engine.Flow.resume(Flow.java:534)
            at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:274)
            ... 42 more
    I'm using SWF-2.0.1 with Facelets.

    Does anybody know if this a bug is?

    Thanks a lot

  2. #2
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    Hmmm...yes, looks like a bug to me. Can you open a Jira? Thanks.
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  3. #3

    Default

    How can I do that?

  4. #4
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    http://jira.springframework.org/browse/SWF -> Create New Issue

    Welcome to the Spring communty :-)
    Keith Donald
    Core Spring Development Team

  5. #5

    Default

    I' ve created my first jira issue (SWF-692).

    By the way, how can I overcome this problem?

    Thanks

  6. #6
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    For the time being you could use result-type="org.springframework.faces.model.Serializable ListDataModel" in your <evaluate> expression that loads the data for the table. This would get rid of the error...the only drawback is that you will lost the ability to have "model.selectedRow" type of expressions like what we have in the booking-faces sample.

    The fix for the larger problem is pretty simple and I should get it committed today, so you could potentially use tonight's nightly build to get the fix.
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  7. #7

    Default

    The commandLink is working fine in dataTable even the ability to have "model.selectedRow", but outside <f:facet name="header">.

    It seems that SerializableListDataModel tries to get selectedRow even when the link is in the header of the dataTable. But there isn't any index.

    I tried to put a "selectedRow" inside the method (e.g. switch order of a list) without using it. The error disappears but the transition doesn't occur and that is very unfortunate.

  8. #8
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    Ok, I just committed a fix for this. Try tonight's nightly build to ensure it solves the problem as expected.
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  9. #9

    Smile

    OK, thank you very much.

  10. #10

    Default

    So, I tried the nightly build(swf 2.0.2). There is no error more. But the commandLink is not working inside the <f:facet name="header">. After clicking on the link nothing happened. The SWF transition doesn't occur, in my case, refreshing the flow by sorting new the dataTable.

    When I put the same link with the same method outside the "dataTable" the transition occur and the flow is refreshed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •