thumbnail images to larger images

i have a dictionary that displays multiple images for each record. everything works great, the pictures display like i want them to, but when i added another link to view the larger image, i do not receive the correct picture image.
i have looked at the showcases on the website and have noticed that no one uses thumbnails to view larger images. is it possible to have a link from a thumbnail to a larger image?? if so, how does that work in a loop?

any help would be greatly appreciated.

Thanks,
smielke

Hello,

Currently, I guess you have links depending on the record or data within your xapp:loop.

<xapp:loop ...>
  ...
  Click to the picture of:
  <a href="xxx/yyy/<xapp:display select="..." />.jpg">
    <xapp:display select="..." />
  </a>
</xspp:loop>
</pre><BR><BR>Instead of the hypelink (<a ..>) to the image you could have displayed the image directly via<BR><pre class="ip-ubbcode-code-pre">
  <img src="xxx/yyy/<xapp:display select="..." />.jpg" />
</pre><BR><BR>And now, instead of using a link with text, you want to use a thumbnail. This could look like<BR><pre class="ip-ubbcode-code-pre">
  <a href="xxx/yyy/large/<xapp:display select="..." />.jpg">
    <img src="xxx/yyy/tumbnail/<xapp:display select="..." />.gif" />
  </a>



However, I am not sure if I have the correct understanding of your request. Therefore, if my guess about your application was wrong, could you post me the JSP with your xapp:loop where you define the images or the links to the images?

Many thanks.

Bye,
Christian.

What I want to do is display 4 thumbnail pictures and there descriptions on the first page. Then if the user wants to see a larger picture, they would click on the thumbnail to view the larger image. I’ve used both action and elementaction in the link, but I’m not sure what the difference is. Here is my jsp to the view page, which displays 4 thumbnails and their descriptions.

<xapp:loop select="/GLYPH" iterate=“EXAMPLES” targetbase="/GLYPH/EXAMPLES">     <xapp:loop select="." base="/GLYPH/EXAMPLES" targetbase="/GLYPH/EXAMPLES/xapp:seq()">



<xapp:display select="$POS"/>.


<xapp:loop select="." iterate=“PIC_FILE” base="/GLYPH/EXAMPLES/xapp:seq()" targetbase="/GLYPH/EXAMPLES/xapp:seq()/PIC_FILE">


 
<xapp:elementaction type=“select” base="/GLYPH/EXAMPLES/xapp:seq()/PIC_FILE"><img src="./images/<xapp:display select=“PIC_FILE”/>"></xapp:elementaction>

</xapp:loop><xapp:loop select="." iterate=“PIC_DESC” base="/GLYPH/EXAMPLES/xapp:seq()" targetbase="/GLYPH/EXAMPLES/xapp:seq()/xapp:child(2)/PIC_DESC">


 
<xapp:display select=“PIC_DESC”/>



</xapp:loop></xapp:loop></xapp:loop>


As you can see, a link is created on each of the 4 pictures. But when I click on any of the picture links, I retrieve the first picture in the loop. Below is what I have in the hires.jsp:
xapp:module
xapp:form



 
<img src="./images/<xapp:display select=“EXAMPLES/PIC_FILE[1]”/>">


</xapp:form>
</xapp:module>

In the structure.xml file the hires is define liked this.








I have used both the display select and the loop select in the structure file. the loop select retrieves all the pictures when I click on any thumbnail. The display select only retrieves the first image. should I be setting up the structure file differently? or is there a way to send the hires.jsp the name of the thumbnail file in the link.

Thanks in advance,
smielke

[This message was edited by smielke on 31 Jul 2003 at 14:31.]

[This message was edited by smielke on 31 Jul 2003 at 14:34.]

does anyone have any input on this issue???

Hello,

Excuse me that I didn’t respond to your former request, but somehow the notification about your post did not reach me. I guess it was my fault.

Now, to your problem:

I checked your JSP code by formatting the text.

