[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Fix first column when horizontally scrolling  XML
Forum Index -> Development
Author Message
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

For a FIXGRID with a lot of columns, I would like to fix the first one when scrolling horizontally towards right. This would be analogous to the capability of GRIDFOOTER of staying always visible when scrolling down.

Do you see possibilities to provide that?

Regards, Daniel
[WWW]
CaptainCasa

Power User
[Avatar]

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

Hi,

there is a proposal for this within the demo workplace - please check the demo "Grids and Trees > Special Issues > Fix Columns".

Would this fit to what you want to do?

Regards, Björn

Björn Müller, CaptainCasa GmbH
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Yes, it is exactly what I need, thank you very much.

Daniel
[WWW]
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

There is a challenge here if we want to export by means of CaptainCasa's grid functions the whole table including the fix columns. I have puzzled out a workaround. Lets explain it with the demo workplace example:

In the left splitpanesplit, the fixgrid would contain all the columns, but the columns "Id" and "LastName" would have fix width, the fixgrid's witdh would be the sum of both widths. This way, the rest of the columns are hidden on display but can be exported.

It is somehow tricky, but basically it should work. What do you think about? Are there alternatives?

Regards, Daniel

[WWW]
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

I have detected a major difficulty with the workaround explained above.
The user configuration (add/remove columns, change column position, user sorting,..) of the fixgrid in the right side splitpanesplit won't be effective for the export function (applied on the left side fixgrid).

I need good advice...

Regards, Daniel
[WWW]
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

I the meantime, I had an idea: export the grid on the right side with
overwriting of the method createDocument in FIXGRIDPDFExporter: passing a postprocessed list of columns with the fix columns on the left added.

But what about CSV export? I wonder if there is a simpler solution for all this.

Regards, Daniel
[WWW]
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

Finally, it was not necessary to overwrite FIXGRIDPDFExporter. I just copied the gridcols from the left split pane to the right split pane an set their attribute "rendered" to false. To my surprise, not rendered columns are nevertheless exported.

For my purposes, this behaviour is ok. But I can imagine that someone would expect that not rendered columns are not exported. Bjoern, if you change something on this behaviour please tell us.

Regards, Daniel
[WWW]
CaptainCasa

Power User
[Avatar]

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

...this is, what I expected, too...

But we'll better check, now. We will definitely warn you, before changing some behaviour with the export....

Regards, Björn

Björn Müller, CaptainCasa GmbH
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

I come back to this issue because the current solution doesn't work after using the "onEditColumnDetails" feature.

If we remove a column through "onEditColumnDetails" window, then a subsequent export doesn't export the "not rendered" columns any more.
A further side effect is: the columns on the left split pane are no longer visible, they reflect the "not rendered"-attribute of their counterpart columns on the right split pane.

Can you reproduce that (may be in the demo "Grids and Trees > Special Issues > Fix Columns")?

Regards, Daniel
[WWW]
CaptainCasa

Power User
[Avatar]

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

...will check, but somewhere in this late afternoon. So a bit of patience required on your side...

Regards, Björn

Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

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

Hi,

(A) we can reproduce that once you update the column sequence / columns visiibility that then only these columns are rendered that actually are visible. Well, I see this to be more correct than columns being exported that have a rendered=false flag...

(B) We cannot reproduce what you say with disappeariing columns on the left grid when updating column information on the right grid.

(ad A) We will now change the behaviour, so that it behaves properly also for the rendered=false case - i.e. corresponding columns will not be exported anymore. This is, we believe, what the expectation of the export is... And we will give you a possibility to somehow add your additional columns into the export result.

Regards, Björn

Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

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

....so, we now changed/rightsized the export behaviour:

(1) the export will by default not export columns with rendered=false

(2) Columns that are defined with rendered=false can be explicitly added to the export-column list by corresponding API at FIXGRIDLBinding.getExporter() - see example below

Regards, Björn

The .jsp definition - it contains the Id-column as first column, which is rendered=false.
Code:
 <t:fixgrid id="g_6" bordercolor="#00000030" borderheight="1"
 	borderwidth="1"
 	objectbinding="#{wp.DemoGridExportHiddenColumns.grid}"
 	sbvisibleamount="10" width="100%">
 	<t:gridcol id="g_7" rendered="false" text="Id" width="100">
 		<t:field id="g_8" text=".{id}" width="100" />
 	</t:gridcol>
 	<t:gridcol id="g_9" text="First Name" width="50%">
 		<t:field id="g_10" text=".{firstName}" width="100" />
 	</t:gridcol>
 	<t:gridcol id="g_11" text="Last Name" width="50%">
 		<t:field id="g_12" text=".{lastName}" width="100" />
 	</t:gridcol>
 </t:fixgrid>
 


And the .java code - there is a method call getExporter().getAdditionalExportColumnsLeft called in the iniitlaize() method of the MyGrid class.
Code:
 package workplace;
 
 import java.io.Serializable;
 
 import org.eclnt.editor.annotations.CCGenClass;
 import org.eclnt.jsfserver.elements.impl.FIXGRIDItem;
 import org.eclnt.jsfserver.elements.impl.FIXGRIDListBinding;
 import org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo;
 import org.eclnt.workplace.IWorkpageDispatcher;
 import org.eclnt.workplace.WorkpageDispatchedBean;
 
 @CCGenClass (expressionBase="#{wp.DemoGridExportHiddenColumns}")
 
 public class DemoGridExportHiddenColumns
     extends WorkpageDispatchedBean 
     implements Serializable
 {
     public class GridItem extends FIXGRIDItem implements java.io.Serializable
     {
         protected String m_id;
         public String getId() { return m_id; }
         public void setId(String value) { m_id = value; }
 
         protected String m_lastName;
         public String getLastName() { return m_lastName; }
         public void setLastName(String value) { m_lastName = value; }
 
         protected String m_firstName;
         public String getFirstName() { return m_firstName; }
         public void setFirstName(String value) { m_firstName = value; }
 
     }
     
     public class MyGrid extends FIXGRIDListBinding<GridItem>
     {
         @Override
         public void initialize()
         {
             super.initialize();
             // important: this needs to be done in the initialize() method, not in
             // the constructor - the initialize method is called when the grid object
             // is connected to its server side component
             ColumnInfo ci = m_grid.getColumnInfos().get(0); // the "id-column"
             m_grid.getExporter().getAdditionalExportColumnsLeft().add(ci);
         }
     }
 
     // ------------------------------------------------------------------------
     // constructors & initialization
     // ------------------------------------------------------------------------
 
 	public DemoGridExportHiddenColumns(IWorkpageDispatcher workpageDispatcher)
     {
         super(workpageDispatcher);        
         for (int i=0; i<50; i++)
         {
             GridItem gi = new GridItem();
             gi.setId("ID " + i);
             gi.setFirstName("FirstName " + i);
             gi.setLastName("LastName " + i);
             m_grid.getItems().add(gi);
         }
     }
 
     protected MyGrid m_grid = new MyGrid();
     public MyGrid getGrid() { return m_grid; }
 
 }
 

Björn Müller, CaptainCasa GmbH
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

Now it is all ok.

- Point (A) is ok after the newest CC release.
- Point (B) is ok now that I followed the demo example code closer.

Thank you very much!

Regards, Daniel
[WWW]
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team