XUL textbox is not editable or visible - xul

When using an XUL <textbox> element in the latest Firefox releases, I am not able to focus the element and write something into it. It worked in older versions, like 33. Using html:textarea instead seems to work. However, I would be happy to keep the original XUL element in my app and want to understand what is going wrong here.
When using the multiline attribute on the <textbox> element, the element is not visible at all!
Any hint or explanation would be great.
Here is my small test.xul file content:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<window
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html = "http://www.w3.org/1999/xhtml"
width="800"
height="800">
<textbox flex="1" />
<html:textarea flex="1" />
</window>

Found the problem.
I had an override rule in my chrome.manifest file which looked like this:
override chrome://global/locale/textcontext.dtd
chrome://myapp/locale/xulrunner_global_textcontext.dtd
The file was changed for firefox 38 and an additional ENTITY was added which is not defined in my file. Adding the missing ENTITY solved all problems.
Thanks Makyen for testing and inspiration.
The changes for those who are interested:
https://hg.mozilla.org/releases/l10n/mozilla-beta/de/diff/6f25b6d2dcf5/toolkit/chrome/global/textcontext.dtd

Related

"Unable to resolve type" when referencing a xaml file through namespaces

I'm trying to build the example project that is provided in the Avalonia website but I'm having difficulty with certain parts.
I want to use a xaml element in a xaml window in another file like so:
<Window xmlns="https://github.com/avaloniaui"
xmlns:local="using:Buguette.Views">
<Panel>
<local:MusicStoreView />
</Panel>
</Window>
But I'm getting an error saying "Unable to resolve type MusicStoreView from namespace using:Buguette.Views". (MusicStoreView is the name of the file I'm trying to include here).
However everything works fine when I just copy the contents of the MusicStoreView file to where <local:MusicStoreView /> is supposed to be.
I followed the steps in the website but I'm still getting this error.
Any help would be much appreciated.
You need to use clr-namespace:
<Window xmlns="https://github.com/avaloniaui"
xmlns:local="clr-namespace:Buguette.Views">
<Panel>
<local:MusicStoreView />
</Panel>
</Window>
Sometimes you also need to provide the assembly name, such as:
xmlns:viewModels="clr-namespace:MyApp.Core.ViewModels;assembly=Myapp.Core"

How to use TableView in Xamarin.Forms?

I am relatively new to the world of Xamarin.Forms and have a question with regard to Xamarin TableView.
I want to create a layout similar to the one shown below.
Question is, can I use TableView for this or is there an another option for this? Can anyone show this with XAML code please?
Thanks in advance.
Edit: Tabs in the bottom are not required.
I don't mean to be rude, but this is very easy to retrieve from the documentation pages and a bit of trying yourself.
To get you started, try this:
<TableView Intent="Settings">
<TableView.Root>
<TableView.Section>
<ImageCell Text="Invoice Customization" Source="Invoice_image.png" />
<ImageCell Text="Invoice Defaults" Source="Invoice_image.png" />
</TableView.Section>
<TableView.Section Title="Security">
<SwitchCell Text="Use Touch ID" />
</TableView.Section>
... etc.
</TableView.Root>
</TableView>
The arrows at the end of the cells and the footer text underneath the Security section are not possible with Xamarin.Forms out of the box, this will probably require you to write a custom renderer.

Confused with pe:documentViewer rendering pdf file in web app

I have a web app that uses primefaces extensions.
If I use
<pe:documentViewer id="verPdf"
height="500"
name="/resources/pdf/#{utentesBean.nomeFile}" />
it does not render PDF in view.
if I use
<pe:documentViewer id="verPdf"
height="500"
name="/resources/pdf/441.pdf" />
it shows the PDF .
Can anyone give an idea ?
Thank you.
I am one of the developers of the document viewer component and I just tested it and it worked fine with both of the following:
<pe:documentViewer url="/sections/documentviewer/#{controller.bookFile}"/>
<pe:documentViewer library="books" name="#{controller.hoodFile}"/>
One thing I noticed above in your example is you were not using URL you were using "name" attribute and name is meant to be used with "library" as in my example above as a relative path to a resource folder called "books".
I think you want to change your code to...
<pe:documentViewer id="verPdf"
height="500"
library="pdf"
name="#{utentesBean.nomeFile}" />

How to add new command to test case

