Empty Space between Pager and ViewPanel - xpages

I need to remove unnecessary empty slots which is shown on the picture attached. is it property of pager and viewPanel that cannot be removed or it is possiblle to remove with CSS or anything else...
Regards
Cumhur

You can use negative top-margin in your style.

Related

XPAGE: dont render Panel/Repeat in html

Whenever i create a panel or a repeat control in an XPage it renders it as a div tag.
Is it somehow possible to disable the rendering of the html tag. I just want to make the response document smaller.
Thanks in advance for the help
For panel and repeat controls look at the disableOutputTag property.
For repeat controls have a look at the removeRepeat property.
a panel's HTML representation is always rendered as a div as soon as you add properties like a control id or a styleClass to it. More or less the same applies to repeats: if remove the control's id in designer it will not be rendered in html. Or you could set the repeat's "removeRepeat" property to TRUE (All properties >> basics >> removeRepeat)
EDIT: ...or follow Per's reply...

How to show header of ListView when its empty

I am developing the following screen
The fourboxes next to each other are buttons. On clicking of the buttons I am changing the adapter of the listview.
Since the content above the listview took up lot of space I made the whole thing as an header and added it via code.
myPollsList = (ListView) findViewById(R.id.listArea);
myPollsList.addHeaderView(getLayoutInflater().inflate(R.layout.profile_listview_header, null));
Now I want to show some view when the list is empty. But if I do that then the header also goes away.
I am using this in a Activity and not a ListActivity. Any suggestions or workarounds for showing the header even when the list is empty ?
EDIT: Refer to my earlier question here ListView not getting space to show content on smaller screens . This is where someone suggested me to solve the problem by putting it as a header
I found a simple solution for this problem. If there's no elements for list and you are not adding the adapter, just add this:
mListView.setAdapter(null);
and the header will appear. It's easier than adding empty / fake item to the list.
So this is how I solved it. I had a custom adapter which was connected to the listview. When it found that it had zero items to display. It would add a fake empty view as an item to the list.
maybe you will like this Android addHeaderView disappears when no items in ListView
override/subclass your adapter to return false from isEmpty()
Don't use top layouts of button as header for list view.
So to adjust UI without using list header use weights.
Give parent Linear layout weight sum as 4 and 1, 1 to top Layouts and 2 for list view.

How to fill empty space when component is not visible or hidden?

I have several components into BorderPane which can be visible or not using checkbox.
When I set component not to be visible I get empty space which I want to fill by resizing the next component. What are the available options to configure the components to fill the empty space when component is set to .setVisible(false);?
You need to call setManaged(false) as well.
You can take advantage of bindings to set managed property automatically based on visibility.
E.g. component.managedProperty().bind(component.visibleProperty());

The buttons in a repeat don't hide/show after refreshing the panel the repeat is in?

I have a repeat that has buttons embedded in it. The repeat is in a panel. When the user clicks a button the button should hide/show (I partial refresh the panel). The repeat is tied to a Domino view and I see the other values that I from that view get updated in the repeat, so, it does not seem like a view index issue (I refresh the view index in my code.)
If I use context.reloadPage() in my button onclick code then the buttons will hide/show like they should, but, that seems like I am using a sledge hammer! Any suggestions on how to get the buttons to recompute the visible property when the panel that holds the repeat is rendered? Another strange thing is that the visible property gets computed three times whenever I refresh the panel that holds the repeat.
thanks, Howard
I think your looking for
getComponent("<id>").setRendered(true / false);
Hi For Repeat control's entry is used to make our head hard. Because handling the entry by SSJS, we can get the value and set the value. But rendering part, id of the repeating component are same for all. So if we try to give reder as false. It hides all of our repeating component.
Try to use the following., [Put this in button onclick, and see the value of below]
var entryValue= getComponent("repeat1").getChildren().get(0).getValue()
getComponent("inputText1").setValue(entryValue)
But in client side we can easily handle. Because the id of the DOM object is unique for all repeating component.
var id1="view:_id1:repeat2:"+'2'+":button1"
document.getElementById(id1).style.display="none"
This will hide the third entry of your repeat control component.
Please see the post, You may get better idea
Found a solution. My original solution was getting values from the repeat rows (using the collection object, which was a viewentrycollection and using getColumnValues) to compute the rendered property for the buttons.
Instead, I created a viewScope variable (a Vector) that holds the state of the buttons (which set of buttons to show). This gets populated in the beforePageLoad event of the page.
The button onclick code updates this viewScope variable after performing its processing. All works very nice now. I guess it was something in the JSF lifecycle that kept the buttons from being properly updated. Using the viewScope variable works fine.
With addition to what Ramkumar said, you can use the index variable in the repeat control to identify each and every occurrences inside the repeat control. You will get more idea, if you inspect with element from firefox[You might need firebug]. Usually the field mentioned inside a repeat control itself can be considered as an array

XPages disableOutput tag issue

Has anyone experienced an issue with disableOutputTag property where if you disable output tag for a computed field control inside a repeat control and have ssjs computed content inside that tag, it won't compute the content? Is disableOutputtag property only meant to work with static content inside a repeat control or is it a bug?
I don't know whether its a bug or not, but you can emulate the behavior of disableOutputTag by removing the ID attribute from and setting the disableTheme attribute to true. Maybe this helps you in short term.
EDIT: You can refer here for more information.
Not only does this happen when placing the xp:Text control inside a repeat but in also when you create a new XPage, add a xp:text onto it and define its value like:
<xp:text value="This is a test" disableOutputTag="true"/>
In the above example the xp:text will disappear. This is not what you would have expected. I would expect that only the value would be visible on the rendered page. But I think I can explain why this happens. Since there are no tags defined (disableoutputtag) somewhere in the rendered of this component it states that it should not generate anything. Because it can not bind its id to 'nothing' and so on.
Anyway, I could not think of a scenario where I would like to render plain text without any surrounding tags. It should at least be surrounded by a span or paragraph (<p>) tag so you can style it. And an ID would be nice so I can change the contents with a partial refresh.

Resources