You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Velychko <v_...@ukr.net> on 2004/06/29 12:29:32 UTC

fd:repeater-action

Hello users,

Is any way to hide repeater-action button?
For instance when a repeater contains only one row it need hide the
button "Delete row".

Many thanks in advance.

-- 
Best regards,
Peter Velychko                         
v_peter@ukr.net


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


Re: fd:repeater-action

Posted by Peter Velychko <v_...@ukr.net>.
Hello Joerg,

Thank you for your advice. I'll try to use unions.

Wednesday, June 30, 2004, 4:37:56 AM, you wrote:

> On 29.06.2004 18:52, Peter Velychko wrote:

>> Hello Johnson,
>> 
>> Thank you for your reply.
>> Could you please describe your advice?

>> And requirements are the following:
>> - default (and minimal) qty of rows in repeater is 1
>> - user is able to add new row to repeater
>> - user is able to remove any of repeater's row when qty of rows is
>>   more than 1
>> - user cannot remove repeater's row when qty == 1
>> 
>> As I understand theoretically I can set up <fi:styling type='hidden'/>
>> for my repeater-action in JX template but I don't understand how.

> Setting it in the template would be statically and not what you want I 
> guess. And even if it is hidden or not in the HTML code at all it would 
> be possible to hack the URL to remove the last item.

