You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Sachin Kolpuke <sa...@in2m.com> on 2008/03/13 11:14:02 UTC

Is there any way to omit column (having all fields empty) from Table which is displayed using HtmlWrapper (xml file)

Hi,

    We are displaying table in the ftl page using the list wrapper in 
OFBiz, to display data we have created following forms.
    <form name="listUsers" type="list"
            title="SearchResults" list-name="users"
           default-title-style="tableheadtext"
        default-tooltip-style="tabletext" default-widget-style="display" 
paginate-target="/welcome" >
          <field name="partyId" title="Party ID" 
widget-style="tabletext"><display also-hidden="false"/></field>
        <field name="orderId" title="Order ID" 
widget-style="tabletext">  <display also-hidden="false"/> </field>
        <field name="first" title="First Name" 
widget-style="tabletext">  <display also-hidden="false"/></field>
        <field name="last" title="Last Name" widget-style="tabletext">  
<display also-hidden="false"/></field>
        <field name="email" title="Email" widget-style="tabletext">  
<display also-hidden="false"/></field>
        <field name="phone" title="Phone" 
widget-style="tabletext"><display also-hidden="false"/> </field>
....................................
</form>   

    now we don't want to display the columns which has all fields as 
empty, i.e. if all users don't have email (email value is empty) then 
don't display the column email.  Is there any way to omit these empty 
fields ?


Thanks
Sachin



Re: Is there any way to omit column (having all fields empty) from Table which is displayed using HtmlWrapper (xml file)

Posted by Jyotsna <jy...@hotwaxmedia.com>.
Sachin,
       
 I think you will have to write both cases (display/hidden) in this way 
to make it work...

  <field name="email" use-when="email == null"><hidden/></field>
  <field name="email" use-when="email != null"><display/></field>

Thanks & Regards,
Jyotsna Rathore



Sachin Kolpuke wrote:
> Vikas,
>
>    I tried the given solution but its not working. When I added the 
> use when i.e.
> i.e. added  use-when="email==null"
> and hidden tag i.e. <hidden/>.
> due to addition of <hidden/> tag the field is always hidden, i.e. not 
> displaying. even though email contains some value its not displayed.
>
> Also i tried by only using use-when but its not working as per the 
> expectation
>
>        <field name="activationCode" use-when="activationCode!=null" 
> title="activationCode" widget-style="tabletext"> <display 
> also-hidden="false"/></field>
> is there any thing wrong? is there any way to achieve it?
>
> Thanks
> Sachin
>
>> Sachin, Not sure about not displaying the whole column, but you can use
>> use-when attribute to display / hide a field on some conditions, 
>> empty check
>> in your case, like
>>  <field name="email" use-when="email==null"><hidden/></field>
>>
>> Vikas
>>
>> On Thu, Mar 13, 2008 at 3:44 PM, Sachin Kolpuke 
>> <sa...@in2m.com>
>> wrote:
>>
>>  
>>> Hi,
>>>
>>>    We are displaying table in the ftl page using the list wrapper in
>>> OFBiz, to display data we have created following forms.
>>>    <form name="listUsers" type="list"
>>>            title="SearchResults" list-name="users"
>>>           default-title-style="tableheadtext"
>>>        default-tooltip-style="tabletext" default-widget-style="display"
>>> paginate-target="/welcome" >
>>>          <field name="partyId" title="Party ID"
>>> widget-style="tabletext"><display also-hidden="false"/></field>
>>>        <field name="orderId" title="Order ID"
>>> widget-style="tabletext">  <display also-hidden="false"/> </field>
>>>        <field name="first" title="First Name"
>>> widget-style="tabletext">  <display also-hidden="false"/></field>
>>>        <field name="last" title="Last Name" widget-style="tabletext">
>>> <display also-hidden="false"/></field>
>>>        <field name="email" title="Email" widget-style="tabletext">
>>> <display also-hidden="false"/></field>
>>>        <field name="phone" title="Phone"
>>> widget-style="tabletext"><display also-hidden="false"/> </field>
>>> ....................................
>>> </form>
>>>
>>>    now we don't want to display the columns which has all fields as
>>> empty, i.e. if all users don't have email (email value is empty) then
>>> don't display the column email.  Is there any way to omit these empty
>>> fields ?
>>>
>>>
>>> Thanks
>>> Sachin
>>>
>>>
>>>
>>>     
>>
>>   
>
>

