You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Paul G. Joseph" <pj...@gmail.com> on 2013/10/16 16:41:27 UTC

"hiding" a multiselect field widget

Hi there,

I have a form in Flow Script (Cocoon 2.1.11) with many different widgets.

I use this definition in two different form templates--in one I hide 
some widgets, and in the other I hide some different ones.

All works well, except when I define a multi-select widget.

My definition seems pretty standard:
<fd:multivaluefield id="multi" required="false">
<fd:datatype base="string"/>
<fd:selection-list>
<fd:item value=""/>
<fd:item value="cat"/>
<fd:item value="dog"/>
<fd:item value="mouse"/>
</fd:selection-list>
</fd:multivaluefield>

I need to keep this widget on each of the two forms to preserve its 
value as the user clicks between forms without needing to save it to the 
database till they click a Save button.  In one form I need this widget 
to be visible, but not on the other.

But it does not "hide" when I try to hide it using: <ft:widget 
id="multi" ><fi:styling type="hidden"/></ft:widget>

I tried with Firefox 23.0.1, IE8 and it makes no difference.

However, if in the form definition, I change the definition to an 
ordinary list by replacing "multivaluedfield" by "field", then the 
styling command to hide it works correctly.

Is this a known problem with the multi-select widget, and is there a 
workaround?

Paul


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


Re: "hiding" a multiselect field widget

Posted by "Paul G. Joseph" <pj...@gmail.com>.
Hi Gary,

That worked. IAll I had to do was change field to multivaluefield and 
bingo, it did the job!

<xsl:template match="fi:multivaluefield[fi:styling/@type='hidden']" 
priority="2">
     <input type="hidden" name="{@id}" id="{@id}" value="{fi:value}">
       <xsl:apply-templates select="." mode="styling"/>
     </input>
   </xsl:template>

thanks!
Paul

On 10/16/2013 11:01 AM, Gary Larsen wrote:
> Hi Paul,
>
> I'm using 2.1.7.  You may need to add a template to
> forms-advanced-field-styling.xsl.  There is something for fi:field in
> forms-field-styling.xsl:
>
> <xsl:template match="fi:field[fi:styling/@type='hidden']" priority="2">
>      <input type="hidden" name="{@id}" id="{@id}" value="{fi:value}">
>        <xsl:apply-templates select="." mode="styling"/>
>      </input>
>    </xsl:template>
>
>
> Gary
>
> -----Original Message-----
> From: Paul G. Joseph [mailto:pjoseph@gmail.com]
> Sent: Wednesday, October 16, 2013 10:41 AM
> To: users@cocoon.apache.org
> Subject: "hiding" a multiselect field widget
>
> Hi there,
>
> I have a form in Flow Script (Cocoon 2.1.11) with many different widgets.
>
> I use this definition in two different form templates--in one I hide some
> widgets, and in the other I hide some different ones.
>
> All works well, except when I define a multi-select widget.
>
> My definition seems pretty standard:
> <fd:multivaluefield id="multi" required="false"> <fd:datatype
> base="string"/> <fd:selection-list> <fd:item value=""/> <fd:item
> value="cat"/> <fd:item value="dog"/> <fd:item value="mouse"/>
> </fd:selection-list> </fd:multivaluefield>
>
> I need to keep this widget on each of the two forms to preserve its value as
> the user clicks between forms without needing to save it to the database
> till they click a Save button.  In one form I need this widget to be
> visible, but not on the other.
>
> But it does not "hide" when I try to hide it using: <ft:widget id="multi"
>> <fi:styling type="hidden"/></ft:widget>
> I tried with Firefox 23.0.1, IE8 and it makes no difference.
>
> However, if in the form definition, I change the definition to an ordinary
> list by replacing "multivaluedfield" by "field", then the styling command to
> hide it works correctly.
>
> Is this a known problem with the multi-select widget, and is there a
> workaround?
>
> Paul
>
>
> ---------------------------------------------------------------------
> 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
>
>


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


Re: "hiding" a multiselect field widget

Posted by "Paul G. Joseph" <pj...@gmail.com>.
Wow, thanks Gary!  Will give it a shot and keep you posted.
Paul

