How can I rebuild Form Component in Codename One - codenameone

I'm trying to create Custom Form configuration with scrollable TitleArea. The Form (black) has a BoxLayout.Y_AXIS Layout in BorderLayout.CENTER (blue). StatusBar (green) stays in BorderLayout.NORTH (green), when rest of the TitleArea (cyan) is in the first position in BoxLayout.
removeComponentFromForm function is unavailable for using in extended class. How can I remove components from Form to removing titleArea from BorderLayout.NORTH?

Why use the title area at all? Why not just add a component to the top of the box layout Y and style it as a Title that way you can scroll it out?
You can also use the new Toolbar API that includes many abilities to fade out the title as you scroll etc. See:
http://www.codenameone.com/blog/toolbar.html
http://www.codenameone.com/blog/cats-in-toolbars.html

Related

Autoresize chart and move toolbar in Apexcharts of react

I binded the apexchart in my application. However when I make the container of the chart smaller, the toolbar is not moved or overlied (like the chart).
since I'm new in react. I have no idea how to solve that. It would be nice if it is moved and the chart resizes automatically. (actually what the "reset zoom" button does)
Another question would be if I can use my own toolbar on the left, but execute the same listener of the apexchart toolbar.
Thank you in advance

Inverted react-beautiful-dnd order

I have a working vertical column drag and drop React app using react-beautiful-dnd, but would like to 'invert' it so that Draggable items fall to the bottom of the Droppable div instead of floating to the top. Is this possible?
If I'm understanding you correctly, you'd like to have a list where when the container is not full, the items within that list are aligned to the bottom of the container?
If so, then yes - I would utilize flexbox.
Here is a good resource for flex - https://css-tricks.com/snippets/css/a-guide-to-flexbox/
There are multiple different ways to implement this with flex. Pick your poison.
edit
Based on the code sandbox:
I would add a wrapper div to the bay component with the same height as what you have now. On the child div, add a dynamic height field that is dependent on how many tables the bay contains.
Users won't be able to drop into the entire column but you could style it to show the user where they need to drop when the column is empty.
I ended up just creating another invisible strip with flexGrow = 1 to push everything to the bottom.

Add an icon inside a Codename One TextModeLayout

My problem is that I didn't find any way to properly add an icon near a TextComponent, inside a TextModeLayout, to mask/unmask a password.
It's a layout problem only, because the code of the ActionListener to mask/unmask the password works correctly at least in the Simulator (it's taken from Codename One - Mask and Unmask Password Field on iOS).
On iPhone skin, the InputComponents labels and text fields are not aligned correctly:
On Android skin, the text is not aligned correctly if it doesn't valide:
About my code, instead of adding the InputComponent (of the password) directly to the TextModeLayout container, I enclosed the InputComponent and the Button inside a BorderLayout, and then I added the BorderLayout container to the TextModeLayout container.
When you do that the text mode layout stops working for that component as it's unaware of the layout in the hierarchy. The hierarchy in the border layout is the responsibility of that layout.
The solution is to extend the TextComponent and add that functionality to Codename One. As a workaround we might be able to rely on the behavior of the current component since the field is already in a border layout component. So something like this might work:
TextField tf = myTextComponent.getField();
Container b = tf.getParent();
b.add(EAST, unmask);

Isotape responsive layout with toggles and unknown heights

I am trying to create a masonary style layout using isotope. The layout must be a responsive grid with flexible columns. However each grid item has an hidden text element which opens when the image is clicked. This text will come from wordpress and therefore as an unknown length. I am trying to use the
.isotope("reLayout");
function to reset the layout when the item is toggled however it does not work. If you alter the size of the browser when the text is visible you can see that that the isotope layout kicks back in and gives the desired effect.
I have created a codepen to illustrate my issue. Any help would be appreciated
http://codepen.io/GlynnJohnson/pen/bLBCJ
Thanks
You need top use:
$container.isotope("layout");
Not
$container.isotope("reLayout");
Codepen

CodeNameOne: Custom dialog theme issue

How can I create a theme for a dialog box?
I was trying to change the border style of the dialog box but the border style applies 2 times for an inner element and for an outer element. I was expected that the border style applies only to the inner element.
To be clearer, as I cannot add image to my post, it seems that the dialog does not consist only from the center box which is showed while dialog is active. The dialog UI consists from a “background form” which usually is transparent and from a container which overlay over the background form. The last mentioned container contains de graphic representation of the “dialog box”.
My issue is that I can not apply my style only to the container which contains the dialog box but the style applies also to the background form.
How can I apply the border style only to the dialog box container element?
Any additional tips will be highly appreciated.
Thanks.
How are you applying the style? Are you using the theme to apply a style to the Dialog UIID as explained here.
Using setStyle or getStyle on a dialog component would be problematic and would not result in proper styling (you might get away with doing it on getDialogComponent but you should work with the theme).
Notice that to style a dialog you should use Dialog, DialogTitle & DialogBody UIID's and quite a few theme constants.
Thanks Shai,
is clear now.
I’m doing a custom dialog starting from the BlankDialog element provided in designer.
Because I started from BlankDialog I thought that overriding only UIID theme is enough.
I understood the BlankDialog structure wrongly thinking that is a simple empty form because is named "Blank…"
Is clear now that for every new UI object added, I should check if it has any other UI child to be customized together with the parent.
Thanks again.

Resources