ADF popup resize - popup

I'm using a popup in my ADF page, and some of the text is out of the popup window. How can I resize it? Here's my code:
<af:popup childCreation="deferred"
autoCancel="disabled" id="p2"
binding="#{backingBeanScope.backing_Setup.p2}">
<af:dialog id="d2"
binding="#{backingBeanScope.backing_Setup.d2}"
title="Confirmação"
type="cancel">
<f:facet name="buttonBar">
<af:commandButton text="Gravar"
id="cb6"
binding="#{backingBeanScope.backing_Setup.cb6}"
action="#{backingBeanScope.backing_Setup.checkRadioButtonAndPerformSave}"/>
</f:facet>
<af:panelGridLayout id="pgl45"
binding="#{backingBeanScope.backing_Setup.pgl45}">
<af:gridRow marginTop="5px"
height="auto"
id="gr20"
binding="#{backingBeanScope.backing_Setup.gr20}">
<af:gridCell marginStart="5px"
width="5mm"
id="gc104"
binding="#{backingBeanScope.backing_Setup.gc104}">
<af:selectOneRadio label=""
id="sor1"
binding="#{backingBeanScope.backing_Setup.sor1}"
autoSubmit="true">
<af:selectItem label="Os níveis abaixo herdarem tudo o que alterou;"
value="radio1"
id="si55"
binding="#{backingBeanScope.backing_Setup.si55}"/>
<af:selectItem label="Os níveis abaixo herdarem tudo o que alterou menos as exceções que tenham já definidas, caso existam."
value="radio2"
id="si56"
binding="#{backingBeanScope.backing_Setup.si56}"/>
</af:selectOneRadio>
</af:gridCell>
<af:gridCell marginStart="5px"
marginEnd="5px"
width="50%"
id="gc115"
binding="#{backingBeanScope.backing_Setup.gc115}">
<af:outputText id="ot1"
binding="#{backingBeanScope.backing_Setup.ot1}"/>
</af:gridCell>
</af:gridRow>
<af:gridRow marginTop="5px"
marginBottom="5px"
height="auto"
id="gr23"
binding="#{backingBeanScope.backing_Setup.gr23}">
<af:gridCell marginStart="5px"
width="50%"
id="gc116"
binding="#{backingBeanScope.backing_Setup.gc116}"/>
<af:gridCell marginStart="5px"
marginEnd="5px"
width="50%"
id="gc117"
binding="#{backingBeanScope.backing_Setup.gc117}">
<af:outputText id="ot2"
binding="#{backingBeanScope.backing_Setup.ot2}"/>
</af:gridCell>
</af:gridRow>
</af:panelGridLayout>
</af:dialog>
And here's the result:

You can either try to set explicit dimensions for af:dialog control or try to wrap or even replace current panelGridLayout with set of panelGroupLayout.
In fact if I got your idea right, you can use simple panelFormLayout to get desired result.

As per my knowledge you can solve this in different ways
1> try with surrounding your panel grid layout with a panel form layout
2> instead giving your label for your select one radio you can use separate input text component for displaying label and you can wrap it.
3>you can set dimensions for your dialog explicitly

Use panelGrouplayout instead of panel grid, also use the style class AFStretchWidth in panel group lay out to stretch within the pop-up.
Another component panel window will be more useful that its size can be adjusted in run time.

Related

GridToolbarColumnsButton change copy

I have a this custom toolbar and I want to change the display copy, but I don't see a prop on the <GridToolbarColumnsButton /> that will let me do that. Does anyone know how to change the text and icon on the <GridToolbarColumnsButton /> component.
function CustomToolbar() {
return (
<GridToolbarContainer>
<GridToolbarColumnsButton />
<GridToolbarFilterButton />
</GridToolbarContainer>
);
}
For the text, you can override the locals via the localeText prop of the DataGrid component
For the other props of this component, you will have to provide your own toolbar. It is a very basic component so copy pasting it is not a big issue.
Here is an example: https://codesandbox.io/s/datagrid-v5-quick-start-forked-d3s3r?file=/src/App.tsx

How to validate and scroll to sap.m.RadioButtonGroup

