Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.1.0
    • Component/s: extras
    • Labels:
      None

      Description

      Form control does not allow to add fields as same name.
      So we can't send multi parameters using hidden field.

      I think new HiddenList control can solve this issue.

      For example:


      HiddenList hiddenList = new HiddenList("hiddenList");
      hiddenList.addValue("1");
      hiddenList.addValue("2");
      hiddenList.addValue("3");
      form.add(hiddenList);


      Generated HTML:


      <input type="hidden" name="hiddenList" value="1"/>
      <input type="hidden" name="hiddenList" value="2"/>
      <input type="hidden" name="hiddenList" value="3"/>


        Activity

        Hide
        Bob Schellink added a comment -

        Hi Naoki,

        Nice idea. We just need to ensure that the ID attribute is unique. Probably add the list index to the ID?

        regards

        bob

        Show
        Bob Schellink added a comment - Hi Naoki, Nice idea. We just need to ensure that the ID attribute is unique. Probably add the list index to the ID? regards bob
        Hide
        Naoki Takezoe added a comment -

        Yes, I think so.

        I have already a HiddenList implementation.
        Can I commit it?

        Show
        Naoki Takezoe added a comment - Yes, I think so. I have already a HiddenList implementation. Can I commit it?
        Hide
        Bob Schellink added a comment -

        +1 from me.

        Show
        Bob Schellink added a comment - +1 from me.
        Hide
        Naoki Takezoe added a comment -

        Hi Bob,

        one more question.

        I think HiddenList is useful for many applications.
        I think that HiddenList might have to be added to the click-core.

        Should I commit it click-extras? or click-core?

        Show
        Naoki Takezoe added a comment - Hi Bob, one more question. I think HiddenList is useful for many applications. I think that HiddenList might have to be added to the click-core. Should I commit it click-extras? or click-core?
        Hide
        Malcolm Edgar added a comment -

        I understand the need for a list of hidden values, but what about encoding these in the hidden field value.

        Having a single control which renders multiple html elements, seems a little odd, but use usage pattern looks very simple.

        Will the control do type conversion, return a list of integers?

        Is the intention that this be in extras, I don't think it belongs in core.

        regards Malcolm Edgar

        Show
        Malcolm Edgar added a comment - I understand the need for a list of hidden values, but what about encoding these in the hidden field value. Having a single control which renders multiple html elements, seems a little odd, but use usage pattern looks very simple. Will the control do type conversion, return a list of integers? Is the intention that this be in extras, I don't think it belongs in core. regards Malcolm Edgar
        Hide
        Bob Schellink added a comment -

        I agree with Malcolm, extras is probably a better fit for now.

        We should also add an example under "Controls" to show its usage.

        Show
        Bob Schellink added a comment - I agree with Malcolm, extras is probably a better fit for now. We should also add an example under "Controls" to show its usage.
        Hide
        Naoki Takezoe added a comment -

        Thanks for Malcolm and Bob,

        > I understand the need for a list of hidden values, but what about encoding these in the hidden field value.

        I wish to convert values of controls to hidden field.
        Single parameter controls can be converted to HiddenField.
        But controls which have multi values such as Select, CheckList or PickList can not be converted.
        It need encoding values to a single string as Malcolm says.

        If I have a HiddenList, I would be able to convert these controls naturally.
        And Select(or CheckList, PickList) would be able to receive sent values by HiddenList directly.

        > I agree with Malcolm, extras is probably a better fit for now.
        >
        > We should also add an example under "Controls" to show its usage.

        Anyway, I agree with Malcolm and Bob. I would add HiddenList to extras.

        Show
        Naoki Takezoe added a comment - Thanks for Malcolm and Bob, > I understand the need for a list of hidden values, but what about encoding these in the hidden field value. I wish to convert values of controls to hidden field. Single parameter controls can be converted to HiddenField. But controls which have multi values such as Select, CheckList or PickList can not be converted. It need encoding values to a single string as Malcolm says. If I have a HiddenList, I would be able to convert these controls naturally. And Select(or CheckList, PickList) would be able to receive sent values by HiddenList directly. > I agree with Malcolm, extras is probably a better fit for now. > > We should also add an example under "Controls" to show its usage. Anyway, I agree with Malcolm and Bob. I would add HiddenList to extras.
        Hide
        Naoki Takezoe added a comment -

        I committed HiddenList into click-extras.
        I will also add usage of HiddenList to examples.

        Show
        Naoki Takezoe added a comment - I committed HiddenList into click-extras. I will also add usage of HiddenList to examples.
        Hide
        Naoki Takezoe added a comment -

        I could not make a good example for HiddenList because HiddenList is an invisible control.
        So I committed a unit test for HiddenList control instead of an example.

        Show
        Naoki Takezoe added a comment - I could not make a good example for HiddenList because HiddenList is an invisible control. So I committed a unit test for HiddenList control instead of an example.

          People

          • Assignee:
            Naoki Takezoe
            Reporter:
            Naoki Takezoe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development