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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Sachin kolpuke-2
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


Reply | Threaded
Open this post in threaded view
|

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

Vikas Mayur-2
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 <[hidden email]>
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
>
>
>
Reply | Threaded
Open this post in threaded view
|

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

Sachin kolpuke-2
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 <[hidden email]>
> 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
>>
>>
>>
>>    
>
>  

Reply | Threaded
Open this post in threaded view
|

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

Jyotsna Rathore
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
>> <[hidden email]>
>> 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
>>>
>>>
>>>
>>>    
>>
>>  
>
>