[jira] [Commented] (TAP5-2245) select component: selected option is not listed in the model.

2014-11-04 Thread Massimo Lusetti (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14195964#comment-14195964
 ] 

Massimo Lusetti commented on TAP5-2245:
---

I've had a similar case in a recent app using beta-22 and it seems it's working 
right.

Does anyone confirm this still valid issue?

 select component: selected option is not listed in the model.
 -

 Key: TAP5-2245
 URL: https://issues.apache.org/jira/browse/TAP5-2245
 Project: Tapestry 5
  Issue Type: Bug
  Components: tapestry-core
Affects Versions: 5.4
Reporter: Sven Homburg
  Labels: regression
 Attachments: ScreenDump.pdf


 @Component
 private Zone previewZone;
 @Component(parameters = {value=previewMonth, model=[1,3,6], 
 zone=previewZone})
 private Select previewSelect;
 @OnEvent(component = previewSelect, value = EventConstants.VALUE_CHANGED)
 void onValueChangedFromPreviewSelect(long result)
 {
   if (selectedDate == null)
   selectedDate = LocalDate.now();
   selectedDate = selectedDate.plusMonths((int) (result - 1));
   ajaxResponseRenderer.addRender(previewZone, previewZone);
 }
 After selecting a value in select component the following error message
 occoures:
 Selected option is not listed in the model.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TAP5-2245) select component: selected option is not listed in the model.

2014-05-31 Thread Jochen Kemnade (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14014582#comment-14014582
 ] 

Jochen Kemnade commented on TAP5-2245:
--

I think it's a bug in Tapestry. The model is generated with {{Long}}s in 
Tapestry. The submitted value is interpreted as an {{Integer}}. I think, we 
should coerce the submitted value and use that for the check.

 select component: selected option is not listed in the model.
 -

 Key: TAP5-2245
 URL: https://issues.apache.org/jira/browse/TAP5-2245
 Project: Tapestry 5
  Issue Type: Bug
  Components: tapestry-core
Affects Versions: 5.4
Reporter: Sven Homburg
  Labels: regression
 Attachments: ScreenDump.pdf


 @Component
 private Zone previewZone;
 @Component(parameters = {value=previewMonth, model=[1,3,6], 
 zone=previewZone})
 private Select previewSelect;
 @OnEvent(component = previewSelect, value = EventConstants.VALUE_CHANGED)
 void onValueChangedFromPreviewSelect(long result)
 {
   if (selectedDate == null)
   selectedDate = LocalDate.now();
   selectedDate = selectedDate.plusMonths((int) (result - 1));
   ajaxResponseRenderer.addRender(previewZone, previewZone);
 }
 After selecting a value in select component the following error message
 occoures:
 Selected option is not listed in the model.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-2245) select component: selected option is not listed in the model.

2014-05-30 Thread Thiago H. de Paula Figueiredo (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14014501#comment-14014501
 ] 

Thiago H. de Paula Figueiredo commented on TAP5-2245:
-

So do you guys think this is a bug in Java or in Sven's code? If the latter, 
I'd like to close the ticket.

 select component: selected option is not listed in the model.
 -

 Key: TAP5-2245
 URL: https://issues.apache.org/jira/browse/TAP5-2245
 Project: Tapestry 5
  Issue Type: Bug
  Components: tapestry-core
Affects Versions: 5.4
Reporter: Sven Homburg
  Labels: regression
 Attachments: ScreenDump.pdf


 @Component
 private Zone previewZone;
 @Component(parameters = {value=previewMonth, model=[1,3,6], 
 zone=previewZone})
 private Select previewSelect;
 @OnEvent(component = previewSelect, value = EventConstants.VALUE_CHANGED)
 void onValueChangedFromPreviewSelect(long result)
 {
   if (selectedDate == null)
   selectedDate = LocalDate.now();
   selectedDate = selectedDate.plusMonths((int) (result - 1));
   ajaxResponseRenderer.addRender(previewZone, previewZone);
 }
 After selecting a value in select component the following error message
 occoures:
 Selected option is not listed in the model.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-2245) select component: selected option is not listed in the model.

2014-04-29 Thread Jochen Kemnade (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13984102#comment-13984102
 ] 

Jochen Kemnade commented on TAP5-2245:
--

The submitted value is an Integer, the respective value in the model is a Long. 
We might just want to coerce the submitted value to the model value's type when 
checking for equality.

 select component: selected option is not listed in the model.
 -

 Key: TAP5-2245
 URL: https://issues.apache.org/jira/browse/TAP5-2245
 Project: Tapestry 5
  Issue Type: Bug
  Components: tapestry-core
Affects Versions: 5.4
Reporter: Sven Homburg
  Labels: regression
 Attachments: ScreenDump.pdf


 @Component
 private Zone previewZone;
 @Component(parameters = {value=previewMonth, model=[1,3,6], 
 zone=previewZone})
 private Select previewSelect;
 @OnEvent(component = previewSelect, value = EventConstants.VALUE_CHANGED)
 void onValueChangedFromPreviewSelect(long result)
 {
   if (selectedDate == null)
   selectedDate = LocalDate.now();
   selectedDate = selectedDate.plusMonths((int) (result - 1));
   ajaxResponseRenderer.addRender(previewZone, previewZone);
 }
 After selecting a value in select component the following error message
 occoures:
 Selected option is not listed in the model.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-2245) select component: selected option is not listed in the model.

2014-04-29 Thread Basile Chandesris (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13984787#comment-13984787
 ] 

Basile Chandesris commented on TAP5-2245:
-

Yes, Integer workaround works.

ex: http://jumpstart.doublenegative.com.au/jumpstart/examples/select/easyobject

@Property
@Persist
private Integer customer;

@Property
@Persist
 private MapInteger, String customersModel;

 MapUtils.toInteger(

// Workaround for https://issues.apache.org/jira/browse/TAP5-2245 select 
component: selected option is not listed in the model.
//  http://java.dzone.com/articles/5-things-you-should-know-about-java-generics
public static MapInteger, String toInteger(MapLong, String mapLong) {
try {
MapInteger, String mapInt = new HashMapInteger, String();
for (Long key : mapLong.keySet()) {
mapInt.put(key.intValue(), mapLong.get(key));
}
return mapInt;
} catch(java.lang.ClassCastException e) {
LOG.warn(May be un-necessary Map conversion, values:\n + 
DumpToString.dump(mapLong.values()), e);
return (Map) mapLong;
}
}

   





 select component: selected option is not listed in the model.
 -

 Key: TAP5-2245
 URL: https://issues.apache.org/jira/browse/TAP5-2245
 Project: Tapestry 5
  Issue Type: Bug
  Components: tapestry-core
Affects Versions: 5.4
Reporter: Sven Homburg
  Labels: regression
 Attachments: ScreenDump.pdf


 @Component
 private Zone previewZone;
 @Component(parameters = {value=previewMonth, model=[1,3,6], 
 zone=previewZone})
 private Select previewSelect;
 @OnEvent(component = previewSelect, value = EventConstants.VALUE_CHANGED)
 void onValueChangedFromPreviewSelect(long result)
 {
   if (selectedDate == null)
   selectedDate = LocalDate.now();
   selectedDate = selectedDate.plusMonths((int) (result - 1));
   ajaxResponseRenderer.addRender(previewZone, previewZone);
 }
 After selecting a value in select component the following error message
 occoures:
 Selected option is not listed in the model.



--
This message was sent by Atlassian JIRA
(v6.2#6252)