On 10/16/2013 11:01 AM, Gary Larsen wrote:
> Hi Paul,
>
> I'm using 2.1.7.  You may need to add a template to
> forms-advanced-field-styling.xsl.  There is something for fi:field in
> forms-field-styling.xsl:
>
> <xsl:template match="fi:field[fi:styling/@type='hidden']" priority="2">
>      <input type="hidden" name="{@id}" id="{@id}" value="{fi:value}">
>        <xsl:apply-templates select="." mode="styling"/>
>      </input>
>    </xsl:template>
>
>
> Gary
>
> -----Original Message-----
> From: Paul G. Joseph [mailto:pjoseph@gmail.com]
> Sent: Wednesday, October 16, 2013 10:41 AM
> To: users@cocoon.apache.org
> Subject: "hiding" a multiselect field widget
>
> Hi there,
>
> I have a form in Flow Script (Cocoon 2.1.11) with many different widgets.
>
> I use this definition in two different form templates--in one I hide some
> widgets, and in the other I hide some different ones.
>
> All works well, except when I define a multi-select widget.
>
> My definition seems pretty standard:
> <fd:multivaluefield id="multi" required="false"> <fd:datatype
> base="string"/> <fd:selection-list> <fd:item value=""/> <fd:item
> value="cat"/> <fd:item value="dog"/> <fd:item value="mouse"/>
> </fd:selection-list> </fd:multivaluefield>
>
> I need to keep this widget on each of the two forms to preserve its value as
> the user clicks between forms without needing to save it to the database
> till they click a Save button.  In one form I need this widget to be
> visible, but not on the other.
>
> But it does not "hide" when I try to hide it using: <ft:widget id="multi"
>> <fi:styling type="hidden"/></ft:widget>
> I tried with Firefox 23.0.1, IE8 and it makes no difference.
>
> However, if in the form definition, I change the definition to an ordinary
> list by replacing "multivaluedfield" by "field", then the styling command to
> hide it works correctly.
>
> Is this a known problem with the multi-select widget, and is there a
> workaround?
>
> Paul
>
>
> ---------------------------------------------------------------------
> 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
>
>


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


RE: "hiding" a multiselect field widget

Posted by Gary Larsen <ga...@envisn.com>.
Hi Paul,

I'm using 2.1.7.  You may need to add a template to
forms-advanced-field-styling.xsl.  There is something for fi:field in
forms-field-styling.xsl:

<xsl:template match="fi:field[fi:styling/@type='hidden']" priority="2">
    <input type="hidden" name="{@id}" id="{@id}" value="{fi:value}">
      <xsl:apply-templates select="." mode="styling"/>
    </input>
  </xsl:template>


Gary

-----Original Message-----
From: Paul G. Joseph [mailto:pjoseph@gmail.com] 
Sent: Wednesday, October 16, 2013 10:41 AM
To: users@cocoon.apache.org
Subject: "hiding" a multiselect field widget

Hi there,

I have a form in Flow Script (Cocoon 2.1.11) with many different widgets.

I use this definition in two different form templates--in one I hide some
widgets, and in the other I hide some different ones.

All works well, except when I define a multi-select widget.

My definition seems pretty standard:
<fd:multivaluefield id="multi" required="false"> <fd:datatype
base="string"/> <fd:selection-list> <fd:item value=""/> <fd:item
value="cat"/> <fd:item value="dog"/> <fd:item value="mouse"/>
</fd:selection-list> </fd:multivaluefield>

I need to keep this widget on each of the two forms to preserve its value as
the user clicks between forms without needing to save it to the database
till they click a Save button.  In one form I need this widget to be
visible, but not on the other.

But it does not "hide" when I try to hide it using: <ft:widget id="multi"
><fi:styling type="hidden"/></ft:widget>

I tried with Firefox 23.0.1, IE8 and it makes no difference.

However, if in the form definition, I change the definition to an ordinary
list by replacing "multivaluedfield" by "field", then the styling command to
hide it works correctly.

Is this a known problem with the multi-select widget, and is there a
workaround?

Paul


---------------------------------------------------------------------
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