> What you probably need is fd:union:
> http://wiki.cocoondev.org/Wiki.jsp?page=TimLarson
> Form model GUI sample.
> Though I can not imagine how to express the dependency on the repeater 
> size at the moment (it's just to late ;-). Maybe Tim can help here.

> Joerg

-- 
Best regards,
Peter Velychko                            
v_peter@ukr.net


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


Re: fd:repeater-action

Posted by Tim Larson <ti...@keow.org>.
On Wed, Jun 30, 2004 at 03:37:56AM +0200, Joerg Heinicke wrote:
> On 29.06.2004 18:52, Peter Velychko wrote:
> >Hello Johnson,
> >
> >Thank you for your reply.
> >Could you please describe your advice?
> 
> >And requirements are the following:
> >- default (and minimal) qty of rows in repeater is 1
> >- user is able to add new row to repeater
> >- user is able to remove any of repeater's row when qty of rows is
> >  more than 1
> >- user cannot remove repeater's row when qty == 1
> >
> >As I understand theoretically I can set up <fi:styling type='hidden'/>
> >for my repeater-action in JX template but I don't understand how.
> 
> Setting it in the template would be statically and not what you want I 
> guess. And even if it is hidden or not in the HTML code at all it would 
> be possible to hack the URL to remove the last item.
> 
> What you probably need is fd:union:
> http://wiki.cocoondev.org/Wiki.jsp?page=TimLarson
> Form model GUI sample.
> Though I can not imagine how to express the dependency on the repeater 
> size at the moment (it's just to late ;-). Maybe Tim can help here.

We _should_ add support for having the union be dependent on a
general expression instead of just a widget (patches welcome),
but for now you would setup event handlers to catch the row add
and delete events on the repeater widget, and use these handlers
to update a hidden output widget with the case values you want.
Then use this widget as the case-determining-widget for the union.

Rember you have other issues to deal with also, like deciding how
you want to handle a "delete 3 of 3 rows" request.  Do you delete
no rows then (and give the user some clue why you denied their
request?), or do you delete just 2 (which 2 do you choose?).

The "repeater action" widgets may not give you enough control,
since you cannot intercept them to change their behavior.
You might need to just use normal "action" widgets and make the
row add and delete calls manually against the repeater widget
via your custom action handlers.  You can use a "union" to hide
the action widget buttons when they really do not make sense
(like don't show the delete button when there is only 1 row),
but you might also need the extra control that normal "action"
widgets give so you can handle cases like the "delete 3 of 3
rows" example I gave above.

--Tim Larson

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


Re: fd:repeater-action

Posted by Joerg Heinicke <jo...@gmx.de>.
On 29.06.2004 18:52, Peter Velychko wrote:

> Hello Johnson,
> 
> Thank you for your reply.
> Could you please describe your advice?

> And requirements are the following:
> - default (and minimal) qty of rows in repeater is 1
> - user is able to add new row to repeater
> - user is able to remove any of repeater's row when qty of rows is
>   more than 1
> - user cannot remove repeater's row when qty == 1
> 
> As I understand theoretically I can set up <fi:styling type='hidden'/>
> for my repeater-action in JX template but I don't understand how.

Setting it in the template would be statically and not what you want I 
guess. And even if it is hidden or not in the HTML code at all it would 
be possible to hack the URL to remove the last item.

What you probably need is fd:union:
http://wiki.cocoondev.org/Wiki.jsp?page=TimLarson
Form model GUI sample.
Though I can not imagine how to express the dependency on the repeater 
size at the moment (it's just to late ;-). Maybe Tim can help here.

Joerg

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


Re: fd:repeater-action

Posted by Peter Velychko <v_...@ukr.net>.
Hello Johnson,

Thank you for your reply.
Could you please describe your advice?

My flowscript is like the following:

var form3 = new Form("forms/form_definition-3.xml");
var bindObj3 = loadDocument("cocoon:/auxiliary/form-binding_3-data.xml");
form3.createBinding("forms/form-binding-3.xml");
form3.load(bindObj3);
form3.showForm("screens/forms/"+lang+"/form-3.flow");
form3.save(bindObj3);

My sitemap snippet:
<map:match pattern="screens/forms/*/form-doc_*.flow">
  <map:generate type="file" src="xml/doc_{2}.xml"/>
    <map:transform type="cinclude"/>
  <map:transform type="xslt" src="stylesheets/doc.xsl"/>
  <map:transform type="forms"/>
  <map:transform type="i18n">
    <map:parameter name="locale" value="{1}"/>
  </map:transform>
  <map:transform type="jx"/>
  <map:transform type="xslt" src="resources/forms/forms-samples-styling.xsl"/>
  <map:transform type="omitns">
    <parameter name="omit-plain-xmlns" value="true"/>
  </map:transform>
  <map:serialize type="html"/>
</map:match>

And requirements are the following:
- default (and minimal) qty of rows in repeater is 1
- user is able to add new row to repeater
- user is able to remove any of repeater's row when qty of rows is
  more than 1
- user cannot remove repeater's row when qty == 1

As I understand theoretically I can set up <fi:styling type='hidden'/>
for my repeater-action in JX template but I don't understand how.

Tuesday, June 29, 2004, 7:03:09 PM, you wrote:

> Try use fi:styling type='hidden' in template

> Johnson
> ----- Original Message ----- 
> From: "Peter Velychko" <v_...@ukr.net>
> To: <us...@cocoon.apache.org>
> Sent: Tuesday, June 29, 2004 6:29 PM
> Subject: fd:repeater-action


>> Hello users,
>> 
>> Is any way to hide repeater-action button?
>> For instance when a repeater contains only one row it need hide the
>> button "Delete row".
>> 
>> Many thanks in advance.
>> 
>> -- 
>> Best regards,
>> Peter Velychko                         
>> v_peter@ukr.net
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>> 

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

-- 
Best regards,
Peter Velychko                            
v_peter@ukr.net


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


Re: fd:repeater-action

Posted by Johnson <jo...@soho.club.tw>.
Try use fi:styling type='hidden' in template

Johnson
----- Original Message ----- 
From: "Peter Velychko" <v_...@ukr.net>
To: <us...@cocoon.apache.org>
Sent: Tuesday, June 29, 2004 6:29 PM
Subject: fd:repeater-action


> Hello users,
> 
> Is any way to hide repeater-action button?
> For instance when a repeater contains only one row it need hide the
> button "Delete row".
> 
> Many thanks in advance.
> 
> -- 
> Best regards,
> Peter Velychko                         
> v_peter@ukr.net
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

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