a4j:repeat changes behaviour? - java

I have a strange effect with a4j:repeat when using rich:toolbar in RichFaces. In my little example I just place a couple of icons on the toolbar. If I do it manually, they are all separately placed into <td>...</td>. But if let them generate by a list using a4j:repeat, they will all be placed together within one <td>...</td>.
The result of this is that those placed manually are more far from each other in the view. Those who were generated, stick together.
I believe the difference is, that the rich:toolbarGroup thinks of the a4j:repeat as one object, and of the manually placed ones as serveral objects.
I tried out with c:forEach as well, but I get exactly the same effect.
Does anyone know how to define the a4j:repeat objects as separate? Or if it is another problem, how to solve it?

If you're only worried about the spacing you can increase it by CSS.
<a4j:repeat> is not a good thing to use with the toolbar. If the icons you put in are supposed to have some sort of functionality attached to them you'd have a problem assigning it dynamically.

Related

Dynamic amount of entries in GUI using java

I'm working on creating a basic user interface and I wanted to try and create a portion that is in a scrollTaskPane and is capable of holding multiple entries. As I'm going about creating it I can obviously test it with a simple amount of entries but I'm confused how I can go about later allowing for it to take input to create entries in the scrollTaskPane of maybe 1 entry one time, and then later needing to allow for input of 20 entries. I only know how to use absolute positioning and am trying to figure out the best way to go about it. I also need to later be able to select each entry.
For the entries that will eventually be called and displayed in my interface, I'm planning to store them in a simple text file and use a semicolon as a delimiter between the task "Type" "Name" "Description"(which will be accessible through a button) and "Due Date". Or I may try to learn to use a database for the information. But I haven't decided yet and don't know anything about connecting a database with a java program.
This is the current look (the scrollTaskPane in the middle). And my goal is to put in entries that are each rectangle boxes going across the scrollTaskPane with a checkbox on the end of them. Should I use some sort of grid layout? Or something else? I'm a beginner at user interfaces, so any help is appreciated!
You can make a custom layout, and then keep adding those layout. So extend a layout class, add TextField and a check box in the layout. Initialize the layout with your values, add then add to the ScrollTaskPane.

Is there an easy way to show borders around Views and ViewGroups in the design tab of Android Studio for debugging and styling purposes?

I would like to see visually how much space each box takes with as little effort/changes to the code as possible.
I would like to know if it's possible to just put a line around the outer margins of the View or ViewGroup object.
Since it's just for debugging and styling I would like to also quickly turn it off, so I do rather make the changes to my code in one place so it's easy and quick to undo. Is this a default option I am missing? Somehow I expect this feature to exist already.
Here someone asks a different but slightly related question with not a nice answer for my case.
Here someone gives an answer on how to outline one View.
Border for an Image view in Android?
Code-wise you could follow the answer to the first link you posted and create a drawable with the name "developer_borders" or something similar and apply it to every view you wish to have its borders visible.
To easily remove it afterwards, you can right-click the directory of your project and click Replace in Path.... For Text to find you want to search for android:background="#drawable/developer_borders and for Replace with don't use anything. This will find every occurrence of what you are searching and replace it with an empty string.
There might be an easier option. Some devices have quite powerful Developer Options. "Show layout bounds" is what you want but take a look at the rest while you are at it, some are pretty awesome.

Dynamically changing the shown form on tree selection

I'm currently learning the adf framework, and while doing this I found myself in a situation I am not able to solve.
I have a tree component that works fine. I also have different forms, corresponding to different levels of the tree. Rather than having all of the forms visible at one time, I would like to only show the one that corresponds to the selected item in the tree.
To solve this, I created af:switcher, created facets and moved the forms there. Here is where I am lost, how do I tell the switcher to change the form? I tried to link them together using the facetName on the switcher, but no success. I suspect I did not link the right thing there, but I could not find anything helpful from the tree either! I assume it has something to do with the selectionListener and a bean, but I could not figure out a way to do this. Any clues?
See Sample #50 of http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples
Frank

Text layout across different columns

I wonder if there is some library I have missed that allows me to distribute text among different text objects and have it reflow depending on size, newspaper style? it's something pretty easily done in web but I can't find anything like it on Java for Android.
I don't know of any Android Layouts that work that way. You could probably create one that mimics the way html and css work though.
another option is to make your content with the Web technologies that you are used to and just display it inside of a WebView in your application. That would likely be a lot easier than trying to create the Layout yourself.
I had two text fields of different size and different default justification plus offset from the screen border. I simply overlapped them in the same space. Depending on what needed to be displayed, I would null out one field and fill in the other. It kept me from creating 2 different layouts and having to get creative with the text formatting.

How to implement a certain List design?

i need to implement a list as shown in the screenshot below!
now, my question is, what BB component do you suggest to use?
i thought of a RichList, but there are not many possibilities to customize this component afaik.
the alternative would be a Table.
are there other ways to implement this? is it possible to customize a RichList in a way to make it look like the screenshot below?
Setup: BB Eclipse Plugin v1.3, SDK 6.0
Use a ListField. You will have to do your own painting to setup an individual row, but it will be the most efficient way of doing this.
I haven't studied the 6.0 SDK very much, but here is a possible solution for you list:
Each item in the list would be a HorizontalFieldManager. This HorizontalFieldManager would contain the image on the left(this would be a BitmapField) and a VerticalFieldManager. The VerticalField manager would contain 2 LabelFields. The first one for the first row that is bold, and the second one for the rows underneath.
Of course, the first HorizontalFieldManager would have to be FOCUSABLE. You can override the onFocus, onUnfocus and paint methods to handle the focused(selected)/unfocused(unselected) states of the field.
The list would be a VerticalFieldManager that contains custom HorizontalFieldManager elements, as I explained above.
I'm not saying that this is the best solution, but it's a solution and it works(I've done something similar for OS 4.5 - 5.0).

Categories