I have a .jsp page with 3 frames. The first frame contains a form which takes in a user ID. This form links to another .jsp which creates a token for the user and displays his information in the 2nd frame. The 3rd frame is supposed to take the token from the 2nd jsp which is passed to the 3rd jsp which returns an XML file of the user's access. How would I get the Submit button to open both of these frames? or should I have two separate buttons?
Take a look at this previous question it may be able to help. It focuses on using the onClick function within jQuery.
jqueryui frame dialog and multiple buttons
Related
I want to build a JApplet application, consists of 5 pages. Given data in one page will be input for next page. Based on given data I have to show different options in next page.
I am completely new to applets, previously worked with web applications. I need something similar to MVC but should completely with applets (Swing JApplet). Is there any framework like struts to implement it?
Please give me some ideas. How do I proceed?
For me it's something like wizard.
I would define a cutom model class storing data for each page and define 5 JPanels to represent the model's data for each step.
Then all the 5 panels should be placed in a container with CardLayout.
Moving to the next step reads current step data, stores the data in model and prepares the model's data for the next step.
After that card swapped and new step's panel is shown reflected prepared data from the model.
I have a JSF form of view *.jspx page. The form has around 20 fields. I have a print preview button, that would open a new browser window and show print preview of this form, making all the form content as read only.
I have done a bit of workaround like setting a boolean flag in Managed bean as showprintPreview. This approach has almost done the job by showing all the fields in readonly and buttons as disabled mode.
But, I don't want to change the backing bean object.
I'd like to show the print preview with css or javascript for a jsf form.
UPDATE:
I have tried another way by using onclick on print preview button that would call predefined, window.print() js function. But its displaying all the buttons as well. I would like to hide buttons like submit, back etc in print preview and show all the input fields like text, textarea etc.
I would reuse part of page wich you want to print. Create new page only with this reusable part. then on button action open this new page in new window (target="_blank") in print preview you mentioned.
I'm working on a JApplet form to create lesson plans.
Administrator only can edit lesson plan ( add, edit, delete ).
I used JApplet Form in netbeans, and I added Table control.
Function ADD:
Administrator can select for example 2 cells and click button "Add lesson", then the add form will be visible.
How can I make it so that two cells will link together in one?
It's the same with delete lesson from table. How do I delete an entire row?
The administrator needs to somehow log in and after the Servlet authenticates the user he can save the lessons (or delete or modify) server-side. Is there a standard way to handle communication between an Applet and a Servlet?
In answer to the first part "how can I make it so that two cells will link together?" on easy solution is with JPanel.
Rather than adding two text fields to your form, add a JPanel and then place the two text fields within the JPanel. We can now remove or add this JPanel to the form programmatically. Going further, we could write another class that extends JPanel that includes these two text fields along with whatever additional functionality we need with them.
in my project http://pastebin.com/3LBRZBQe i have used a submit button which should work when i click it but without any click next page opens.....I have 30 entries in my database which i have to display on a web page in such a way that first of all first 10 entries should be displayed and after clicking next button another 10 entries should be displayed and so on.....but when i run the program last 10 entries are displayed...
i want to use requestDispatcher method so that information should send to another jsp page....
You can use add parameters to define the range of requested numbers of records
,and in next page get these parameters
like:
/next?start=1&end=10
in next page :
request.getParameter("start");
request.getParameter("end");
and same for further...
How many JSPs to create to maintain one table for data entry. Add.jsp to enter a new record and Update.jsp to update an already entered record. Is this a good idea or create only one jsp and use that for add and update using some parameter as all the fields and functionality remains same. Only difference is at the time of update few fields will be disabled and you need to pre-populate the form. I can use struts or jsf to develop this.
Better use one page, and differentiate between new and existing based on some criteria - for example, if the id of the object is 0.
Even if you make two pages, you can include the common content so that you don't copy-paste.
I like the one page approach too.
You could have a dropdown box containing the ids' or some other value that provides an easy way for the user to find a specific record and whatever other html elements you need on the page for displaying a record.
They make a choice using the drop down box if they wish to edit a record and then that records data is displayed on the page for editing, the user enters the corrections and hits the submit button.
If they want to enter a new record, then they do not make a choice using the dropdown box and instead just fill in the fields on the page and hit submit.
When posting back to the page you can check and see if a selection was made using teh dropdown box and if not enter a new record and if a choice was made then you update the record that corresponds to the selection made from the dropdown box.