Google Web Toolkit Tutorial Question - gwt

I searched high and low and cannot a button tag in any of the javaScript that is generated that referred to step 7 of the tutorial. I must be looking in the wrong places, or I'm generating the code incorrectly. I generated the code in the three different levels of detail. Can anyone point me in the right direction who's completed the tutorial or is more experience with the GWT? Looked in every file inside of the war directory. Of course I could have missed one! :-/ Would definitely like to be able to find this stuff on my own when I begin development.
Here's the link:
http://code.google.com/webtoolkit/doc/latest/tutorial/style.html
Look under 3. Associating style rules with GWT-generated HTML elements. What I'm specifically trying to find is the tag.
<button class="gwt-Button" tabindex="0" type="button">Add</button>
Of course you don't have to do the tutorial any project you've worked on should have similiar tags to be found I just can't find the file containing them...
I did find some stuff containing gwt-Button class name on line 3078 of one of those "unique" file names, but the way the author stated it made me think this process would be "easier". This was generated using the pretty compile.
function $Button(this$static, html){
$ButtonBase(this$static, ($clinit_21() , $doc).createElement("<BUTTON type='button'><\/BUTTON>"));
this$static.element['className'] = 'gwt-Button';
this$static.element.innerHTML = html || '';
return this$static;
}
This looks like it could be used to generate the tag. Is this a combination of some javaScript and some javaScript library code like JQuery or Prototype?
Thanks

The best way I know to see the javascript generated by GWT is to use the Brain.jar DOM Viewer http://www.brainjar.com/dhtml/domviewer/
It's not the most user friendly, but if you click around, you can generally find the InnerHTML of some element that corresponds to the whole web page, and then search for "button" or the relevant keyword.

Related

Can Emmet Be Used to Create FXML?

I have a scalaFX app that currently has its views created programmatically. I am wondering if I can use the Emmet tool to create FXML (particularly ScalaFXML) because I want to recreate my views in ScalaFXML to separate my views from my controllers more effectively. I have searched the internet and cannot find out if this is possible. So far I have only used Emmet for HTML. Thanks in advance for the help!
I have been looking around for something for PrimeFaces; I had trouble finding anything. I guess maybe it's because people who are using it are actually writing "normal" HTML with JS frameworks.
The good news is, it's completely (and easily!) customizable: just find the installation directory, and edit the "snippets.json" file, or create a new one called (for example) snippets-scalaFX.json. Mine on a Windows 10 machine, installed as a plugin for NPP, was C:\Program Files (x86)\Notepad++\plugins\EmmetNPP\emmet\snippets.json.
It's pretty obvious once you get in there, but inside the "snippets" object just add some more fields for yourself. For example, to make a PrimeFaces commandButton tag I added:
"pc": "p:commandButton"
You can use $0 or ${<placeholder text>} to define tabstops for expanded snippets, and | to define the caret starting point.
Full docs on editing snippets are here.

!DOCTYPES the document type definition in more detail

I am researching this in detail and just need more specific answers on the various parts of a !DOCTYPE.
In particular I would like a thorough break down of the parts of a !DOCTYPE that is strict.
I understand that there are various !DOCTYPES and I would like to know what every part of the declaration means as it is broken down into its various parts and this will help me move on with my research.
!DOCTYPE html PUBLIC (let's start here)
I understand that a doctype is the first thing you should see declared at the top of an html page in the code and that this tells the browser how to display your code.
Then we come to html:
Explaining that this is a hyper text mark-up language being used
'PUBLIC' what is this referring to exactly could you help me with this?

How to define custom wicket tag

I could not find a wicket tag like wicket:include? Can anyone suggest me anything? I want to include/inject raw source into html files? If there is no such utility, any suggestions to develop it?
update
i am looking for sth like jsp:include. this inclusion is expected to be handled on the server side.
To do this, you'll need to implement your own IComponentResolver.
This blog article shows an example somewhat resembling what you're after.
Is it raw markup that you want to include, or Wicket content?
If it's raw markup, even a simple Label can do that for you. If you call setEscapeModelStrings( false), the string value of the model will be copied straight in the markup. (Watch out for potential XSS attacks though.)
"Including" Wicket markup is done via Panels (or occasionally Fragments)
Update: If you add more detail about the actual problem you need to solve, there's a good chance that we can find a more "wickety" solution, after all, JSP and Wicket are two different worlds and the mindset of one doesn't work very well in the other.

How should I use <a href> tag to access other templates in lift?

According the Lift wiki, I know the "View First" concept of Lift. That's very different from any framework I used. Take the basic JSP things as the example, I could write
Create a new post
in the page, and write the logic in a servlet. How can I do things like this with lift? I wrote the same tag in a template and when I accessed this page I got 404 error. But if I add a Menu to the SiteMap, things goes well. Is there any possible to make a link without making a new Menu? I am a beginner of Lift and Scala. Thanks in advance.
When everything is declared in your SiteMap, you can have Lift generate the links for you.
Yes, it is possible.
Just don't call LiftRules.setSiteMap at your boot class, then Lift will let you access every pages under your webapp/ directory. You could test your code in this mode.
But this will also lead to no access control, so be careful.
It is also possible to do what I think you asked, which is to make the link accessible, but not visible in the SiteMap (if you don't want the SiteMap at all, go with Brian's answer), with code like this:
SiteMap(Menu("PreClass") / "preClass" >> Hidden)
We prefer to leave the SiteMap enabled as tightly controlling access seems like a good idea in our case.

How can I search in an UIWebView?

I need to perform search in an html page displayed in a UIWebView control. The functionality I need is something that Safari has, when you hit command/ctrl F for searching the document for some word and the program highlights the hits for you. Is there any easy solution for this problem?
I know it's been a long time since you asked this question, but it's still a pretty common question people have so I put together a sample project in case anyone else is asking the same question. The project is a super simple app that loads an HTML file and can search and highlight any keyword. You can download the sample project here:
https://www.dropbox.com/s/jietctrvrtnec28/TheSearcher.zip?dl=0
Scott
Edit: changed link above as the old one had broken.
You could do this with javascript. Check out the "Find in this page" bookmarklet:
http://www.lifeclever.com/17-powerful-bookmarklets-for-your-iphone/
Something like that, combined with:
http://developer.apple.com/iphone/library/documentation/uikit/reference/UIWebView_Class/Reference/Reference.html#//apple_ref/occ/instm/UIWebView/stringByEvaluatingJavaScriptFromString:
might do the trick.