You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Remmerie Bart <Ba...@elia.be> on 2004/05/18 11:16:03 UTC

[CForms] "Selectable" repeater-row

I'm trying to generate an event when someone clicks a field in a
repeater-row that returns me the selected row.

USE CASE: a list of items on the left side of your screen (maybe in a
coplet), the details for the selected item on the right (eventually another
coplet)

I've found two possible ways to go (but have not reached to goal with either
one)

1. Starting by modifying the fields styling stylesheet, adding a
"submit-on-click" option, which generates an on-click attribute
=> could not figure out where to go next...

2. Using form.js v3, where you can add an onActivate event to widgets
=> Could not get any output at all: does this work for textfields ?

Anyway, if I keep on trying for a couple of days, I'm sure I could struggle
to a "workaround"-solution, but I was hoping someone else has "been there -
done that" before me.

All hints are welcome! (I'm prepared to include a "show details" button on
every row)

Regards,
Bart





This message and its attachments may contain confidential information protected by intellectual property rights or other rights & is strictly for the exclusive use of the intended recipient. It is strictly prohibited to copy, alter or disclose this message or its contents to any other person without Elia's prior consent. If you are not the intended recipient of this message, please inform the person who sent it and delete the message from your system. Elia is not liable for any direct or indirect damage arising from errors, inaccuracies or any loss in the message, from unauthorized use, disclosure, copying or alteration of it or as a result of any virus being passed on. This message does not constitute any commitment from Elia except when expressly otherwise agreed between the intended recipient and Elia.

U vindt de Nederlandse versie van deze disclaimer op onze internetsite  www.elia.be

Vous pouvez découvrir la version française de ce disclaimer sur notre site internet www.elia.be


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [CForms] "Selectable" repeater-row

Posted by Joerg Heinicke <jo...@gmx.de>.
On 18.05.2004 11:16, Remmerie Bart wrote:

> 1. Starting by modifying the fields styling stylesheet, adding a
> "submit-on-click" option, which generates an on-click attribute
> => could not figure out where to go next...

If you want to have a real onClick or onSelect or whatever you must go 
this way. But I fear it won't work: onSelect="submit()" => page reload 
=> nothing selected => user selects field => onSelect="submit()" ...

The explicite selection Upyavira suggested seems to be better. Or you 
don't do a form submit and only reload the details coplet. This logic 
must then be implemented by client side javascript. This also 
circumvents the need to update two frames (is each coplet in a different 
frame?? or your detailview?).

> 2. Using form.js v3, where you can add an onActivate event to widgets
> => Could not get any output at all: does this work for textfields ?

This can not work as it is only server side javascript. And a textfield 
has no onActivate event, only submits or actions should have one.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [CForms] "Selectable" repeater-row

Posted by Upayavira <uv...@upaya.co.uk>.
Remmerie Bart wrote:

>I'm trying to generate an event when someone clicks a field in a
>repeater-row that returns me the selected row.
>
>USE CASE: a list of items on the left side of your screen (maybe in a
>coplet), the details for the selected item on the right (eventually another
>coplet)
>
>I've found two possible ways to go (but have not reached to goal with either
>one)
>
>1. Starting by modifying the fields styling stylesheet, adding a
>"submit-on-click" option, which generates an on-click attribute
>=> could not figure out where to go next...
>
>2. Using form.js v3, where you can add an onActivate event to widgets
>=> Could not get any output at all: does this work for textfields ?
>  
>
Have done it. See if I can remember. Add an action or submit widget to 
the row.

Then, after the form is submitted, use something like 
form.getSubmitWidget().getParent() which will return you the Row that 
was selected. I imagine you'd do 
form.getSubmitWidget().getParent().getWidget("id") or some such to get 
an ID field for that row.

I belive CForms has changed a bit since I did this (and my memory isn't 
what it used to be) so the syntax might be wrong, but the idea is sound.

HTH.

Upayavira


>Anyway, if I keep on trying for a couple of days, I'm sure I could struggle
>to a "workaround"-solution, but I was hoping someone else has "been there -
>done that" before me.
>
>All hints are welcome! (I'm prepared to include a "show details" button on
>every row)
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org