i'm looking for a way to add a text between the button of 'semantic:negativeAction' and the button of 'semantic:positiveAction' in the footer of a semantic content within a semantic page of 'sap.f.semantic' .
<semantic:positiveAction>
<semantic:PositiveAction text="+"/>
</semantic:positiveAction>
<semantic:negativeAction>
<semantic:NegativeAction text="-" />
</semantic:negativeAction>
Have you considered using customFooterContent aggregation in semantic page for footer
<semantic:customFooterContent>
<Button text="Approve" type="Accept" press="onAcceptPress"/>
<Label text="Test Text between two buttons"></Label>
<Button text="Reject" type="Reject" press="onRejectPress"/>
</semantic:customFooterContent>
Link:
https://sapui5.hana.ondemand.com/#/api/sap.m.semantic.SemanticPage
Related
It is possible to put button in endAdornment in TextField, e.g. with code:
<TextField size="small" type="text" id="m_general_reference" value={this.props.invoice.general_reference}
InputProps={{
endAdornment: (
<InputAdornment>
<Button variant="outlined" size="small" style={{textTransform: 'none', height: '20px'}}>
Check General Reference
</Button>
</InputAdornment>
)
}} />
But this code does not work when TextField is changed to Input. Is there more or less standard markup to put endAdornment button in InputField? I am interested in more or less standard solution only and no hacks (in case of hacks I will go with TextField).
How to change css style of Rendered html of CheckBoxMultipleChoice? CheckBoxMultipleChoice renders this html output by default but i want to change css style of this rendered output
<div class="ca-info__cat-roles js-roles-1 expanded" wicket:id="categories" id="categoriesb">
<input name="categories" type="checkbox" value="819" id="categoriesb categories_819">
<label for="categoriesb-categories_819">index>root>CategoryCatalog.png>9</label>
<input name="categories" type="checkbox" value="829" id="categoriesb-categories_829">
<label for="categoriesb-categories_829">index>root>tv.png>9</label>
</div>
I want to change styles of inputs and labels, but i don't know how to do it with CheckBoxMultipleChoice.
I have done this way. There are two ways
Add CSS in html page itself . inside style tag add your style like below but this will affect other component if you have same style.
.ca-info__cat-roles js-roles-1.expanded label{
// Your style for label
}
.ca-info__cat-roles js-roles-1.expanded input{
// Your style for input
}
2.Another way You can override#appendHtml and derive your own style for check box (e.g)buffer.append("class=\"yourStyleclass\"");.
In addition to use custom css for you component you have to use setSuffix() and setPrefix() methods, like this:
checkboxes = new CheckBoxMultipleChoice<>("checkboxes", value);
checkboxes.setSuffix("<br/>");
Im using algolia to perform a search on my website, but I realized one thing. Im using search box generator to customized my search input field. However the problems occur, when I try to apply autocomplete.js on my search input field
Initially, it looks like the one below,
but when I apply the autocomplete feature it will look like this
Code - HTML
<form id="search" novalidate="novalidate" onsubmit="return false;" class="searchbox sbx-google" style="margin-top: 7px;">
<div role="search" class="sbx-google__wrapper">
<input type="search" id="search_input" name="search" placeholder="Search" autocomplete="off" required="required" class="sbx-google__input">
<button type="submit" title="Submit your search query." class="sbx-google__submit">
<svg role="img" aria-label="Search">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#sbx-icon-search-13"></use>
</svg>
</button>
<button type="reset" title="Clear the search query." class="sbx-google__reset">
<svg role="img" aria-label="Reset">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#sbx-icon-clear-3"></use>
</svg>
</button>
</div>
</form>
Code - JAVASCRIPT
autocomplete('#search_input',
{ hint: false }, {
source: autocomplete.sources.hits(index, {hitsPerPage: 5}),
//value to be displayed in input control after user's suggestion selection
displayKey: 'name',
//hash of templates used when rendering dataset
templates: {
//'suggestion' templating function used to render a single suggestion
suggestion: function(suggestion) {
console.log(suggestion)
return '<span>' +
suggestion._highlightResult.title.value + '</span>';
}
}
});
The custom search box is advised by algolia themselves, on the autocomplete documentation. I have no idea on how to solve this problem, seems like the js script overwrite the css styling. This only happen if I passed in the #search_input in the autocomplete function
Here is the js fiddle https://jsfiddle.net/Ldpqhkam/
Algolia autocomplete adds a span around the input and that's what breaks the design. It has inline style changing the display, you can override it to fix the design.
.algolia-autocomplete {
display: inline !important;
}
I want to add two buttons to a FeedListItem similar to the NotificationnListItem.
<List headerText="Feed Entries" items="{ path : '/userFeedBack', mode : 'OneWay' }">
<FeedListItem sender="#{UserScreenname} ({UserName})"
icon="{ProfileImgUrl}" senderPress=".navToUser"
iconPress=".navToUser"
iconDensityAware="false" info="{Type}"
timestamp="{ path : 'Time', formatter : '.notificationListItemFormatted' }"
text="{TweetText} ({Total} times)">
</FeedListItem>
</List>
It should look like this. How can I these buttons or is there any other list control which I can use here?
For buttons, you will have to use different type of List Items. The FeedListItem does not support any aggregation. I would suggest the following options:
sap.m.NotificationListItem
sap.m.CustomListItem: Here, you will need to create a layout, where the image will come, where the text and the buttons will render.
Create a custom control by Extending FeedListItem and add 'buttons' aggregation to it.
Let me know if you need more inputs.
XML Code :
<List id="notificationList" class="sapContrast sapContrastPlus">
<NotificationListItem
description="Information of List Item 1"
showCloseButton="false"
datetime="1 hour"
unread="true"
press="onListItemPress"
authorName="Jean Doe"
authorPicture="sap-icon://globe">
<buttons>
<Button text="Accept" type="Accept" ></Button>
<Button text="Reject" type="Reject" class="sapUiLargeMarginEnd" ></Button>
<Button icon="sap-icon://thumb-up" class="sapUiLargeMarginBegin" ></Button>
</buttons>
</NotificationListItem>
<NotificationListItem
description="Information of List Item 2"
showCloseButton="false"
datetime="1 hour"
unread="true"
priority="None"
authorName="Jean Doe"
authorPicture="sap-icon://world">
<buttons>
<Button text="Accept" type="Accept" ></Button>
<Button text="Reject" type="Reject" class="sapUiLargeMarginEnd" ></Button>
<Button icon="sap-icon://thumb-down" class="sapUiLargeMarginBegin" ></Button>
</buttons>
</NotificationListItem>
</List>
I have a datatable which loops through a List and has a value column which renders as such:
<h:dataTable var="assessmentFieldValue" value="#{assessmentBean.assessmentFieldValues}">
...
<ui:fragment rendered="#{assessmentFieldValue.field.type eq 'TEXT'}">
<h:inputText value="#{assessmentFieldValue.value}" />
</ui:fragment>
<ui:fragment rendered="#{assessmentFieldValue.field.type eq 'SLIDER'}">
<component:slider value="#{assessmentFieldValue.value}" />
</ui:fragment>
...
</h:dataTable>
So sometimes I get a standard inputText, sometimes I get my composite slider component:
<composite:interface>
<composite:attribute name="value" />
</composite:interface>
<composite:implementation>
<script type="text/ecmascript">
function updateValue(value) {
$('##{cc.id} span').each(function() {
$(this).text(value);
});
}
</script>
<div id="#{cc.id}">
<input id="sliderComponent" type="range" min="1" max="10"
value="#{cc.attrs.value}"
style="float: left"
onchange="javascript:updateValue(this.value);" />
<h:outputText id="fieldValue" value="#{cc.attrs.value}"
style="min-width: 20px; display: block; float: left" />
</div>
</composite:implementation>
This all renders as I would like it too (deployed on JBoss-AS7), but when I hit the save button associated with the datatable the assessmentBean.assessmentFieldValue List doesn't reflect any value changes on the slider component yet it does for the standard inputText.
Can anyone suggest why changes to the slider aren't making it back to the backing bean? Thanks!
That's because you used a plain HTML <input> element instead of a fullworthy JSF input component like <h:inputText>. This way the value is in no way bound to the JSF context. It's only treated as plain vanilla template output value, not as input value. A composite component isn't going to solve this. You really need to create a fullworthy UIComponent for this (or to look for a 3rd party component library which has already done the nasty job for you, such as PrimeFaces with its <p:slider>).
See also:
When to use <ui:include>, tag files, composite components and/or custom components?