Re: Is there any way to omit column (having all fields empty) from Table which is displayed using HtmlWrapper (xml file)

Posted by Sachin Kolpuke <sa...@in2m.com>.
Vikas,

    I tried the given solution but its not working. When I added the use 
when i.e.
i.e. added  use-when="email==null"
and hidden tag i.e. <hidden/>.
 due to addition of <hidden/> tag the field is always hidden, i.e. not 
displaying. even though email contains some value its not displayed.

Also i tried by only using use-when but its not working as per the 
expectation

        <field name="activationCode" use-when="activationCode!=null" 
title="activationCode" widget-style="tabletext">
            <display also-hidden="false"/>
        </field>
is there any thing wrong? is there any way to achieve it?

Thanks
Sachin

> Sachin, Not sure about not displaying the whole column, but you can use
> use-when attribute to display / hide a field on some conditions, empty check
> in your case, like
>  <field name="email" use-when="email==null"><hidden/></field>
>
> Vikas
>
> On Thu, Mar 13, 2008 at 3:44 PM, Sachin Kolpuke <sa...@in2m.com>
> wrote:
>
>   
>> Hi,
>>
>>    We are displaying table in the ftl page using the list wrapper in
>> OFBiz, to display data we have created following forms.
>>    <form name="listUsers" type="list"
>>            title="SearchResults" list-name="users"
>>           default-title-style="tableheadtext"
>>        default-tooltip-style="tabletext" default-widget-style="display"
>> paginate-target="/welcome" >
>>          <field name="partyId" title="Party ID"
>> widget-style="tabletext"><display also-hidden="false"/></field>
>>        <field name="orderId" title="Order ID"
>> widget-style="tabletext">  <display also-hidden="false"/> </field>
>>        <field name="first" title="First Name"
>> widget-style="tabletext">  <display also-hidden="false"/></field>
>>        <field name="last" title="Last Name" widget-style="tabletext">
>> <display also-hidden="false"/></field>
>>        <field name="email" title="Email" widget-style="tabletext">
>> <display also-hidden="false"/></field>
>>        <field name="phone" title="Phone"
>> widget-style="tabletext"><display also-hidden="false"/> </field>
>> ....................................
>> </form>
>>
>>    now we don't want to display the columns which has all fields as
>> empty, i.e. if all users don't have email (email value is empty) then
>> don't display the column email.  Is there any way to omit these empty
>> fields ?
>>
>>
>> Thanks
>> Sachin
>>
>>
>>
>>     
>
>   


Re: Is there any way to omit column (having all fields empty) from Table which is displayed using HtmlWrapper (xml file)

Posted by Vikas Mayur <vi...@gmail.com>.
Sachin, Not sure about not displaying the whole column, but you can use
use-when attribute to display / hide a field on some conditions, empty check
in your case, like
 <field name="email" use-when="email==null"><hidden/></field>

Vikas

On Thu, Mar 13, 2008 at 3:44 PM, Sachin Kolpuke <sa...@in2m.com>
wrote:

> Hi,
>
>    We are displaying table in the ftl page using the list wrapper in
> OFBiz, to display data we have created following forms.
>    <form name="listUsers" type="list"
>            title="SearchResults" list-name="users"
>           default-title-style="tableheadtext"
>        default-tooltip-style="tabletext" default-widget-style="display"
> paginate-target="/welcome" >
>          <field name="partyId" title="Party ID"
> widget-style="tabletext"><display also-hidden="false"/></field>
>        <field name="orderId" title="Order ID"
> widget-style="tabletext">  <display also-hidden="false"/> </field>
>        <field name="first" title="First Name"
> widget-style="tabletext">  <display also-hidden="false"/></field>
>        <field name="last" title="Last Name" widget-style="tabletext">
> <display also-hidden="false"/></field>
>        <field name="email" title="Email" widget-style="tabletext">
> <display also-hidden="false"/></field>
>        <field name="phone" title="Phone"
> widget-style="tabletext"><display also-hidden="false"/> </field>
> ....................................
> </form>
>
>    now we don't want to display the columns which has all fields as
> empty, i.e. if all users don't have email (email value is empty) then
> don't display the column email.  Is there any way to omit these empty
> fields ?
>
>
> Thanks
> Sachin
>
>
>