darshakshah1988 / gmaps4jsf

Automatically exported from code.google.com/p/gmaps4jsf
0 stars 1 forks source link

Bug in marker encoder #75

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create view with id <f:view id="viewid">
2. Create form in this view <h:form id="form">
3. Create map in this view <m:map .....
4. Create marker <m:marker id="m" latitude="48" longitude="11"
jsVariable="mM" draggable="true" submitOnValueChange="true"
valueChangeListener="#{bean.processValueChange}">
5. Some error in generated javascript occurs when you move with marker...

What is the expected output? What do you see instead?
Because MyFaces generate form id like "viewid:form", in the generated
javascript code should be something like:
document.getElementById('body:form').submit();
but there is only
document.getElementById('form').submit();

What version of the product are you using? On what operating system?
1.1.2, 1.1.3 / Windows / Myfaces 1.2.6

Please provide any additional information below.
I think that this bug is in the MarkerEncoder.java in method
saveMarkerState(...) 

actual:
+ "body:" + ComponentUtils.findParentForm(facesContext, marker).getId() +
"')." 

should be:
+ "body:" + ComponentUtils.findParentForm(facesContext,
marker).getClientId(facesContext) + "')." 

Original issue reported on code.google.com by mik...@ciernet.sk on 25 Sep 2009 at 8:07

GoogleCodeExporter commented 8 years ago
Sorry I paste bad lines (modified while debugging...):

actual:
+ ComponentUtils.findParentForm(facesContext, marker).getId() + "')." 

should be:
+ ComponentUtils.findParentForm(facesContext, marker).getClientId(facesContext) 
+ "')." 

Original comment by mik...@ciernet.sk on 25 Sep 2009 at 8:11

GoogleCodeExporter commented 8 years ago

Original comment by jose.noh...@gmail.com on 2 Nov 2009 at 2:07

GoogleCodeExporter commented 8 years ago
The issue is <f:view> does not have an id attribute according to the TLD and 
adding one 
should be regarded as an error. The patch is pretty simple and does not seem to 
break 
anything but I'll let Hazem decide.

Original comment by jose.noh...@gmail.com on 4 Nov 2009 at 2:22

Attachments:

GoogleCodeExporter commented 8 years ago
It is fixed. in the latest snapshot of 1.1.3.

Markers are now encoded using the client ids not using the id.

Original comment by Hazem.sa...@gmail.com on 24 Nov 2009 at 10:41