tablePane column wrapping

94 views
Skip to first unread message

mathew....@googlemail.com

unread,
Oct 2, 2007, 6:46:13 AM10/2/07
to InterSystems: Zen Community
Hello,

I'm having a bit of a problem between IE and other browsers:

In the other browsers (Firefox and Opera) my tablePane will not auto
wrap text in columns. This is how the table should look:
http://img218.imageshack.us/img218/2950/firefoxpz4.jpg

But in IE the column will autowrap and change the size of the table,
this is no good as I am using absolute positioning on my pages:
http://img215.imageshack.us/img215/2631/ieel8.jpg

I have tried setting nowrap="true" in the tablePane, but this has not
done anything.

I don't really want to have to set the CSS styles for the table pane
in every page, could someone give me a workaround for this?

Thanks.

Albert Goins

unread,
Oct 2, 2007, 7:06:01 AM10/2/07
to InterSystems: Zen Community
Hello,

I think this is a bug. I have duplicated this and will talk to
development.

-Al

On Oct 2, 6:46 am, "mathew.march...@googlemail.com"

mathew....@googlemail.com

unread,
Oct 2, 2007, 9:53:34 AM10/2/07
to InterSystems: Zen Community
Also related to this is using sql functions to create on-the-fly
columns:
Example
<column colName="column1-column2 As Disc" header="Disc" width="20" />
Will always create a column much larger than it's width.

Is this another bug? or do I need to do something else?

On Oct 2, 12:06 pm, Albert Goins <Albert.Go...@intersystems.com>
wrote:

Albert Goins

unread,
Oct 2, 2007, 10:04:04 AM10/2/07
to InterSystems: Zen Community
Hello,

I'm sorry, I don't quite understand. The column name is defined by
the query. What do you expect "column1-column2 As Disc" to do? I
believe the only acceptable values for colName are the literal column
name or some Zen Runtime Expression that will result in a valid column
name. If your query contained an aggregate function that was renamed
with "As", then the column name should be whatever the As defined the
column name.

-Al


On Oct 2, 9:53 am, "mathew.march...@googlemail.com"

mathew....@googlemail.com

unread,
Oct 2, 2007, 10:13:29 AM10/2/07
to InterSystems: Zen Community
column1-column2 As Disc does exactly what the SQL should do, In my
case:
NetPrice-DiscountedPrice (With the column header Disc):
http://img221.imageshack.us/img221/6759/discmi1.jpg
The problem is that the column ignores the header="" and width=""
values in the XDATA statement.

Albert Goins

unread,
Oct 2, 2007, 10:19:06 AM10/2/07
to InterSystems: Zen Community
Could you send me your entire <tablePane> tag?

-Al

On Oct 2, 10:13 am, "mathew.march...@googlemail.com"

mathew....@googlemail.com

unread,
Oct 2, 2007, 10:23:33 AM10/2/07
to InterSystems: Zen Community
<tablePane id="OrderGrid" width="760px"
tableName="Net.NetBasket_Items" whereClause="1=0"
enclosingStyle="position: absolute; top: 30px; left: 10px;"
pageSize="11" showRowSelector="false" showRowNumbers="true"
maxRows="1000" useSnapshot="true">
<column colName="Items_PartId" header="Part" width="50" />
<column colName="Items_Description" header="Description" width="150" /
>
<column colName="Items_UnitGrossValue" header="Price" width="50" />
<column colName="Items_VATCode" header="V" width="15" />
<column colName="Items_QuantityRequired" header="Reqd" width="60" />
<!-- Placeholders -->
<column colName="" header="Alloc" width="60" />
<column colName="" header="B/L" width="40" />
<column colName="" header="S" width="15" />
<!-- End Placeholders -->
<column colName="Items_ExtendedNetValue-Items_ExtendedDiscountValue

As Disc" header="Disc" width="20" />
<column colName="Items_ExtendedGrossValue" header="Total" width="60" /
>
</tablePane>

mathew....@googlemail.com

unread,
Oct 2, 2007, 10:26:06 AM10/2/07
to InterSystems: Zen Community
Google Groups seems to have added extra line breaks and removed >
characters in places

