0

Hello guys I have a doubt in the primefaces infowindow

First: I use jsf2 + primefaces4 + mojarra2

When looking at the documentation and primefaces showcase the attributes of the marker are LatLgn latlgn, String title, Object data, String icon, String shadow

Where in latlgn I'll pass the coordinates for the marker, the title will be a description of the image and data will be the image.

In the current application works good and I am currently doing so:

Bean:

advancedModel.addOverlay(new Marker (new LatLng(user.getLatitude(), user.getLongitude()),   user.getName() + " " + user.getAdress(), user.getPhoto()));  

Xhtml:

<p:gmapInfoWindow>  
    <p:outputPanel >    
        <p:imageSwitch>    
            <ui:repeat value="#{searchMBean.marker.data}" var="photo">    
                <p:graphicImage value="/temp/#{photo.id}.jpg" />    
            </ui:repeat>    
        </p:imageSwitch>  
        <h:outputText value="#{searchMBean.marker.title}" />  
    </p:outputPanel>    
 </p:gmapInfoWindow> 

What I want to do in String title: I want to pass more than a string so I can modify the xhtml it with css, because the way is the name and address are together

It there a possibility to pass more than one parameter to the String title? But would like some ideas how.

Konstantin Yovkov
  • 62,134
  • 8
  • 100
  • 147
palad
  • 1
  • 2

2 Answers2

0

You can pass parameters in the EL expression that evaluates the title value. For example:

<h:outputText value="#{searchMBean.marker.title('param1', 'param2')}" />

This forces the managed-bean getter for the title to match the following signature:

public String getTitle(String param1, String param2) {
   //
}

More info:

Community
  • 1
  • 1
Konstantin Yovkov
  • 62,134
  • 8
  • 100
  • 147
  • First I thank you for the quick reply! I think this way will not be a solution to my problem, because I would need to receive two distinct strings in the title (which is an attribute of the marker) and treats them in different ways with the css in xhtml This way I will not be able to treat the separate parameters and also the title is inside the marker where I can not modify them to receive the parameters. – palad Oct 22 '13 at 17:30
0

Well guys solved the problem of infowindow what I posted some time ago.

Basically, the marker has 5 parameters (LatLgn latlgn) for latitude and longitude (String title) for the title of the image (Object data) to the image, (String icon) if you want to customize your icon on the map and (String shadow ) where is the shadow of the icon. With this guy I put the address string that I needed, following the example below.

MBean

advancedModel.addOverlay(new Marker
(new
    LatLng(user.getLatitude(), user.getLongitude()), // LatLgn latitude and longitude
    user.getName(), // String title
    user.getPhoto(), //Object data
    iconName, // String icon
    user.getAddress() + ", " + user.getNumber() + " - " + user.getNeighborhood() // String shadow)
);

Xhtml

<div class="searchAddress">
    <h:outputText value="#{searchMBean.marker.shadow}" />
</div>
palad
  • 1
  • 2