The task is straight forward:
The user has to select an entry in a group of radio buttons, otherwise the validation should fail.
In order to be nice to the user, I'd also like to scroll to that RadioButtonGroup when its validation fails since it's further down and may not be in sight (as in my example linked below).
The implementation is not so straight forward to me because RadioButtonGroup does not have the property required.
Here's my code example - the RadioButtonGroup is in file SomeView.view.xml at line 420...
I have not really tried anything so far because I have no idea what to try.
Does anyone know if this is possible without compromising the existing validator implementation (that I got from here)?
The implementation is not so straight forward to me because RadioButtonGroup does not have the property required.
Only sap.m.Label needs the property required="true". Not the control sap.m.RadioButtonGroup itself.
The control sap.m.RadioButtonGroup has a property called selectedIndex. In your Code-Snippet you set the property selectedIndex="-1". If the user selects an sap.m.Radiobutton the selectedIndex will change to 0..3. Let's capture that with sap.ui.model.type.Integer.
// JSON dummy data
var oData = {
text : "Test",
userEmail : "i.am#groot.com",
number : 50,
date : "01.01.2021",
selectedIndex: -1
};
<Label text="Final answer?" required="true"/>
<RadioButtonGroup
id="answer"
columns="4"
selectedIndex="{ path: '/selectedIndex',
type: 'sap.ui.model.type.Integer',
constraints : {
minimum : 0,
maximum : 3
}}">
<RadioButton id="A1" text="A"/>
<RadioButton id="B1" text="B"/>
<RadioButton id="C1" text="C"/>
<RadioButton id="D1" text="D"/>
</RadioButtonGroup>
The Validator.js only checks for following properties
aValidateProperties = ["value", "selectedKey", "text"]
so we add the propertie selectedIndex
aValidateProperties = ["value", "selectedKey", "text", "selectedIndex"]
Validation works now ! Code-Example
In order to be nice to the user, I'd also like to scroll to that RadioButtonGroup when its validation fails since it's further down and may not be in sight (as in my example linked below).
See this offical Example

How to get element's id of another view SAPUI5

I have 3 views say first,second & third. I need to access a vertical layout's id of second view from first view. For which I have used sap.ui.getCore().byId("__xmlview1--spend_layt"); to retrieve it. It works but when I navigate to third view & come back, id changes to __xmlview28--spend_layt & the control not works. How to fix this?
EDIT :
First.view.xml
<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" controllerName="budgetspend.controller.First" xmlns:html="http://www.w3.org/1999/xhtml"
displayBlock="true">
<App id="BA_APP">
<pages>
<HBox width="100%" height="100%" id="header_container">
<items>
<Image class="logo" src="../images/logo_new.png"/>
<Image class="header" src="../images/header-bg.png"/>
<html:ul class="tab">
<html:li>
<html:a id="onBud" class="tablinks active">Tab 1
</html:li>
<html:li>
<html:a id="onSpend" class="tablinks">Tab 2</html:a>
</html:li>
</html:ul>
<mvc:XMLView viewName="budgetspend.view.second"/>
</items>
</HBox>
</pages>
</App>
</mvc:View>
In the second view, I use 2 vertical layouts. one for tab 1 & another for tab 2. Only one visible at a time. Tab click events are written in First.controller.js. I don't know how to access ID's of vertical layouts(in second view) from First.
I am just exploring how standard html will work on SAPUI5 as I am aware of using sap.m.IconTab.
What you are facing is due to the dynamic creation of elements. Every time you leave a screen and goes back into it, the items are regenerated, but they can't have the same ID, since they were used before.
One solution to this is to create a Utils folder, and create an object, let's say UIHelper.
This file would look like this:
jQuery.sap.declare('my.app.Utils.UIHelper');
my.app.Utils.UIHelper = {
controllerInstance1 : null,
controllerInstance2 : null,
controllerInstance3 : null,
//Add "getters and setters" for each of these attributes (repeat for Controller 2 & 3)
setControllerInstance1 : function(oController){
this.controllerInstance1 = oController;
},
getControllerInstance1 : function(){
return this.controllerInstance1;
}
};
Now, at the controller file for each of your views, you add the following line at the top of the file:
jQuery.sap.require('my.app.Utils.UIHelper');
And on the onInit event of those controllers, you set the controller instance on the UIHelper object:
my.app.Utils.UIHelper.setControllerInstance1(this);
And when you want to get the different views from anywhere in the code, assuming that the views are assigned to one of the controllers, you can just use the following:
my.app.Utils.UIHelper.getControllerInstance1().getView();
Update in my answer after the update on the question:
To access the layout from the second view, you could do the following:
var layout = my.app.Utils.UIHelper.getControllerInstanceView2().byId('spend_layt');