On Oct 2, 3:23 pm, "mathew.march...@googlemail.com"

Albert Goins

unread,
Oct 2, 2007, 10:38:55 AM10/2/07
to InterSystems: Zen Community
Hello,

I see now. You are using the "general description" method of
constructing the SQL. We should probably update the documentation for
the colName control to reflect this capability.

As for the "width" issue, I will investigate.

Thanks,
Al

On Oct 2, 10:26 am, "mathew.march...@googlemail.com"

Maxim Vershinin

unread,
Oct 2, 2007, 12:07:21 PM10/2/07
to InterSys...@googlegroups.com
Hello,

Maybe I was doing something wrong, but I wasn't able to force onclick
action to work for a simple dynaGrid component. Could you advise me,
what I was doing wrong, please?

XData Contents [XMLNamespace="http://www.intersystems.com/zen"]
{
<page xmlns="http://www.intersystems.com/zen" title="">
<dynaGrid id="dynaGrid" onclick="zenPage.test();">
<gridRow label="row1"/>
<gridRow label="row2"/>
<gridColumn id="col1" label="col1"/>
<gridColumn id="col2" label="col2"/>
</dynaGrid>

</page>
}

Method test() [ Language = javascript ]
{
alert('OK');
}

Thanks,
Maxim

Maxim Vershinin

unread,
Oct 2, 2007, 12:28:58 PM10/2/07
to InterSys...@googlegroups.com
I have the same concern for onkey... actions.

Thanks,
Maxim

Alex Schaefer

unread,
Oct 3, 2007, 7:53:41 AM10/3/07
to InterSys...@googlegroups.com
Are you trying to use a generic onclick for the entire dynaGrid? I have implemented row click, column click, cell click, and cell double click before. I am guessing the question is do you want one event that fires for all of these no matter where you click?
Respectfully
Alex Schaefer

Integration Specialist
InterSystems Corporation



Susan Korgen

unread,
Oct 3, 2007, 8:25:17 AM10/3/07
to InterSystems: Zen Community
Hi Al,

What needs to be added to the documentation? Let me know and I'll add
it.
Here is the current description of the colName attribute for
<tablePane>:

The name of the SQL data column that this column is associated with.
The colName value can be a literal string, or it can contain a Zen
#()# expression. See Zen Runtime Expressions.
If any colName values in the <tablePane> are duplicates, the second
column displays as "(duplicate) colName" to indicate that unless the
second column is renamed, <tablePane> behavior will be unexpected.
If no colName is specified for a column, the column is displayed
without a data value. Typically this technique is used to display a
link action in a row.

Thanks,
Susan

On Oct 2, 10:38 am, Albert Goins <Albert.Go...@intersystems.com>

> > > > > > > > > Thanks.- Hide quoted text -
>
> - Show quoted text -

Albert Goins

unread,
Oct 3, 2007, 8:36:43 AM10/3/07
to InterSystems: Zen Community
Hello,

It seems that it is also possible to put SQL style functions and
aliasing in the colName as this user is doing with:

<column colName="Items_ExtendedNetValue-Items_ExtendedDiscountValue
As Disc" header="Disc" width="20" />

I just tested this myself in ZENTest.TableTest with:

<column colName="Salary-1000 As SalaryMinus1000" width="10"
filterType="text"
filterOp="BETWEEN"
filterLabel=" Range (Min,Max):"
/>
Or:

<column colName="max(Salary) As SalaryMax" width="100"
filterType="text"
filterOp="BETWEEN"
filterLabel=" Range (Min,Max):"
/>

Also, I was unable to duplicate the width issue in this case in either
Firefox or IE 7.

-Al

Maxim Vershinin

unread,
Oct 3, 2007, 8:39:42 AM10/3/07
to InterSys...@googlegroups.com

Yes, I am trying to use a generic one. Since it is available for dynaGrid, I was expecting it would be possible to use it. Also, as I mentioned before, I was trying onkey… events and they didn’t work too. As I understand these events are used by dynaGrid itself to highlight, select and edit cells, but having access to those ‘on<smth> properties mean that you can add functionality if needed. E.g. our client wants to start editing values by using single click instead of double click, so I was thinking about using onclick action to switch particular cell into the edit mode.

You are right onclickrow and onclickcolumn work fine.

 

Cheers,

Maxim

 


Susan Korgen

unread,
Oct 3, 2007, 8:46:38 AM10/3/07
to InterSystems: Zen Community
I see. Thanks, Al.

> > > - Show quoted text -- Hide quoted text -

Alex Schaefer

unread,
Oct 3, 2007, 9:13:44 AM10/3/07
to InterSys...@googlegroups.com
As for onkey events:
JMD282 - Add support for keypress,keydown for Zen dynaGrid
If you define onkeypress or onkeydown for dynaGrid these will now be called

This change went into Cache 2007.2.

My guess for onclick is that this is for the control itself but as all the more specific events exist those take precedence? Would require some testing though.

Funny thing is that I am pretty sure I have heard the same question just today and was wondering why editing a cell requires a double click? I only click once and start typing?

On Oct 3, 2007, at 8:39 AM, Maxim Vershinin wrote:

Yes, I am trying to use a generic one. Since it is available for dynaGrid, I was expecting it would be possible to use it. Also, as I mentioned before, I was trying onkey... events and they didn't work too. As I understand these events are used by dynaGrid itself to highlight, select and edit cells, but having access to those 'on<smth> properties mean that you can add functionality if needed. E.g. our client wants to start editing values by using single click instead of double click, so I was thinking about using onclick action to switch particular cell into the edit mode.

Maxim Vershinin

unread,
Oct 3, 2007, 12:35:28 PM10/3/07
to InterSys...@googlegroups.com

I believe if there is a possibility to specify onclick action, then it should work, otherwise it is confusing. As I could see there is no other possibility to specify this action for cells. onclickrow and onclickcolumn work only for row/column titles, but not inside the grid.

Alex Schaefer

unread,
Oct 4, 2007, 3:59:50 AM10/4/07
to InterSys...@googlegroups.com
The component itself offers a cell click handler and a cell double click handler, you can override those.

Maxim Vershinin

unread,
Oct 4, 2007, 5:22:24 AM10/4/07
to InterSys...@googlegroups.com

Alex,

 

Thank you for your answer. Yes, component offers these handlers, so I tried to override those handlers and they don’t work too.  And I still believe that if we offer user a possibility to specify onclick property, it should work.

By the way, I was trying to workaround the problem, using onselectcell attribute of the component and I noticed that it invokes specified method for 3 times and also trying to get selected row and cell in the method returns values of a previously selected cell, so you can’t do anything with a cell which is being selected.

 

Regards,

{

<page xmlns="http://www.intersystems.com/zen" title="">

<dynaGrid id="dynaGrid" onclick="zenPage.test();">

<gridRow label="row1"/>

<gridRow label="row2"/>

<gridColumn id="col1" label="col1"/>

<gridColumn id="col2" label="col2"/>

</dynaGrid>

</page>

}

Method test() [ Language = javascript ]

{

alert('OK');

}

Thanks,

Maxim

Alex Schaefer

InterSystems Corporation











Respectfully

Alex Schaefer

Integration Specialist

InterSystems Corporation




 

Alex Schaefer

unread,
Oct 4, 2007, 5:25:08 AM10/4/07
to InterSys...@googlegroups.com
I have used the cell click handlers without problems before, can you please post a simple sample? I agree with you in general, but frankly how would you expect onclick to work for a dynaGrid? Aren't you trying to influence the cell click specifically? I'm not sure why you want the click for the entire component to work.

Maxim Vershinin

unread,
Oct 4, 2007, 6:26:25 AM10/4/07
to Alex Schaefer, InterSys...@googlegroups.com

Thank you,

Yes, you are right, stupid mistake, because, I was more thinking about dynaGrig attributes so I treated handlers the same automatically.

So, this works for handlers:

 

/// User.MyGrid
Class User.MyGrid Extends %ZEN.Component.dynaGrid
{

Parameter NAMESPACE = "http://www.intersystems.com/myApp";

Method cellClickHandler(row, col) [ Language = javascript ]
{
alert('cellClickHandler - ' + row + ':' + col);
}

}

 

 

Anyway, I think oncklick thing should be reported as a problem

 

Cheers,

Maxim

 


From: Alex Schaefer [mailto:Alex.S...@intersystems.com]
Sent: 04 October 2007 11:09
To: Maxim Vershinin
Subject: Re: [InterSystems-Zen] Re: dynaGrid onclick action

 

This won't work... you have to subclass the component and override the methods in there.  They are part of the component, NOT of the page.

 

Everybody starts at some point :)  I would like to keep the community included though, other people will learn from this as well.

 

On Oct 4, 2007, at 6:06 AM, Maxim Vershinin wrote:



Alex,

 

Sorry for that email “ping-pong”. As you know, I am quite a new SE here, so, probably I was doing something wrong.

Here is a class I am playing with:

 

/// Created using the page template: Default
Class User.GridTest Extends %ZEN.Component.page
{

/// Class name of application this page belongs to.
Parameter APPLICATION = "User.TestApp";

/// Displayed name of this page.
Parameter PAGENAME = "";

/// Domain used for localization.
Parameter DOMAIN = "";

/// This Style block contains page-specific CSS style definitions.
XData Style
{
<
style type="text/css">
</
style>
}
/// This XML block defines the contents of this page.
XData Contents [XMLNamespace="http://www.intersystems.com/zen"]
{
<
page xmlns="http://www.intersystems.com/zen" title="" >
<
dynaGrid id="dynaGrid" onselectcell="zenPage.test(zenThis);">
<
gridRow label="row1"/>
<
gridRow label="row2"/>
<
gridColumn id="col1" label="col1"/>
<
gridColumn id="col2" label="col2"/>
</
dynaGrid>
</
page>
}

Method test(grid) [ Language = javascript ]
{
alert(
'onselectcell - ' + grid.getCurrRow() + ':' + grid.getCurrColumn());
}

Method cellClickHandler(row, col) [ Language = javascript ]
{
alert(
'cellClickHandler - ' + row + ':' + col);
}

Method cellDblClickHandler(row, col) [ Language = javascript ]
{
alert(
'cellDblClickHandler - ' + row + ':' + col);
}

Method selectCellHandler(row, col) [ Language = javascript ]
{
alert(
'selectCellHandler - ' + row + ':' + col);
}

}

 

 

You might want to remove onselectcell to test click handlers.

 

Thanks,

Maxim

 

 

 


From: InterSys...@googlegroups.com [mailto:InterSys...@googlegroups.com] On Behalf Of Alex Schaefer
Sent: 04 October 2007 10:25
To: InterSys...@googlegroups.com
Subject: [InterSystems-Zen] Re: dynaGrid onclick action

 

I have used the cell click handlers without problems before, can you please post a simple sample? I agree with you in general, but frankly how would you expect onclick to work for a dynaGrid? Aren't you trying to influence the cell click specifically? I'm not sure why you want the click for the entire component to work.

 

On Oct 4, 2007, at 5:22 AM, Maxim Vershinin wrote:




 

Alex,

Thank you for your answer. Yes, component offers these handlers, so I tried to override those handlers and they don't work too. And I still believe that if we offer user a possibility to specify onclick property, it should work.

By the way, I was trying to workaround the problem, using onselectcell attribute of the component and I noticed that it invokes specified method for 3 times and also trying to get selected row and cell in the method returns values of a previously selected cell, so you can't do anything with a cell which is being selected.

Regards,

Maxim

<dynaGrid id="dynaGrid" onclick="zenPage.test();">

 

<gridRow label="row1"/>

 

<gridRow label="row2"/>

 

<gridColumn id="col1" label="col1"/>

 

<gridColumn id="col2" label="col2"/>

 

</dynaGrid>

 

</page>

 

}

 

Method test() [ Language = javascript ]

 

{

 

alert('OK');

 

}

 

Thanks,

 

Maxim

 

 







 









 

 

InterSystems Corporation

 






 








 

 

Alex Schaefer

 

InterSystems Corporation

 

 





 

 

 





 

 




Reply all
Reply to author
Forward
0 new messages