Uploaded image for project: 'Click'
  1. Click
  2. CLK-464

Panel getId() throws exception if name is not defined

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5 RC3
    • Fix Version/s: 1.5
    • Component/s: None
    • Labels:
      None

      Description

      Panel.getId() expects name to be defined. Name is not guaranteed to be defined. Instead Panel#getId should return null.

        Activity

        Hide
        sabob Bob Schellink added a comment -

        fixed in trunk

        Show
        sabob Bob Schellink added a comment - fixed in trunk
        Hide
        medgar Malcolm Edgar added a comment -

        This was one of the basic assumptions that controls wold have a name defined. Why has this been relaxed?

        Show
        medgar Malcolm Edgar added a comment - This was one of the basic assumptions that controls wold have a name defined. Why has this been relaxed?
        Hide
        sabob Bob Schellink added a comment -

        Hi Malcolm,

        It is difficult to work with containers if they all need names.

        For an example see the method #addTextField here: http://www.avoka.com/click-examples/source-viewer.htm?filename=WEB-INF/classes/net/sf/click/examples/control/html/cssform/ContactDetailsForm.java

        If names are mandatory one will have to define a name for each ListItem and FeedbackBorder. Defining names in this context only adds overhead that won't be used.

        I can see three use cases for defining a name:

        #1 bindRequestValue - Fields still require name to be defined as per AbstractContainer#insert implementation
        #2 Velocity templates - if one needs to reference the Control inside Velocity a name still needs be defined.
        #3 Lookup controls inside Containers - again a name should be defined if one needs to do the lookup.

        regards

        bob

        Show
        sabob Bob Schellink added a comment - Hi Malcolm, It is difficult to work with containers if they all need names. For an example see the method #addTextField here: http://www.avoka.com/click-examples/source-viewer.htm?filename=WEB-INF/classes/net/sf/click/examples/control/html/cssform/ContactDetailsForm.java If names are mandatory one will have to define a name for each ListItem and FeedbackBorder. Defining names in this context only adds overhead that won't be used. I can see three use cases for defining a name: #1 bindRequestValue - Fields still require name to be defined as per AbstractContainer#insert implementation #2 Velocity templates - if one needs to reference the Control inside Velocity a name still needs be defined. #3 Lookup controls inside Containers - again a name should be defined if one needs to do the lookup. regards bob

          People

          • Assignee:
            sabob Bob Schellink
            Reporter:
            sabob Bob Schellink
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development