You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Rolf Metternich (JIRA)" <ji...@apache.org> on 2006/09/11 09:06:22 UTC

[jira] Created: (COCOON-1915) Nullable value with additional String or XMLizable in JavaSelectionList

Nullable value with additional String or XMLizable in JavaSelectionList
-----------------------------------------------------------------------

                 Key: COCOON-1915
                 URL: http://issues.apache.org/jira/browse/COCOON-1915
             Project: Cocoon
          Issue Type: Improvement
          Components: Blocks: Forms
    Affects Versions: 2.1.9
            Reporter: Rolf Metternich
            Priority: Trivial


Setting a text for the nullable-Value as String or XMLizable programmaticly by using setNullText(String nullText);

Also you can set the nullText in the definition of the selectionlist.
Example:
<fd:datatype base="long"/>
<fd:selection-list>
  <fd:null-text>
    <i18n:text>please-select</i18n:text>
  </fd:null-text>
  <fd:item value="1"/>
  <fd:item value="2"/>
  <fd:item value="3">
    <fd:label>three</fd:label>
  </fd:item>
  <fd:item value="4"/>
  <fd:item value="5"/>
</fd:selection-list>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (COCOON-1915) Nullable value with additional String or XMLizable in JavaSelectionList

Posted by "Rolf Metternich (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1915?page=comments#action_12453438 ] 
            
Rolf Metternich commented on COCOON-1915:
-----------------------------------------

Hi Mark!

Maybe it is possible to use the items with value="". I didn't test it and, of course, I hadn't this idea.

For my problem: I fill a JavaSelectionList with database values and offer sometimes, in programmatically context, not to select an item. I do this by 'setNullable(true)'. When I set nullabel to true, the sax generation builds an item with value="" and no label. I wanted to have this null-item with an label like 'all' or something else. 

This way, i can toggle between setNullable=true/false dependend on other values in the form (perhaps Ajax), without building the SelectionList again. 

The improvements are also made in the JavaSelectionListBuilder and the first example is only done for this.

I hope, you can I understand, why I did it. Do you have another solution for this problem?

Rolf

> Nullable value with additional String or XMLizable in JavaSelectionList
> -----------------------------------------------------------------------
>
>                 Key: COCOON-1915
>                 URL: http://issues.apache.org/jira/browse/COCOON-1915
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: Forms
>    Affects Versions: 2.2-dev (Current SVN), 2.1.9, 2.1.10-dev (current SVN)
>            Reporter: Rolf Metternich
>            Priority: Minor
>         Attachments: JavaSelectionList.txt, JavaSelectionList.txt
>
>
> Setting a text for the nullable-Value as String or XMLizable programmaticly by using setNullText(String nullText);
> Also you can set the nullText in the definition of the selectionlist.
> Example:
> <fd:datatype base="long"/>
> <fd:selection-list>
>   <fd:null-text>
>     <i18n:text>please-select</i18n:text>
>   </fd:null-text>
>   <fd:item value="1"/>
>   <fd:item value="2"/>
>   <fd:item value="3">
>     <fd:label>three</fd:label>
>   </fd:item>
>   <fd:item value="4"/>
>   <fd:item value="5"/>
> </fd:selection-list>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (COCOON-1915) Nullable value with additional String or XMLizable in JavaSelectionList

Posted by "Rolf Metternich (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1915?page=comments#action_12452143 ] 
            
Rolf Metternich commented on COCOON-1915:
-----------------------------------------

Hello Mark!

Maybe your solution shows the same data in the form, but the 'null-text' tag is made for supporting the 'nullable' attribute in the selection list. 

So you can differ between normal items and the text-value for the nullable element and set the null-text by software.

This is useful for sax generation in the AbstractJavaSelectionList where the 'nullable' attribute is tested.

Rolf

