How to display tooltip when InputText is Read Only? - oracle-adf

I have an input text field should be read-only.
I have added some description of the component in shortDesc property
I am using following code.
<af:inputText label="Office Code and Name"
value="#{pageFlowScope.officeCode} - #{fn:substring(pageFlowScope.officeName,0,18)}"
id="it2" shortDesc="#{pageFlowScope.officeCode} - #{pageFlowScope.officeName}" >
The tooltip text is not displayed.
How to display the tool-tip
Thanks in advance

I tried your case, first I tried the read only input text with tooltip, like this:
<af:inputText id="test" columns="60" simple="true" rows="2"
autoSubmit="true" immediate="true"
readOnly="true"
value="test text"
shortDesc="just to test the tooltip"/>
Well the tooltip won't show up when you set the inputText readOnly. Actually this is how ADF define the inputText behavior. So it's not your code's problem.
Then I'm thinking the readOnly inputText actually behaves like the outputText, so can you use the outputText instead? Because the outputText can show the tooltip: (and outputText is readOnly naturally)
<af:outputText id="test"
value="test text"
shortDesc="just to test the tooltip"/>
Now you can see the tooltip when hover above the text. :)
Hope this helps~
Feel free to leave a comment if you need more info.

Try using a client listener on change event and add a tool tip using JavaScript to that component.

Related

CheckBox in SAPUI5 xml view not shown as checked

I have placed a checkbox in my SAPUI5 xml view as follows:
<CheckBox checked="true" editable="false"/>
However, the checkbox is shown as unchecked. Looking at the reference, "checked" is a boolean field; I cannot see anything wrong in above code.
Reference:
https://sapui5.hana.ondemand.com/sdk/test-resources/sap/ui/commons/demokit/CheckBox.html#settings
What's the matter?
sap.ui.commons.CheckBox uses checked, editable and enabled
sap.m.CheckBox uses selected and enabled
<CheckBox text="{field}" selected="true" enabled="false" />
is it possible you are using sap.m.Checkbox

WiX: ListItems not displayed in ComboBox

When I create (try to create) a ComboBox in WiX, the box receives its initial value from the corresponding property's value set earlier in the .wxs-file. This far, everythings goes as planned. When I try to change its value graphically, it displays no available list items. I have not found any necessary or relevant attributes etc in the docs that I haven't used, but also I'm quite noobish on WiX so maybe have missed something obvious. The code is below:
<Property Id="LANGUAGE" Value="Swedish" />
... cut ...
<Control Type="ComboBox" ComboList="yes" Property="LANGUAGE" Id="languages_combo" Width="..." Height="..." X="..." Y="...">
<ComboBox Property="LANGUAGE">
<ListItem Value="Swedish" />
<ListItem Value="English" />
</ComboBox>
</Control>
I want to be able to select "English" instead of "Swedish" in the drop-down, but that option is not available (and not "Swedish" for that matter - even that's the default value). Any suggestions how to solve this? I have searched the net without success, so I guess it's so basic no one has run into the same problem :-)
If it helps, here is the compilation:
candle test.wxs
light -ext WixUIExtension -sice:ICE20 test.wixobj
Attempts made by me:
Adding Text="..." to the ListItems does not help.
Replacing "ComboBox" with "ListBox" (and removeing attribute ComboList) displays the options/ListItems, but unfortunately ListBox is not the control that I want.
It's interesting when you make the same mistake over and over again, and never realize it's the good old mistake. I increased the Height attribute for Control, so the ListItems fit. Works like a charm!
I think you need to set the visible displayed text on the ListItems.
Try this:
<ComboBox Property="LANGUAGE">
<ListItem Text="English" Value="English" />
<ListItem Text="Swedish" Value="Swedish" />
</ComboBox>

Item level control over ribbon item sizes using WPF ribbon (for .NET 4) and RibbonControlSizeDefinition

According to the MSDN documentation, a ribbon:RibbonControlSizeDefinition can be used to control the size of an item on a WPF ribbon by setting the ControlSizeDefinition property. Has anyone had any success using this property? I find that it is completely ignored. I initially set it using data binding, but have also tried using the code behind file.
This question is similar, but it is correctly noted in one of the comments that the OP had used a RibbonControlGroup, and therefore was seeing the expected behaviour.
I understand that it's usually best to allow the ribbon to do it's own thing regarding sizing. Sadly that's not an option for this project.
I've listed the part of my XAML code that doesn't work below.
<ribbon:RibbonTab Header="MyTab">
<ribbon:RibbonGroup Header="MyGroup">
<ribbon:RibbonButton Label="My big button" Name="BigButton"
LargeImageSource="Images\Ribbon\assignments_duties_a2k_32.png"
SmallImageSource="Images\Ribbon\assignments_duties_a2k_16.png">
<ribbon:RibbonButton.ControlSizeDefinition>
<ribbon:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="True" />
</ribbon:RibbonButton.ControlSizeDefinition>
</ribbon:RibbonButton>
<ribbon:RibbonButton Label="My little button" Name="SmallButton"
LargeImageSource="Images\Ribbon\assignments_duties_a2k_32.png"
SmallImageSource="Images\Ribbon\assignments_duties_a2k_16.png">
<ribbon:RibbonButton.ControlSizeDefinition>
<ribbon:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="True" />
</ribbon:RibbonButton.ControlSizeDefinition>
</ribbon:RibbonButton>
</ribbon:RibbonGroup>
</ribbon:RibbonTab>
After some experimentation, I have a workaround. I tried using group-level sizing instead of item-level sizing, using the ribbon:RibbonGroup.GroupSizeDefinitions property. This works as documented. Additionally, setting this to an empty RibbonGroupSizeDefinition is enough to make the item-level properties work. My code from above becomes:
<ribbon:RibbonTab Header="MyTab">
<ribbon:RibbonGroup Header="MyGroup">
<ribbon:RibbonGroup.GroupSizeDefinitions>
<ribbon:RibbonGroupSizeDefinition>
</ribbon:RibbonGroupSizeDefinition>
</ribbon:RibbonGroup.GroupSizeDefinitions>
<ribbon:RibbonButton Label="My big button" Name="BigButton" LargeImageSource="Images\Ribbon\assignments_duties_a2k_32.png" SmallImageSource="Images\Ribbon\assignments_duties_a2k_16.png">
<ribbon:RibbonButton.ControlSizeDefinition>
<ribbon:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="True" />
</ribbon:RibbonButton.ControlSizeDefinition>
</ribbon:RibbonButton>
<ribbon:RibbonButton Label="My little button" Name="SmallButton" LargeImageSource="Images\Ribbon\assignments_duties_a2k_32.png" SmallImageSource="Images\Ribbon\assignments_duties_a2k_16.png">
<ribbon:RibbonButton.ControlSizeDefinition>
<ribbon:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="True" />
</ribbon:RibbonButton.ControlSizeDefinition>
</ribbon:RibbonButton>
</ribbon:RibbonGroup>
</ribbon:RibbonTab>