I am using Selenium IDE Record function to create test cases.
I would like to take screenshot at some part of application that I am testing.
Using UI of Selenium IDE it is easy:
Command: captureEntirePageScreenshot,
Target: *path for screenshot*
But it is not convenient to manually type this (or copy paste) every time I want to take a screenshot, so I decided to make a plug-in (a button on the Selenium IDE toolbar) that will add this screenshot command to the testcase, once I click on it.
I created my button, which is visible on the toolbar, but right now it does nothing:
<?xml version="1.0"?>
<?xml-stylesheet href="toolbar.css" type="text/css"?>
<overlay id="toolbar_overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<toolbar id="toolbar2">
<toolbarseparator id="screenshot-separator" insertafter="record-button"/>
<toolbarbutton id="screenshot-button" insertafter="screenshot-separator" label="Take a screenshot" class="icon" tooltiptext="Take a screenshot" command="*problem_is_here*"/>
</toolbar>
</overlay>
I was digging through Selenium IDE source code, but didn't find method that can be used to add new command to the test case...
Did more digging through source code and find required method:
Editor.addCommand(command, target, value, window, insertBeforeLastCommand)
So my final .xul file looks like this:
<?xml version="1.0"?>
<?xml-stylesheet href="toolbar.css" type="text/css"?>
<overlay id="toolbar_overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<toolbar id="toolbar2">
<toolbarseparator id="screenshot-separator" insertafter="record-button"/>
<toolbarbutton id="screenshot-button" insertafter="screenshot-separator" label="Take a screenshot" class="icon" tooltiptext="Take a screenshot" oncommand="window.editor.addCommand('captureEntirePageScreenshot', 'C:/Users/username/screenshot'+window.FileUtils.getTimeStamp()+'.png', '', window.editor.window);"/>
</toolbar>
</overlay>
Look inter user-extensions.js. This is an easy way to add javascript functionality.
To me, it seems silly to reproduce a command that already exists.
With the IDE's autocomplete, I'm not sure why it's complicated to add in this step, unless you want to use it like the right-click menus?

Windows 8 XAML Multilingual Translations

I've used the Multilingual Toolkit to translate my app and have been testing it using pseudo-language. It works fine for strings I have translated in code (C#) but I can't work out how to make it so that the tag in XAML is automatically translated.
I've been using http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh965329.aspx as a tutorial but I can't figure it out. I've also searched on Google but still no luck.
For example, I created a "Watermark" text box (which inherits from TextBox which shows some text in by default it the user has not entered any text and the item does not have focus. The XAML looks like this (I replaced generic positioning stuff with '...'):
<local:WatermarkTextbox x:Name="TitleTextBox" Watermark="MainPage_EnterATitle" ... Style="{StaticResource TextBoxStyle1}" />
As you can see it is setting a property called Watermark with a 'tag' of the resource name that is being translated using the Multilingual tool. I'm not sure how to get this to automatically translate.
Another example is using the bottom app bar buttons:
<Button x:Name="bottomAppBar_unpinFromStartButton" AutomationProperties.Name="MainPage_UnpinFromStart" Style="{StaticResource UnPinAppBarButtonStyle}" Click="bottomAppBar_unpinFromStartButton_Click"/>
And I can see in the link above that it says:
MediumButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name
But I'm not really sure where this is meant to go.
Even with a button, which seems like it would be the simplest to translate I can't get it to work. The XAML is:
<Button x:Name="RemovePhotoButton" x:Uid="MainPage_RemovePhoto" Content="" HorizontalAlignment="Center" Margin="222,0,974,78" Grid.Row="1" VerticalAlignment="Bottom" Width="170" Height="45"/>
But when ran in the app or viewed in the designed the button stays blank, with no text on it.
The Resources are set up like this:
And it is filling the translated documents fine:
I am able to translate it in C# using the code from the link above, just not using XAML.
Just wondering if anybody could help me out or point me in the right direction to solve this.
Thanks
First what i think is missing in the name of your resources is the property that you want to set. While never used it myself, i would understand it like this:
Your xaml needs to be changed to
<local:WatermarkTextbox x:Name="TitleTextBox" x:Uid="MainPage_EnterATitle" Watermark="" ... Style="{StaticResource TextBoxStyle1}" />
And your resource needs an entry with the key
MainPage_EnterATitle.Watermark
And about the part with the
MediumButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name
This is only used if the referenced property is an attached property. Like if your Watermark property would be attached not part of the control. But in your case its not important.