How can I use custom javascript in Spring Roo generated pages? - javascript

I have been working on a spring roo project and I've hit a wall in terms of being able to customize the web page.
The main thing I want to do is be able to dynamically hide certain fields as the client is filling out the web form. I have a drop down list driven by enumerations that has 4 options and a fifth "other" option. If the user selects "other" I want a text box to appear so the user can fill out their own selection.
I was talking to someone and they said "This really depends on the UI you choose. In case of MVC scaffolding you can use javascript to drive these relationships". I am indeed using MVC scaffolding so I guess I have to use javascript. I don't really know that much javascript but the problem lies in that I don't even know where the javascript code would go in term of my project files. And then the second problem of course is how to use javascript to hide the fields dynamically in Spring.
Thanks

Spring MVC scaffolding uses dojo by default as its javascript framework.
You are able to use standard dojo functions when you attach events to DOM elements. You can simply use the <script/> tag to contain your own custom javascript methods within a generated .jspx page.
Additionally, you can integrate another existing javascript framework such as jQuery. At the moment you can include jQuery manually, but it can possibly be expected in a future Spring Roo version.
You can play safe with dojo for now.

Related

How can I make changes in an existing NetSuite form or how to write a new form using HTML, Bootstrap & JavaScript?

I am trying to create new form using HTML/ JavaScript in NetSuite.
I read some of the links (Creating Custom HTML Forms in NetSuite on Youtube) which depicted on how to do it, but when I tried on my personal account (administrator) it is not happening, I don't have that "Marketing Template" subtab in the Documents Section.
I have also read about the Suitlets, but everything is very confusing. These forms are supposed to pop up on NetSuite Window only.
Suitelets are the correct approach to create a new custom page in the NetSuite UI.
You can pull in any custom HTML, CSS, and AMD-compatible JS library you wish. To help more than that, you'll need to ask more detailed questions.
Here's a video showing an example of creating a Suitelet, although it uses the SuiteScript UI APIs rather than custom HTML: https://youtu.be/Hk2lG-SfZ3k

Using html+css+javascript or JSP as my presentation layer

I want to build an application which contains a basic menu (with, lets say 10 buttons), each button is a subject in my girlfriend's psychology course. when i click a button, i will be transfer to the specific subject's menu. (so i have 10 sub-menus like this).
In each sub menu, i can press buttons as well, but this time i wil get some sentences which i saved in mySql data base.
I know how to build the most of the server side part using spring (i know how to build the controllers and service layer) hibernate part (i know how to build the domains and DAO layer),
My problem is, that i don't know if i should use html+css+java script in order to build the menus and configure the functionality and communication between the controller and the client, or maybe should i use Jsp+Jstl?
Sorry for my lack of knowledge, i know this is quiet fundamental..
by using jstl tags you can build
like
<c:out value="${name}"/>

How can i change the language of my Html5 hybrid application using java script and jQuery?

In my application i have a option of language selection.
When I select an option, the entire application language should be changed.
I have already tried using Google and Microsoft api but guess that is paid. Is there any free api using javascript that can help me regarding this problem.
This post might be what you are looking for. They are talking about:
A wordpress, change language plugin widget.
A jQuery handler to change language by directing to another url.
Have a nice day!
Two options:
#1
Have a look here. Click "Options" top right and select another langauges. Open a datebox plugin widget and it will be in the language you specified.
I like the way it's done using Crowdin, although you will end up with all your text in .js files. If you check out one of the languages sample files this will be a lot of meat to load if your site becomes more complex.
#2
Do this server side. I'm (using Coldfusion) loading a langauge object on first page load and cache this until the user selects a new language. My langauge object is about 60k with 2000 entries. You could also send this to the page from server via json and store it in the page, then you could reference it from Jquery/Javascript.
I will probably end up trying to switch from server side to using the first approach and will try to see if I can split up my language .js files according to JQM page and then load them together with require, which would mean only a few ks per page. If you don't mind having a bunch of langauge files for each language and page, this would probably be the best "Mobile" approach.

Javascript, HTML and CSS Grid

I am ASP.NET MVC to develop my application on web. This app requires a grid to display, sort, and modify the data. User can perform all crud operation using this grid and needs to hide any column as per need. I have searched a lot on internet to find any free HTML based control which fulfill this requirement but I did not find.
I just want to have a grid which fulfill the above requirement either that only based on java script or it have some dependencies on ASP.NET MVC frame work like other grids which are based on server side scripting which generates HTML on run time.
Any kind of help will be appreciated.
You may take a look at the Telerik Grid.
Here are some links that may help:
Ext Js - Javascript solution... maybe a little overkill, but tons of stuff out of the box.
Tutorial - Using CRUD Operations with jQuery igGrid, Entity Framework and ASP.Net MVC3
StackOverflow - Some more javascript solutions here.

asp.net mvc vs javascript build whole site

i am building a site. There are two choices for me.
asp.net mvc 3.0 + ajax.
build whole site with ajax(javascript). Firstly, use ajax to get data with json format, and then fill the whole page with the data. In this way, the page will be produced only via javascript.
Could anyone tell me the advantages and disadvantages of these two ways?
Thanks in advance.
Javascript is not for building entire markup and rendering it. Don't shoot yourself in the foot.
Use ASP.Net MVC to build your site. Along side of ASP.Net MVC use jQuery/javascript to build ajax functionality.
If you choose the second option, it won't work in browsers with no JavaScript support. This may not seem all that important to you, but consider: most search engines don't support JavaScript. If search engines can't get the content on your site, it won't get ranked well.

Categories