Within your XML schema you have an element GLYPHE containing multiple element EXAMPLEs. An EXAMPLE is consists of a list of PIC_FILE and a list of PIC_DESC. So, you used to loops to iterate the PIC_FILES and then the PIC_DESC.

My question: Does your schema look like

<element name="EXAMLES">
  <complexType>
    <sequence maxOccurs="unbounded">
      <element name="PIC_FILES ...></element>
      <element name="PIC_DESC ...></element>
    </sequence>
  </complexType>
</element>
</pre><BR> <BR>or <BR><BR><pre class="ip-ubbcode-code-pre">
<element name="EXAMLES">
  <complexType>
    <sequence>
      <element name="PIC_FILES minOccurs="unbounded"></element>
      <element name="PIC_DESC  minOccurs="unbounded"></element>
    </sequence>
  </complexType>
</element>
</pre><BR><BR>I would expect the first variant because in this definition a picture must have a file and a description while in variant 2 this constraint does not exist.<BR><BR>If its 1, you should use one loop to iterate the content of the sequence<BR><BR><pre class="ip-ubbcode-code-pre">
<!-- iterates the example nodes of the element examples -->
<xapp:loop select="/GLYPH" iterate="EXAMPLES" targetbase="/GLYPH/EXAMPLES">

  <!-- iterates the sequence nodes of the element examples -->
  <xapp:loop select="." base="/GLYPH/EXAMPLES" targetbase="/GLYPH/EXAMPLES/xapp:seq()">
	...
	<!-- number of the current sequence node -->
	<xapp:display select="$POS"/>
      ...
	<!-- the current pic file -->
	<xapp:display select="./PIC_FILE" />

	<!-- the current discription of the file -->
	<xapp:display select="./PIC_DESC" />
  </xapp:loop>
</xapp:loop>
</pre><BR><BR>The third loop would not be necessary.<BR><BR><B>Now, to your link problem:</B><BR><BR>Could you try out the following statements?<BR><BR><pre class="ip-ubbcode-code-pre">
<xapp:loop select="." base="/GLYPH/EXAMPLES" targetbase="/GLYPH/EXAMPLES/xapp:seq()">
  ...
  <!-- within the loop of the sequence nodes -->
  <xapp:elementaction type="select" base="/GLYPH/EXAMPLES/xapp:seq()">
    <a href="hires.jsp">
      <img src="./images/<xapp:display select="PIC_FILE"/>" />
    </a>
  </xapp:elementaction>
  ...
</xapp:loop>
</pre><BR><BR><BR>When call this JSP the thumbnails should be display the name for each thumbnail is<BR><BR>./image/PIC_FILES<BR><BR>Therefore, it depends on the content of PIC_FILES. If the thumbnails are not correctly displayed, please check if the content of the elements PIC_FILES and the pictures of the directory 'images' have the same name.<BR><BR>Now to the page to display the high resolution picture:<BR><BR>Could try out the following code<BR><BR><pre class="ip-ubbcode-code-pre">
<body bgcolor="#f3e5d9">
  <xapp:module>
    <xapp:form base="/GLYPH/EXAMPLES/xapp:seq()">
    <table>
      <tr xmlns="" bgcolor="#f3e5d9">
        <td width="8%" height="12" valign="top" align="left"> </td>
        <td width="90%" height="12" valign="top" align="left">
          <img src="./images/<xapp:display select="./PIC_FILE" />" />
        </td>
      </tr>
    </table>
    </xapp:form>
  </xapp:module>
</body>



If you compare this code with the code you send me, you will see that the xapp:display tag refers ./PIC_FILE instead of ./EXAMPLES/PIC_FILE[1] and the enclosing xapp:form contains a reference to a base node. Due to its name, this base node is the node registered by the select action within the loop.

Bye,
Christian.

i removed the extra loop and used your coding suggestions. everything works great:)

thanks a bunch,
smielke

Topic will be moved to Assistance Forum


Hello,

this topic will be moved to the Assistance Forum in the next days.
The assistance forum is intended to be used for technical questions and answers.

Thank you for your understanding.

Regards,
Christian.