> Nullable value with additional String or XMLizable in JavaSelectionList
> -----------------------------------------------------------------------
>
>                 Key: COCOON-1915
>                 URL: http://issues.apache.org/jira/browse/COCOON-1915
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: Forms
>    Affects Versions: 2.2-dev (Current SVN), 2.1.9, 2.1.10-dev (current SVN)
>            Reporter: Rolf Metternich
>            Priority: Minor
>         Attachments: JavaSelectionList.txt, JavaSelectionList.txt
>
>
> Setting a text for the nullable-Value as String or XMLizable programmaticly by using setNullText(String nullText);
> Also you can set the nullText in the definition of the selectionlist.
> Example:
> <fd:datatype base="long"/>
> <fd:selection-list>
>   <fd:null-text>
>     <i18n:text>please-select</i18n:text>
>   </fd:null-text>
>   <fd:item value="1"/>
>   <fd:item value="2"/>
>   <fd:item value="3">
>     <fd:label>three</fd:label>
>   </fd:item>
>   <fd:item value="4"/>
>   <fd:item value="5"/>
> </fd:selection-list>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (COCOON-1915) Nullable value with additional String or XMLizable in JavaSelectionList

Posted by "Mark Lundquist (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1915?page=comments#action_12452511 ] 
            
Mark Lundquist commented on COCOON-1915:
----------------------------------------

Hi Rolf, I'm still not sure that I get it :-).  I understand 'nullable' for enum selection lists, but I don't see how it makes sense for ordinary text-based lists when (a) the empty value translates to null on submission, and (b) you can specify a label for the empty value using current mechanisms.

You said "This is useful for sax generation in the AbstractJavaSelectionList where the 'nullable' attribute is tested", but the purpose of generateSaxFragment() is just to generate the form markup... so if you can already effect that same markup without a new mechanism, where is the need for that new mechanism?

IOW... can you give an example of something you need this <null-text> for that you cannot do with <item value="">, i.e. specifically how would it not work to do it that way?

thx,
- Mark



> Nullable value with additional String or XMLizable in JavaSelectionList
> -----------------------------------------------------------------------
>
>                 Key: COCOON-1915
>                 URL: http://issues.apache.org/jira/browse/COCOON-1915
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: Forms
>    Affects Versions: 2.2-dev (Current SVN), 2.1.9, 2.1.10-dev (current SVN)
>            Reporter: Rolf Metternich
>            Priority: Minor
>         Attachments: JavaSelectionList.txt, JavaSelectionList.txt
>
>
> Setting a text for the nullable-Value as String or XMLizable programmaticly by using setNullText(String nullText);
> Also you can set the nullText in the definition of the selectionlist.
> Example:
> <fd:datatype base="long"/>
> <fd:selection-list>
>   <fd:null-text>
>     <i18n:text>please-select</i18n:text>
>   </fd:null-text>
>   <fd:item value="1"/>
>   <fd:item value="2"/>
>   <fd:item value="3">
>     <fd:label>three</fd:label>
>   </fd:item>
>   <fd:item value="4"/>
>   <fd:item value="5"/>
> </fd:selection-list>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (COCOON-1915) Nullable value with additional String or XMLizable in JavaSelectionList

Posted by "Rolf Metternich (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1915?page=all ]

Rolf Metternich updated COCOON-1915:
------------------------------------

              Urgency: Normal  (was: Low)
    Affects Version/s: 2.2-dev (Current SVN)
                       2.1.10-dev (current SVN)
             Priority: Minor  (was: Trivial)

> Nullable value with additional String or XMLizable in JavaSelectionList
> -----------------------------------------------------------------------
>
>                 Key: COCOON-1915
>                 URL: http://issues.apache.org/jira/browse/COCOON-1915
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: Forms
>    Affects Versions: 2.2-dev (Current SVN), 2.1.9, 2.1.10-dev (current SVN)
>            Reporter: Rolf Metternich
>            Priority: Minor
>         Attachments: JavaSelectionList.txt, JavaSelectionList.txt
>
>
> Setting a text for the nullable-Value as String or XMLizable programmaticly by using setNullText(String nullText);
> Also you can set the nullText in the definition of the selectionlist.
> Example:
> <fd:datatype base="long"/>
> <fd:selection-list>
>   <fd:null-text>
>     <i18n:text>please-select</i18n:text>
>   </fd:null-text>
>   <fd:item value="1"/>
>   <fd:item value="2"/>
>   <fd:item value="3">
>     <fd:label>three</fd:label>
>   </fd:item>
>   <fd:item value="4"/>
>   <fd:item value="5"/>
> </fd:selection-list>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (COCOON-1915) Nullable value with additional String or XMLizable in JavaSelectionList

