Configure library for tomahawk in JSF 2.0 - file-upload

I am trying to upload a file using <t:inputFileUpload/> , in JSF2.0 facelets
for that i need to use namespace xmlns:t="http://myfaces.apche.org/tomahawk/"
but showing error like "No library found for this namespace"
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:t="http://myfaces.apache.org/tomahawk" <!--Error Here : No library found for this namespace--->
In above code last line show's error
How could i manage this error...

No library found for this namespace means you have not added library
Add tomahawk-1.1.9.jar to your Build Path

Related

PrimeFaces fileUpload not working with dropZone

I'm unable to upload a file that is dragged onto an inputTextarea component registered as a dropZone. Here's my code, based on the PrimeFaces demo example - am I missing something? The file uploads when it is dragged onto the fileUpload component itself.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head></h:head>
<h:body>
<h:form enctype="multipart/form-data">
<p:inputTextarea id="customDropZone" />
<p:fileUpload
dropZone="customDropZone"
widgetVar="docUploader"
listener="#{test.uploadDocument}"
sizeLimit="100000"
allowTypes="/(\.|\/)txt$/"
/>
</h:form>
</h:body>
</html>
The setup is Glassfish 6.2 / Primefaces 10 / Mojarra 3.0.1.
The dropZone attribute was added to PrimeFaces 11 (so, it's not available in 10). Note that currently the showcase shows PrimeFaces 11.0.0-RC1. So, upgrade if you want to use this feature.
See also:
https://github.com/primefaces/primefaces/issues/7279
https://github.com/primefaces/primefaces/blob/master/docs/11_0_0/gettingstarted/whatsnew.md
https://github.com/primefaces/primefaces/pull/7283

File upload with Behat, Mink & PhantomJS

I am trying to upload a file using Behat. Therefore I wrote this simple HTML page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<form method="post" enctype="multipart/form-data">
<input type="file" name="file" id="file" /><br />
<input type="submit" />
</form>
</body>
</html>
and a simple Behat feature:
Feature: test
Scenario: Some Test
Given I am on "/upload.php"
And I attach the file "/path/to/tile" to "file"
When the I attach the file ... to ... phrase is executed, the selenium 2 driver generates a curl request and sends it to PhantomJS: http://localhost:4444/wd/hub/session/5b9a8630-ed8e-11e4-956f-956a9ce75127/element/:wdc:1430215640681/value with params: {"value":["\/path\/to\/file"]}
The request does not terminate unless aborting it and PhantomJS does not react on the request in any way.
I already searched through the net and found several threads saying that it does work and several saying that does not work including an issue on github (https://github.com/detro/ghostdriver/issues/282) which was closed and reopend multiple times.
Versions:
PhantomJS: 2.0.0
Behat: 3.0.15
Mink: 1.6.1
Mink-Selenium2-Driver: 1.2.0
Does anyone know a working solution for this problem?
Could this behaviour exist due to inability to upload files that is a known bug with PhantomJS v 2.0.0?
Basically, a change made in Qt 4.8 and incorporated subsequently in Qt 5.0 prevented clicking on file input elements that were not caused by user gestures.
The solution is discussed further in the issue thread.
To quote, you have to comment one if condition in
/src/qt/qtwebkit/Source/WebCore/html/FileInputType.cpp
//if (!ScriptController::processingUserGesture())
// return;
then compile the binary.

Link to a html file within a repository from trac wiki

I am attempting to link from my wiki to web documentation within the source repository. This functionality I think is provided by using "export" links, e.g.
[export:path/to/file/index.html]
(after setting [browser] render_unsafe_content = yes)
However, when I do this I get the following browser error:
This page contains the following errors:
error on line 17 at column 10: Opening and ending tag mismatch: link line 0 and head
Below is a rendering of the page up to the first error.
(followed by a small snippet of the html page I'm trying to display).
I'm using trac v 1.1.
(see also this related question: How to link to html file in Trac)
UPDATE:
It seems using export does work with other html files, specifically, there's no problem with an xhtml document starting:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
but I am seeing issues with a (valid) html5 document starting:
<!DOCTYPE html>
<html lang="en">
<head>
which I think trac is attempting to parse as xml and then failing.
To create a hyperlink to a file within your repository you can simply use the following wiki syntax:
[browser:<path> <label>]
Where path is the path to the file within your repository and label is the text to be displayed for the link.

Ext.Net error in razon engine #Html.X(). 'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'X'

I am trying to use Ext.Net in MVC 4.
In razor engine i am trying with an example like this:
#{
Layout = "";
}
<!DOCTYPE html>
<html>
<head>
<title>Ext.NET Examples</title>
</head>
<body>
#Html.X().ResourceManager()
#(Html.X().TabPanel()
.Height(300)
.Items(items => {
items.Add(Html.X().Panel().Title("Test"));
}));
</body>
</html>
When i run i recieve this error in the browser:
CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'X' and no extension method 'X' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)
Any ideas?
Html.X is the MVC helper for Ext.NET which is an .NET version of extJS/Sencha. So most likely you didn't install/configure the Ext.NET properly.
I suggest you check via your project's nuget packages manager if Ext.NET is installed and then go to their website and check what is the proper web.config configuration to make it all work. Here is the link:
http://www.ext.net/

Unable to start basic application using sencha 2. Library files are not loaded

I am a new bee to sencha 2.I wanted to run a basic application using sencha touch but unable to load the application.
Here is what I have done.
I have downloaded the notesApp from miamicoder and i am trying to run the first chapter.
I have attached the folder structure in the screenshot. Please have a look to understand the folder structure.
Here is my index.html
<!DOCTYPE html>
<html>
<head>
<title>My Notes</title>
<link href="sencha-touch.css" rel="stylesheet" type="text/css" />
<script src="sencha-touch-debug.js" type="text/javascript"></script>
<script src="app.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
I have downloaded sencha sdk 2.1 and took sencha-touch-debug.js and sencha-touch.css and placed in the root of the folder and referred from index.html as mentioned below. I used to to the same thing in sencha 1 and I was getting success but I am getting below error if I am trying to do the same with sencha 2.
I am getting errors as below.
Failed to load resource file:///path/NotesApp-Book-Code-Ch1/src/event/Dispatcher.js?_dc=1354982532236
Failed to load resource file:///path/NotesApp-Book-Code-Ch1/src/event/publisher/Dom.js?_dc=1354982532238
Uncaught Error: [Ext.Loader] Failed loading 'file:///path/ebook-building-a-sencha-touch-2-app%20(1)/NotesApp-Book-Code-Ch1/src/event/Dispatcher.js', please verify that the file exists sencha-touch-debug.js:8324
Uncaught Error: [Ext.Loader] Failed loading 'file:///path/ebook-building-a-sencha-touch-2-app%20(1)/NotesApp-Book-Code-Ch1/src/event/publisher/Dom.js', please verify that the file exists
Is it necessary to use senchatools and generate folder structure? Simply copying the two lib files (sencha-touch-debug.js and sencha-touch.css) and refer them from index.html will not work with sencha 2?
Please help.
Thank you.
I got the answer. Working with Sencha touch 2 needs to include the complete SDK in the project folder not only 2 library files like sencha 1. Including the complete framework will solve the issue.
Thanks