Hi,

1. 'time$' is just a prefix string making sure that all generated id's begin with 'time$', in you r case I guess it would be 'pic'

2,3. These are the coordinate values, the 2 and 1 in your 'pic_2_1'
These are simply generated using the index parameter with two nested for loops

<tr jwcid="@For" index="ognl:row" source="ognl:rows" element="tr">
<td jwcid="@For" source="ognl:columns" index="ognl:column" element="td">
   </td>
</tr>

-erik


Josh Joy wrote:
Thanks Erik.

Couple questions...what do the following mean and how
are their values populated?

1. time$
2. row 3. column
Thanks,
Josh

Erik Johansson wrote:
Hi Josh,

This is how I did it

The tag:
<div jwcid="@Any" element="div" id="ognl:'time$' row
'$' column"
class="scheduleClicked" onclick="ognl:'javascript:switchClicked(' row ','
column ');return
false;'">

The javascript
function switchClicked(_row, _column){
   if(document.getElementById('time$' _row '$'
_column).className ==
'scheduleClicked'){
       document.getElementById('time$' _row '$'
_column).className =
'scheduleUnclicked';
   }
   else{
       document.getElementById('time$' _row '$'
_column).className =
'scheduleClicked';
   }
}

-erik

Josh Joy wrote:
Hi All,

I'm needing to generate unique ids to use in my
javascript function calls? The closest thing I
could find on google is
something called "IdAllocator" though I couldnt
find any helpful
examples.

I need to do something similar to the following
where
the first number changes, ie _1_1 for the first row
and the for loop
generates _2_1 for the second row...

for loop generates

    <td>
        <img id="pic_1_1"
onclick="changePic('1','1');" src="pic.jpg" />
        <img id="pic_1_2    "
onclick="changePic('1','1');" src="pic.jpg" />
        <img id="pic_1_3"
onclick="changePic('1','1');" src="pic.jpg" />
    </td>

    <td>
        <img id="pic_2_1"
onclick="changePic('2','1');" src="pic.jpg" />
        <img id="pic_2_2"
onclick="changePic('2','1');" src="pic.jpg" />
        <img id="pic_2_3"
onclick="changePic('2','1');" src="pic.jpg" />
    </td>


First I was thinking of using the @Any tag, though
I'm
not sure how to inject a counter id into the
string?
Thanks in advance,
Josh


---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to