[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
rendered flag in grids  XML
Forum Index -> Development
Author Message
hilka

Power User

Joined: 23/11/2007 09:00:08
Messages: 191
Offline

Hello,

I try to add a column to a grid depending on a boolean value of the grid item. In some cases I want to show a pure textfield, in other cases, if there is some valuehelper for this column, I want to show a combofield.

I tried to put these two controls within one gridcol, setting the rendered flag depending on the supportsValidValues flag in my grid item. This did not work. So I put two gridcols in the grid, one with the field, the other one with the combofield, and set the rendered flag of the gridcol depending on the item's flag value. This did not work either.

Is the rendered functionality missing for gridcols or is there any other way to implement this?

Tobias
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

Hi Tobias,

my "guess" would be:

FIXGRID
GRIDCOL
PANE
CONTROL1 WIDTH=100% RENDERED=...
CONTROL2 WIDTH=100% RENDERED=...

The approach...
GRIDCOL
CONTROL1
CONTROL2
...does not work, because only one item is allowed below GRIDCOL.

The other approach...
GRIDCOL
CONTROL1
GRIDCOL
CONTROL2
... does not work, because then you actually have two columns.

I'll try out somewhere today or tomorrow. If you try out as well, let us know...

Björn

Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

...do not try too much right now, just looking for a solution...

Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

...yes, the way I proposed is the way it works... but: unfortunately the "rendered" attribute is handled a bit special in JSF base classes, so an update is required. Please contact me directly.

I tried with the following layout:
Code:
     <t:fixgrid id="g_5" bordercolor="#D0D0D0" borderheight="1" borderwidth="1" objectbinding="#{wp.demoGridflexcols.rows}" sbvisibleamount="10" width="100%" >
       <t:gridcol id="g_6" text="Control Type" width="100" >
         <t:combobox id="g_7" flush="true" validvaluesbinding=".{rowControlTypes}" value=".{controlType}" />
       </t:gridcol>
       <t:gridcol id="g_8" text="First Name" width="100%" >
         <t:pane id="g_9" >
           <t:row id="g_10" >
             <t:field id="g_11" border="top:0;left:0;bottom:0;right:0" height="100%" rendered=".{fieldRendered}" text=".{firstName}" width="100%" />
             <t:combofield id="g_12" border="top:0;left:0;bottom:0;right:0" height="100%" rendered=".{comboFieldRendered}" text=".{firstName}" width="100%" />
           </t:row>
         </t:pane>
       </t:gridcol>
       <t:gridcol id="g_13" text="Field" width="50" >
         <t:checkbox id="g_14" enabled="false" selected=".{fieldRendered}" />
       </t:gridcol>
       <t:gridcol id="g_15" text="Field" width="50" >
         <t:checkbox id="g_16" enabled="false" selected=".{comboFieldRendered}" />
       </t:gridcol>
     </t:fixgrid>
 

Björn Müller, CaptainCasa GmbH
hilka

Power User

Joined: 23/11/2007 09:00:08
Messages: 191
Offline

Hello Björn,

thanks for your help. I will wait for the next update before I go on working on this.

Tobias
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team