You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Nicola Benaglia <ni...@idra-spa.it> on 2006/01/09 12:04:39 UTC

HtmlGraphicImage and width/height parameters

Hi,
I need to pass "width" and "height" parameters
to a jsp graphicImage tag as following:

<h:graphicImage binding="#{cardLoader.image}" 
url="#{facesContext.externalContext.requestContextPath}#{cardLoader.imageUrl}" 
styleClass="card"/>

I use a binding component.

The bean called as this method:

private HtmlGraphicImage image;
public HtmlGraphicImage getImage() {
		image.setHeight("10.0");
		image.setWidth("10.0");
		return image;
	}

But I still obtain an error with setHeight and setWidth (a String 
argument is required).
Where do I make the error ?  10.0 is pixel, cm, inches ?


May I pass directly the paramenters as shown here ? (I still haven't 
tested this way)

<h:graphicImage width="#{cardLoader.imagew}" 
height="#{cardLoader.imageh}" 
url="#{facesContext.externalContext.requestContextPath}#{cardLoader.imageUrl}" 
styleClass="card"/>

Thank you,
Nicola
---

Questa mail ed eventuali suoi allegati sono strettamente confidenziali. Se
ricevete per errore questa mail, Vi preghiamo cortesemente di cancellarla
immediatamente e di segnalare l'errore a chi ve l'ha spedita. Se Voi non siete
il reale destinatario di questa mail non siete autorizzati alla copia, alla
distribuzione e alla stampa di essa ne tantomeno ad una eventuale modifica
dei contenuti.
 
This message and any attachments are confidential and intended solely for
the addressees. If you receive this message in error, please delete it and
immediately notify the sender. If the reader of this message is not the
intended recipient, you are hereby notified that any unauthorized use,
copying, publication, printing or dissemination is prohibited. E-mails are
susceptible to alteration.

Re: HtmlGraphicImage and width/height parameters

Posted by "::SammyRulez::" <sa...@gmail.com>.
you have plenty of options to do that using different stylesheet files
for each supported  resolution


detect the client resolution in a Session scoped bean
detect the client resolution custom viewHandler
detect the client resolution in a filter chained before jsf rendering

first one is the easiest for me

this could be usefull also

http://myfaces.apache.org/tomahawk/stylesheet.html


2006/1/9, Nicola Benaglia <ni...@idra-spa.it>:
> ::SammyRulez:: ha scritto:
> > put them in css style class. Don't put presentation data in you bean ;-)
>
> My needs are to dimension an image, after having collected information
> about the resolution of the client's monitor.
> So I have to recalculate the width and height.
> CSS are not involved in this case, IMHO.
>
> Bye
> Nicola
> ---
>
> Questa mail ed eventuali suoi allegati sono strettamente confidenziali. Se
> ricevete per errore questa mail, Vi preghiamo cortesemente di cancellarla
> immediatamente e di segnalare l'errore a chi ve l'ha spedita. Se Voi non siete
> il reale destinatario di questa mail non siete autorizzati alla copia, alla
> distribuzione e alla stampa di essa ne tantomeno ad una eventuale modifica
> dei contenuti.
>
> This message and any attachments are confidential and intended solely for
> the addressees. If you receive this message in error, please delete it and
> immediately notify the sender. If the reader of this message is not the
> intended recipient, you are hereby notified that any unauthorized use,
> copying, publication, printing or dissemination is prohibited. E-mails are
> susceptible to alteration.
>


--
::SammyRulez::
http://sammyprojectz.blogspot.com

Re: HtmlGraphicImage and width/height parameters

Posted by Nicola Benaglia <ni...@idra-spa.it>.
::SammyRulez:: ha scritto:
> put them in css style class. Don't put presentation data in you bean ;-)

My needs are to dimension an image, after having collected information 
about the resolution of the client's monitor.
So I have to recalculate the width and height.
CSS are not involved in this case, IMHO.

Bye
Nicola
---

Questa mail ed eventuali suoi allegati sono strettamente confidenziali. Se
ricevete per errore questa mail, Vi preghiamo cortesemente di cancellarla
immediatamente e di segnalare l'errore a chi ve l'ha spedita. Se Voi non siete
il reale destinatario di questa mail non siete autorizzati alla copia, alla
distribuzione e alla stampa di essa ne tantomeno ad una eventuale modifica
dei contenuti.
 
This message and any attachments are confidential and intended solely for
the addressees. If you receive this message in error, please delete it and
immediately notify the sender. If the reader of this message is not the
intended recipient, you are hereby notified that any unauthorized use,
copying, publication, printing or dissemination is prohibited. E-mails are
susceptible to alteration.

Re: HtmlGraphicImage and width/height parameters

Posted by "::SammyRulez::" <sa...@gmail.com>.
put them in css style class. Don't put presentation data in you bean ;-)

BTW what error did you get?

2006/1/9, Nicola Benaglia <ni...@idra-spa.it>:
> Hi,
> I need to pass "width" and "height" parameters
> to a jsp graphicImage tag as following:
>
> <h:graphicImage binding="#{cardLoader.image}"
> url="#{facesContext.externalContext.requestContextPath}#{cardLoader.imageUrl}"
> styleClass="card"/>
>
> I use a binding component.
>
> The bean called as this method:
>
> private HtmlGraphicImage image;
> public HtmlGraphicImage getImage() {
>                 image.setHeight("10.0");
>                 image.setWidth("10.0");
>                 return image;
>         }
>
> But I still obtain an error with setHeight and setWidth (a String
> argument is required).
> Where do I make the error ?  10.0 is pixel, cm, inches ?
>
>
> May I pass directly the paramenters as shown here ? (I still haven't
> tested this way)
>
> <h:graphicImage width="#{cardLoader.imagew}"
> height="#{cardLoader.imageh}"
> url="#{facesContext.externalContext.requestContextPath}#{cardLoader.imageUrl}"
> styleClass="card"/>
>
> Thank you,
> Nicola
> ---
>
> Questa mail ed eventuali suoi allegati sono strettamente confidenziali. Se
> ricevete per errore questa mail, Vi preghiamo cortesemente di cancellarla
> immediatamente e di segnalare l'errore a chi ve l'ha spedita. Se Voi non siete
> il reale destinatario di questa mail non siete autorizzati alla copia, alla
> distribuzione e alla stampa di essa ne tantomeno ad una eventuale modifica
> dei contenuti.
>
> This message and any attachments are confidential and intended solely for
> the addressees. If you receive this message in error, please delete it and
> immediately notify the sender. If the reader of this message is not the
> intended recipient, you are hereby notified that any unauthorized use,
> copying, publication, printing or dissemination is prohibited. E-mails are
> susceptible to alteration.
>


--
::SammyRulez::
http://sammyprojectz.blogspot.com