Primefaces - colocar um lightbox dentro de um dataGrid

2 respostas
G

Pessoal,

como colocar um lightbox dentro do dataGrid?
utilizo o <p:lightBox> dentro do dataGrid, o lightBox funciona perfeitamente, mas o evento que defini no dataGrid para de funcionar. se retiro o p:lightBox volta a funcionar.

está dessa forma:

<h:form id="formGrid">
            <p:growl id="returnMsg" />
            <p:dataGrid var="link" value="#{voteMB.links}" id="grid" columns="3"
                rows="12" effect="true" effectSpeed="fast">
                <p:column>
                    <p:panel header="L2POG" style="align:center;">
                        <h:panelGrid columns="1" style="width:100%">

                            <p:commandLink update="formGrid:grid" oncomplete="">
                                <f:setPropertyActionListener target="#{voteMB.selectedLink}"
                                    value="#{link.idLink}" />

                                <p:lightBox iframe="true" width="80%" height="80%">
                                    <h:outputLink value="#{link.urlLink}" title="L2POG Anúncios">
                                        <script type="text/javascript">
                                            bb_bid = "001548";
                                            bb_lang = "pt-BR";
                                            bb_keywords = "jogos,games,play,online,rpg";
                                            bb_name = "custom";
                                            bb_limit = "4";
                                            bb_format = "bbd";
                                        </script>
                                        <script type="text/javascript"
                                            src="http://static.boo-box.com/javascripts/embed.js">
                                        </script>

                                    </h:outputLink>
                                </p:lightBox>
                            </p:commandLink>
                        </h:panelGrid>
                    </p:panel>
                </p:column>
            </p:dataGrid>

2 Respostas

G

alguém?

G

bem, consegui fazer o que queria dessa forma:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
</h:head>
<h:body>
	<div style="width: 50%;">
		<h:form id="formGrid">
			<p:growl id="returnMsg" />
			<p:dataGrid var="link" value="#{voteMB.links}" id="grid" columns="3"
				rows="12" effect="true" effectSpeed="fast">
				<p:column>
					<p:panel header="L2POG" style="align:center;">
						<h:panelGrid columns="1" style="width:50%">
							<p:commandLink update="formGrid:grid" ajax="false">
								<f:setPropertyActionListener target="#{voteMB.selectedLink}"
									value="#{link.idLink}" />
								<script type="text/javascript">
											bb_bid = "15485";
											bb_lang = "pt-BR";
											bb_keywords = "futebol";
											bb_name = "custom";
											bb_limit = "4";
											bb_format = "bbd";
										</script>
								<script type="text/javascript"
									src="http://static.boo-box.com/javascripts/embed.js">
										</script>
							</p:commandLink>
						</h:panelGrid>
					</p:panel>
				</p:column>
			</p:dataGrid>
			<h:selectOneMenu id="characters"
				value="#{charactersMB.selectedCharacter}"
				converter="charactersConverter">
				<f:selectItem itemLabel="Selecione o char" itemValue="0" />
				<f:selectItems value="#{charactersMB.list}" var="character"
					itemLabel="#{character.charName}" itemValue="#{character}" />
			</h:selectOneMenu>
			<p:commandButton value="Receber itens"
				actionListener="#{voteMB.persist}" update="returnMsg" />
		</h:form>
	</div>
</h:body>

</html>

mas só funciona no Firefox, no IE 8 e 9 e no Chrome tamb não funciona.
alguma dica? estou usando prime 2.1

Criado 20 de julho de 2011
Ultima resposta 28 de jul. de 2011
Respostas 2
Participantes 1