Posted by "Rolf Metternich (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1915?page=all ]

Rolf Metternich updated COCOON-1915:
------------------------------------

    Attachment: JavaSelectionList.txt

Sorry! The previous patch includes a patch for EmptySelectionList, which is not for this.

> Nullable value with additional String or XMLizable in JavaSelectionList
> -----------------------------------------------------------------------
>
>                 Key: COCOON-1915
>                 URL: http://issues.apache.org/jira/browse/COCOON-1915
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: Forms
>    Affects Versions: 2.1.9
>            Reporter: Rolf Metternich
>            Priority: Trivial
>         Attachments: JavaSelectionList.txt, JavaSelectionList.txt
>
>
> Setting a text for the nullable-Value as String or XMLizable programmaticly by using setNullText(String nullText);
> Also you can set the nullText in the definition of the selectionlist.
> Example:
> <fd:datatype base="long"/>
> <fd:selection-list>
>   <fd:null-text>
>     <i18n:text>please-select</i18n:text>
>   </fd:null-text>
>   <fd:item value="1"/>
>   <fd:item value="2"/>
>   <fd:item value="3">
>     <fd:label>three</fd:label>
>   </fd:item>
>   <fd:item value="4"/>
>   <fd:item value="5"/>
> </fd:selection-list>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (COCOON-1915) Nullable value with additional String or XMLizable in JavaSelectionList

Posted by "Rolf Metternich (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1915?page=all ]

Rolf Metternich updated COCOON-1915:
------------------------------------

    Attachment: JavaSelectionList.txt

> Nullable value with additional String or XMLizable in JavaSelectionList
> -----------------------------------------------------------------------
>
>                 Key: COCOON-1915
>                 URL: http://issues.apache.org/jira/browse/COCOON-1915
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: Forms
>    Affects Versions: 2.1.9
>            Reporter: Rolf Metternich
>            Priority: Trivial
>         Attachments: JavaSelectionList.txt
>
>
> Setting a text for the nullable-Value as String or XMLizable programmaticly by using setNullText(String nullText);
> Also you can set the nullText in the definition of the selectionlist.
> Example:
> <fd:datatype base="long"/>
> <fd:selection-list>
>   <fd:null-text>
>     <i18n:text>please-select</i18n:text>
>   </fd:null-text>
>   <fd:item value="1"/>
>   <fd:item value="2"/>
>   <fd:item value="3">
>     <fd:label>three</fd:label>
>   </fd:item>
>   <fd:item value="4"/>
>   <fd:item value="5"/>
> </fd:selection-list>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (COCOON-1915) Nullable value with additional String or XMLizable in JavaSelectionList

Posted by "Mark Lundquist (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1915?page=comments#action_12451882 ] 
            
Mark Lundquist commented on COCOON-1915:
----------------------------------------

With regard to 

  <fd:null-text>
    <i18n:text>please-select</i18n:text>
  </fd:null-text>

Does that do anything different than what you can already do using this?:

  <fd:item value="">
    <fd:label>
      <i18n:text>please-select</i18n:text>
    </fd:label>
  </fd:item>


— Mark

> Nullable value with additional String or XMLizable in JavaSelectionList
> -----------------------------------------------------------------------
>
>                 Key: COCOON-1915
>                 URL: http://issues.apache.org/jira/browse/COCOON-1915
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: Blocks: Forms
>    Affects Versions: 2.2-dev (Current SVN), 2.1.9, 2.1.10-dev (current SVN)
>            Reporter: Rolf Metternich
>            Priority: Minor
>         Attachments: JavaSelectionList.txt, JavaSelectionList.txt
>
>
> Setting a text for the nullable-Value as String or XMLizable programmaticly by using setNullText(String nullText);
> Also you can set the nullText in the definition of the selectionlist.
> Example:
> <fd:datatype base="long"/>
> <fd:selection-list>
>   <fd:null-text>
>     <i18n:text>please-select</i18n:text>
>   </fd:null-text>
>   <fd:item value="1"/>
>   <fd:item value="2"/>
>   <fd:item value="3">
>     <fd:label>three</fd:label>
>   </fd:item>
>   <fd:item value="4"/>
>   <fd:item value="5"/>
> </fd:selection-list>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira