[codenameone-discussions] Re: com.codename1.ui.table.Table scroll behaviour issue

2019-01-27 Thread Shai Almog
Table is written on top of Table layout, you can just recreate the layout 
and apply it again. 
See the code of Table: 
https://github.com/codenameone/CodenameOne/blob/master/CodenameOne/src/com/codename1/ui/table/Table.java#L214-L224

FYI you can debug directly into the Codename One sources to get insight 
into how things work. This post is a bit old but most of this still works 
as is: 
https://www.codenameone.com/blog/how-to-use-the-codename-one-sources.html

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/7c0fe461-9f34-4c4c-a701-a81e44034f4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: com.codename1.ui.table.Table scroll behaviour issue

2019-01-27 Thread shop . service . assistant
Thanks, I'm not pushing you to make any changes more over just to make sure 
I am not overlooking another package that may exist that will be more 
feature rich.
I appreciate your support and do not want to jeopardize same.

>From what I have read, the TableLayout 
 
class is fixed in size and can not be altered (add/delete rows dynamically) 
like Table can.

If this is the case, I think it best for us to continue to work with Table.

Thanks for all your support.

Regards.

On Saturday, January 26, 2019 at 11:17:10 PM UTC-5, Shai Almog wrote:
>
> JTable is pretty frustrating too... Unlike table you have more state than 
> the renderers/editors mess. 
> You can use the TableLayout directly if you prefer. 
> I think this is pretty doable in table with the current feature set I just 
> don't have the time right now to do that.
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/48f89210-ae22-49a4-9486-15c25b69684b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: com.codename1.ui.table.Table scroll behaviour issue

2019-01-26 Thread Shai Almog
JTable is pretty frustrating too... Unlike table you have more state than 
the renderers/editors mess. 
You can use the TableLayout directly if you prefer. 
I think this is pretty doable in table with the current feature set I just 
don't have the time right now to do that.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/b0f9ccea-18ec-4c7e-b94c-6cdcbab3ef93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: com.codename1.ui.table.Table scroll behaviour issue

2019-01-26 Thread shop . service . assistant
The more I work with the com.codename1.ui.table.Table and add complexities, 
the more it frustrates me.

Is there a better solution in codename1 dealing with tables that are 
renderable and feature rich?

Regards

On Saturday, January 26, 2019 at 8:05:11 AM UTC-5, shop.servic...@gmail.com 
wrote:
>
> I can appreciate that.
>
> com.codename1.ui.table.Table is very useful to us as we use JTables in 
> Swing frequently.
> Our product suite is based in pure java RMI server / clients Swing GUI's 
> and many classes are ported to mobile devices.
> We have accomplished much on the Swing side, it's very cost effective not 
> to have to reinvent the wheel.
>
> Are there any other codename1 alternatives that provide features like 
> renderers and row highlighting inherent in Swing?
>
> Regards
>
> On Saturday, January 26, 2019 at 12:41:25 AM UTC-5, Shai Almog wrote:
>>
>> That was a mistake. I didn't see it in the test case since there was no 
>> scrolling. I guess the fix would be to keep a single listener for the 
>> entire row and update the selected state on the component.
>> E.g. 
>>
>> Map rowListeners;
>>
>>
>> Then bind the listener for a specific row or create it. This solution 
>> will also need to keep the currently selected components so we can remove 
>> the selection from them. It's a bit of a hassle so it's not something I can 
>> whip up quickly right now.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/ce744b48-1a70-40ec-88d3-6d48d2c366c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: com.codename1.ui.table.Table scroll behaviour issue

2019-01-26 Thread shop . service . assistant
I can appreciate that.

com.codename1.ui.table.Table is very useful to us as we use JTables in 
Swing frequently.
Our product suite is based in pure java RMI server / clients Swing GUI's 
and many classes are ported to mobile devices.
We have accomplished much on the Swing side, it's very cost effective not 
to have to reinvent the wheel.

Are there any other codename1 alternatives that provide features like 
renderers and row highlighting inherent in Swing?

Regards

On Saturday, January 26, 2019 at 12:41:25 AM UTC-5, Shai Almog wrote:
>
> That was a mistake. I didn't see it in the test case since there was no 
> scrolling. I guess the fix would be to keep a single listener for the 
> entire row and update the selected state on the component.
> E.g. 
>
> Map rowListeners;
>
>
> Then bind the listener for a specific row or create it. This solution will 
> also need to keep the currently selected components so we can remove the 
> selection from them. It's a bit of a hassle so it's not something I can 
> whip up quickly right now.
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/4cf9cbe3-72c0-4af1-83fd-9fbb82b80e3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: com.codename1.ui.table.Table scroll behaviour issue

2019-01-25 Thread Shai Almog
That was a mistake. I didn't see it in the test case since there was no 
scrolling. I guess the fix would be to keep a single listener for the 
entire row and update the selected state on the component.
E.g. 

Map rowListeners;


Then bind the listener for a specific row or create it. This solution will 
also need to keep the currently selected components so we can remove the 
selection from them. It's a bit of a hassle so it's not something I can 
whip up quickly right now.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/e1ce757b-8272-460a-bbee-bfb98b43efc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: com.codename1.ui.table.Table scroll behaviour issue

