You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Daniel Gredler (JIRA)" <ta...@jakarta.apache.org> on 2007/02/12 04:37:05 UTC
[jira] Created: (TAPESTRY-1265) Using Map as model for a Select,
unexpected results
Using Map as model for a Select, unexpected results
---------------------------------------------------
Key: TAPESTRY-1265
URL: https://issues.apache.org/jira/browse/TAPESTRY-1265
Project: Tapestry
Issue Type: Bug
Affects Versions: 5.0
Reporter: Daniel Gredler
Fix For: 5.0
I'm not sure if using Maps is supported for the model of a Select component, but when I use this Map:
Map map = new TreeMap();
map.put("id_a", "value_a");
map.put("id_b", "value_b");
map.put("id_c", "value_c");
return map;
I get this HTML (notice the two extraneous squiggly brackets):
<select id="jurisdiction" name="jurisdiction"><option value="{id_a">value_a<option value="id_b">value_b<option value="id_c">value_c}</select>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-1265) Using Map as model for a Select,
unexpected results
Posted by "Daniel Gredler (JIRA)" <ta...@jakarta.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-1265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474341 ]
Daniel Gredler commented on TAPESTRY-1265:
------------------------------------------
I thought about making it a SortedMap -> SelectModel coercion, but decided it'd be better to just let people pick their own poison. Thanks for applying.
> Using Map as model for a Select, unexpected results
> ---------------------------------------------------
>
> Key: TAPESTRY-1265
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1265
> Project: Tapestry
> Issue Type: Bug
> Affects Versions: 5.0
> Reporter: Daniel Gredler
> Assigned To: Howard M. Lewis Ship
> Fix For: 5.0
>
> Attachments: map-to-select-model.patch
>
>
> I'm not sure if using Maps is supported for the model of a Select component, but when I use this Map:
> Map map = new TreeMap();
> map.put("id_a", "value_a");
> map.put("id_b", "value_b");
> map.put("id_c", "value_c");
> return map;
> I get this HTML (notice the two extraneous squiggly brackets):
> <select id="jurisdiction" name="jurisdiction"><option value="{id_a">value_a<option value="id_b">value_b<option value="id_c">value_c}</select>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Assigned: (TAPESTRY-1265) Using Map as model for a Select,
unexpected results
Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-1265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship reassigned TAPESTRY-1265:
----------------------------------------------
Assignee: Howard M. Lewis Ship
> Using Map as model for a Select, unexpected results
> ---------------------------------------------------
>
> Key: TAPESTRY-1265
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1265
> Project: Tapestry
> Issue Type: Bug
> Affects Versions: 5.0
> Reporter: Daniel Gredler
> Assigned To: Howard M. Lewis Ship
> Fix For: 5.0
>
> Attachments: map-to-select-model.patch
>
>
> I'm not sure if using Maps is supported for the model of a Select component, but when I use this Map:
> Map map = new TreeMap();
> map.put("id_a", "value_a");
> map.put("id_b", "value_b");
> map.put("id_c", "value_c");
> return map;
> I get this HTML (notice the two extraneous squiggly brackets):
> <select id="jurisdiction" name="jurisdiction"><option value="{id_a">value_a<option value="id_b">value_b<option value="id_c">value_c}</select>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-1265) Using Map as model for a Select,
unexpected results
Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-1265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474339 ]
Howard M. Lewis Ship commented on TAPESTRY-1265:
------------------------------------------------
Good patch. Only issue I have with it is that the order of the OptionModels is left to the whim of HashMap and hashCode(). I'm making a small change to order the OptionModel elements alphabetically by label.
> Using Map as model for a Select, unexpected results
> ---------------------------------------------------
>
> Key: TAPESTRY-1265
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1265
> Project: Tapestry
> Issue Type: Bug
> Affects Versions: 5.0
> Reporter: Daniel Gredler
> Assigned To: Howard M. Lewis Ship
> Fix For: 5.0
>
> Attachments: map-to-select-model.patch
>
>
> I'm not sure if using Maps is supported for the model of a Select component, but when I use this Map:
> Map map = new TreeMap();
> map.put("id_a", "value_a");
> map.put("id_b", "value_b");
> map.put("id_c", "value_c");
> return map;
> I get this HTML (notice the two extraneous squiggly brackets):
> <select id="jurisdiction" name="jurisdiction"><option value="{id_a">value_a<option value="id_b">value_b<option value="id_c">value_c}</select>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Closed: (TAPESTRY-1265) Using Map as model for a Select,
unexpected results
Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-1265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship closed TAPESTRY-1265.
------------------------------------------
Resolution: Fixed
> Using Map as model for a Select, unexpected results
> ---------------------------------------------------
>
> Key: TAPESTRY-1265
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1265
> Project: Tapestry
> Issue Type: Bug
> Affects Versions: 5.0
> Reporter: Daniel Gredler
> Assigned To: Howard M. Lewis Ship
> Fix For: 5.0
>
> Attachments: map-to-select-model.patch
>
>
> I'm not sure if using Maps is supported for the model of a Select component, but when I use this Map:
> Map map = new TreeMap();
> map.put("id_a", "value_a");
> map.put("id_b", "value_b");
> map.put("id_c", "value_c");
> return map;
> I get this HTML (notice the two extraneous squiggly brackets):
> <select id="jurisdiction" name="jurisdiction"><option value="{id_a">value_a<option value="id_b">value_b<option value="id_c">value_c}</select>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Commented: (TAPESTRY-1265) Using Map as model for a Select,
unexpected results
Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-1265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474340 ]
Howard M. Lewis Ship commented on TAPESTRY-1265:
------------------------------------------------
On second thought, I'll leave it the way it is for the moment. If someone wants it in a specific order, they can use a TreeMap (like your example) or build the OptionModel/SelectModel themselves.
> Using Map as model for a Select, unexpected results
> ---------------------------------------------------
>
> Key: TAPESTRY-1265
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1265
> Project: Tapestry
> Issue Type: Bug
> Affects Versions: 5.0
> Reporter: Daniel Gredler
> Assigned To: Howard M. Lewis Ship
> Fix For: 5.0
>
> Attachments: map-to-select-model.patch
>
>
> I'm not sure if using Maps is supported for the model of a Select component, but when I use this Map:
> Map map = new TreeMap();
> map.put("id_a", "value_a");
> map.put("id_b", "value_b");
> map.put("id_c", "value_c");
> return map;
> I get this HTML (notice the two extraneous squiggly brackets):
> <select id="jurisdiction" name="jurisdiction"><option value="{id_a">value_a<option value="id_b">value_b<option value="id_c">value_c}</select>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org
[jira] Updated: (TAPESTRY-1265) Using Map as model for a Select,
unexpected results
Posted by "Daniel Gredler (JIRA)" <ta...@jakarta.apache.org>.
[ https://issues.apache.org/jira/browse/TAPESTRY-1265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Gredler updated TAPESTRY-1265:
-------------------------------------
Attachment: map-to-select-model.patch
Adds a Map -> SelectModel coercion.
> Using Map as model for a Select, unexpected results
> ---------------------------------------------------
>
> Key: TAPESTRY-1265
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1265
> Project: Tapestry
> Issue Type: Bug
> Affects Versions: 5.0
> Reporter: Daniel Gredler
> Fix For: 5.0
>
> Attachments: map-to-select-model.patch
>
>
> I'm not sure if using Maps is supported for the model of a Select component, but when I use this Map:
> Map map = new TreeMap();
> map.put("id_a", "value_a");
> map.put("id_b", "value_b");
> map.put("id_c", "value_c");
> return map;
> I get this HTML (notice the two extraneous squiggly brackets):
> <select id="jurisdiction" name="jurisdiction"><option value="{id_a">value_a<option value="id_b">value_b<option value="id_c">value_c}</select>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org