Cannot set the height of MaterialSlider - How to override CSS?

Somewhere in materialize.min.css the slider class is getting its height assigned. I am simply not able to override this.
What I tried is to set the height in the constructor of my widget:
public class HomeViewImpl extends Composite implements HomeView {
public HomeViewImpl() {
initWidget(uiBinder.createAndBindUi(this));
int height = Window.getClientHeight();
slider.getElement().getStyle().setHeight(height, Unit.PX);
}
}
I also tried to overwrite it in my own css file and I also tried to override Widget.onLoad() with the same result. I can resize the slider afterwards but not on when its actually loaded. Since I want it to use up the entire available space it has to be resized "on load".
Please note that setting fullscreen="true" is not an option since this would mess up the arrangement of my parallax effect I am using here as well.
<m:MaterialSlider ui:field="slider" fullscreen="false">
<m:MaterialSlideItem height="100%">
<m:MaterialImage url="http://mayastepien.nl/googlecalendar/google-drinks.jpg" />
<m:MaterialSlideCaption textAlign="CENTER">
<m:MaterialTitle title="This is our big Tagline" description="Here's our small slogan." />
</m:MaterialSlideCaption>
</m:MaterialSlideItem>
<m:MaterialSlideItem height="100%">
<m:MaterialImage url="http://dreamatico.com/data_images/car/car-1.jpg" />
<m:MaterialSlideCaption textAlign="CENTER">
<m:MaterialTitle title="This is our big Tagline" description="Here's our small slogan." />
</m:MaterialSlideCaption>
</m:MaterialSlideItem>
</m:MaterialSlider>
According to the source code in
https://github.com/GwtMaterialDesign/gwt-material/blob/master/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSlider.java
..you can set the height attribute on MaterialSlider too (in your UiBinder xml).
You probably know this, but relative height only works when the height of parent elements is set too.
See for instance
Make div 100% height of browser window

GXT3 VerticalLayoutContainer height bug

I little speak english :( (i use gtranslate...)
I create GWT2.5(with requestfactory)+GXT3 MVP application
My Main View is a BorderLayout
west: shortcut panel(verticalLayoutContainer)
south: toolbar (status)
north: toolbar (menu)
my codes:
DesktopView.ui.xml (Main view):
http://pastebin.com/xbeUzDwi
DesktopView.java
http://pastebin.com/WguE6CVf
DesktopActivity.java
http://pastebin.com/adejJwu0
about grid view:
http://pastebin.com/nFPrGpd1
my MVP auto call createGrid()
error image(pagingToolbar)
if i replace in gridView
verticalLayoutContainer.add(grid, new VerticalLayoutData(1, -1)); => verticalLayoutContainer.add(grid, new VerticalLayoutData(1, 1));
error image(do not show grid)
what is the problem my code ? ???
but if i add code to DesktopActivity:
public void onEvent(....){
.
.
DesktopActivity.getContentPanel().setWidget(event.getWidget());
if (event.getWidget() instanceof VerticalLayoutContainer) {
((VerticalLayoutContainer) event.getWidget()).onResize();
}
direct call onResize, then there is no problem if you add...
this GXT3 bug or I make a mistake on something
Thank you in advance for your help
The BorderLayoutContainer does not automatically find the size of the edge components. You will have to define the sizes of these areas manually.
<ui:with type="com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderLayoutData"
field="northData">
<ui:attributes size="30" />
</ui:with>
This section says that the north section of the container should be 30 pixels high. The same can be done for all edges.