2019-01-25 Thread shop . service . assistant
Attached is the requirement example I have in rendering a Table

Table contains one of n Estimate Groups, The 2 highlighted rows in the 
attachment are a summary of the Parts / Labor that make up a Group

When we click on a column, we highlight only that column, however when we 
make changes to the table such as add a new group or group entry, we have 
to render the table to highlight the changes in the Group summaries as 
shown in the attached image.

Regards.

On Friday, January 25, 2019 at 9:04:39 AM UTC-5, shop.servic...@gmail.com 
wrote:
>
> This method was taken from your answer to how to highlight a selected row.
>
> https://stackoverflow.com/questions/42303713/how-can-i-select-and-hightlight-a-row-in-a-table-in-codename-one
>
> Ultimate goal is to efficiently highlight a selected row
>
> Regards.
>
> On Thursday, January 24, 2019 at 10:31:02 PM UTC-5, Shai Almog wrote:
>>
>> It's because you invoke setModel() which causes the table to effectively 
>> rebuild from scratch. You should instead update the cell/row not rebuild 
>> the entire table.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/c82d1165-a3a6-4394-bb39-61d0a567bf09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: com.codename1.ui.table.Table scroll behaviour issue

2019-01-25 Thread shop . service . assistant
This method was taken from your answer to how to highlight a selected row.
https://stackoverflow.com/questions/42303713/how-can-i-select-and-hightlight-a-row-in-a-table-in-codename-one

Ultimate goal is to efficiently highlight a selected row

Regards.

On Thursday, January 24, 2019 at 10:31:02 PM UTC-5, Shai Almog wrote:
>
> It's because you invoke setModel() which causes the table to effectively 
> rebuild from scratch. You should instead update the cell/row not rebuild 
> the entire table.
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/c6227ff9-eb0e-4fc2-853e-344126f6b25e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: com.codename1.ui.table.Table scroll behaviour issue

2019-01-24 Thread Shai Almog
It's because you invoke setModel() which causes the table to effectively 
rebuild from scratch. You should instead update the cell/row not rebuild 
the entire table.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/a8fd03c3-1715-4495-a644-17c36b5e0b3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: com.codename1.ui.table.Table scroll behaviour issue

2019-01-24 Thread shop . service . assistant
Sorry, An Oversight from a cut and paste.

hi.setScrollableY(false);

With only Table table.setScrollableY(true); being scrollable,
swipe down to the bottom and tap the Row 2 or 3 or 4 cells and you will see 
the table scrolls to the top every time.

Regards.

On Wednesday, January 23, 2019 at 7:41:40 PM UTC-5, 
shop.servic...@gmail.com wrote:
>
> If you are experiencing an issue please mention the full platform your 
> issue applies to:
> IDE: NetBeans/Eclipse/IDEA
> Desktop OS
> Simulator 
> Device PC, Android, IOS
>
> Sorry for the Table Population Hack,
>
> I am expecting to edit column 0 and when I click/Press on a row that 
> exists within the non scrolled region all is well.
> Scroll down then click/press a cell to edit (casted as TextField) and the 
> Table scrolls back to top.
> As soon as The Table scrolls back to top, the cell I pressed and was going 
> to edit, looses focus and of course would execute an actionEvent (Not Shown 
> Here)
>
> How do I prevent the scrolling back to top when I press a cell in this 
> case?
>
> Thanks In Advance!
>
>
> Form hi = new Form("Table", new BorderLayout());
> hi.setScrollableY(true);
> Container header = new Container(new 
> BoxLayout(BoxLayout.Y_AXIS));
> TableModel modelHeader = new DefaultTableModel(new 
> String[]{"Complaint", "Hours", "Dollars"}, new Object[][]{
>  
>  
> ,}) {
> public boolean isCellEditable(int row, int col) {
> return col != 0;
> }
> };
> Table table1 = new Table(modelHeader) {
> @Override
> protected TableLayout.Constraint 
> createCellConstraint(Object value, int row, int column) {
> TableLayout.Constraint con = 
> super.createCellConstraint(value, row, column);
> if (row == 1 && column == 1) {
> con.setHorizontalSpan(2);
> }
> con.setWidthPercentage(33);
> return con;
> }
> };
> header.addComponent(table1);
> int RowNum = 1;
> TableModel model = new DefaultTableModel(new String[]{"", "", 
> ""}, new Object[][]{
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (RowNum++), "Row A", "Row X"},
> {"Row " + (Ro

[codenameone-discussions] Re: com.codename1.ui.table.Table scroll behaviour issue

2019-01-23 Thread Shai Almog
You have nested scrollables here. The table and its parent container are 
both scrollable and this causes confusion. Ideally it should cause an error 
but these things are hard to detect efficiently in the code and you get 
"weird" failures like that. 

I would suggest using a non-scrollable border layout and letting the table 
do the scrolling.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/7fd4065c-86e0-473d-a5ef-39e42d97139d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.