using EPiImageResizer in a Repeater

I'm not getting EPiImage to show me the image when I use it in a Repeater.
If I move the resizer outside of the Repeater it works like a charm..
Is there anything special I need to think about?
<asp:Repeater ID="PageMenu" runat="server">
<HeaderTemplate>
<nav id="InlineSubNav">
<ul>
</HeaderTemplate>
<ItemTemplate>
<EPiImage:EPiImageResizer PropertyName="Image" Width="150" Height="150" Transformation="ScaleToFill" runat="server" />
<EPiServer:Property PropertyName="MainIntro" runat="server" />
<EPiServer:Property PropertyName="PageLink" runat="server" />
</ItemTemplate>
<FooterTemplate>
</ul>
</nav>
</FooterTemplate>
</asp:Repeater>
According to the source code for EPIImageResizer, the Render method will pick the property from another page, providing that the PageLink is set:
//If PageLink is set use that page instead of the current page
if (PageLink != PageReference.EmptyReference)
PageDataToUse = DataFactory.Instance.GetPage(PageLink);
if (PageDataToUse[PropertyName] != null)
{
ImageUrl = PageDataToUse[PropertyName].ToString();
So providing you are setting the PageLink property correctly, then there shouldn't be a problem.
Try using the binding syntax to populate the PageLink property within the ItemTemplate on the repeater, using something like this:
PageLink="<%# ((PageData)Container.DataItem).PageLink %>"
Alternatively set the value in the code behind by subscribing to the repeater's ItemDataBound event, retrieve the EPiImageResizer control using the e.Item.FindControl method and setting the PageLink using the value obtained from e.Item.DataItem.PageLink
As far I can see from the source code of EPiImage, it will not work/it's not supported.
You could try setting the PageLink property for each item.
In EPiImage 2.5 the issue with databinding was fixed.
by specifying the both PropertyName and PageLink attribute it now works
<EPiImage:EPiImageResizer PropertyName="Image" PageLink="<%# Container.CurrentPage.PageLink %>" Width="150" Height="150" Transformation="ScaleToFill" runat="server" />

Newline in a WPF-label?

How can I add a newline in the text of a label in WPF such as the following?
<Label>Lorem
ipsum</Label>
<Label><TextBlock>Lorem<LineBreak/>ipsum</TextBlock></Label>
You need to use TextBlock because TextBlock accepts as children a collection of Inline objects. So you are giving the TextBlock element three Inline items: Run Text="Lorem", LineBreak, and Run Text="ipsum".
You can't do the following:
<Label>Lorem<LineBreak/>ipsum</Label>`
because a label accepts one content child element.
Also, not sure exactly what your use case is but notice I placed a TextBlock inside your Label element. Is it repetitive? Not really, depending on your need. Here's a good article on the differences between the two elements: Difference between Label and TextBlock
in WPF you can use the value "
" or "
"
For example:
<Label Content="Lorem
ipsum" />
("10" is the ASCII number for newline)
or
<Label Content="Lorem
ipsum" />
("A" is the ASCII number for newline in hex)
When doing this in the ViewModel or Model, I have found that using Environment.NewLine has the most consistent outcome, including localization. It should work directly in the View as well, but I haven't tested that.
Example:
In the View
<Label Content="{Binding SomeStringObject.ParameterName}" />
In the ViewModel:
SomeStringObject.ParameterName = "First line" + Environment.NewLine + "Second line";
An example of how to add a ToolTip with multiple lines to a control, such as a button. The tooltip is width limited so it will wrap if a sentence is too wide.
<!-- Button would need some properties to make it clickable.-->
<Button>
<Button.ToolTip>
<TextBlock Text="Line 1
Line 2" MaxWidth="300" TextWrapping="Wrap"/>
</Button.ToolTip>
</Button>
Tested on VS2019 + .NET 4.6.1 + WPF.
<Label xml:space="preserve">text content
another line</Label>
seems to work too

Resources