Link to home
Create AccountLog in
JSP

JSP

--

Questions

--

Followers

Top Experts

Avatar of Emanuele_Ciriachi
Emanuele_Ciriachi

Populatin an ActionForm with PageInput data
Hello, in my application I have a form which receives data thru the tag:


<netui-data:declarePageInput name="getCustomerByIdResult" type="model.Customer" required="true" />

I get a class this way, and I can successfully populate the form's field with the class I get, using the tag:


<netui:hidden dataSource="getCustomerByIdResult"></netui:hidden>

But now, I would like to use this object to populate an ActionForm; I guess I will need to build a FormBean to do that. Can someone guide me/give me some hints on how to do this?
Thanks in advance.

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of suprapto45suprapto45πŸ‡ΈπŸ‡¬

Hi,

I guess that this is WebLogic as you are using <netui> tags.

Well, populating a FormBean does not necessarily require any PageInput. Populating a FormBean can be done in your Controller.

First, can you let me know the root of your problem? And if possible, post your current codes.

David

Avatar of Emanuele_CiriachiEmanuele_Ciriachi

ASKER

You are right, I am using Weblogic Workship.
Basically I have .jsp form which is populated using pageinput, and after filling the form I want the update to be done using actionForm. I'm not home now (the code is there), wil post the code snippets this afternoon. It's the 2nd tutorial of the Weblogic documentation, anyway, the one with the CustomerServiceEAR application.

This one: http://edocs.bea.com/workshop/docs92/ws_platform/webapplications/tutorial/tutWebAppIntro.html

and this is the tutorial page with my current problem (apparently, the file with the formBean is missing from my installation):


this is the code of the .jsp where I insert the data to be updated:
http://edocs.bea.com/workshop/docs92/ws_platform/webapplications/tutorial/tutWebAppStep4.html

#============================
# Begining of code snippet
#============================
<netui:form action="updateCustomer">
Β Β Β Β Β Β  Β Β Β Β Β <netui:hidden dataSource="actionForm.customer.id"></netui:hidden>
Β Β Β Β Β Β  Β Β Β Β Β <table>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β <tr valign="top">
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td>Customer:</td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <table>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β <tr valign="top">
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td>FirstName:</td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td><netui:textBox dataSource="actionForm.customer.firstName"></netui:textBox>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β </td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β </tr>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β <tr valign="top">
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td>LastName:</td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td><netui:textBox dataSource="actionForm.customer.lastName"></netui:textBox>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β </td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β </tr>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β <tr valign="top">
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td>CompanyName:</td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td><netui:textBox dataSource="actionForm.customer.companyName"></netui:textBox>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β </td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β </tr>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β <tr valign="top">
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td>City:</td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td><netui:textBox dataSource="actionForm.customer.city"></netui:textBox>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β </td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β </tr>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β <tr valign="top">
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td>State:</td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td><netui:textBox dataSource="actionForm.customer.state"></netui:textBox>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β </td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β </tr>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β <tr valign="top">
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td>Zip:</td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td><netui:textBox dataSource="actionForm.customer.zip"></netui:textBox>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β </td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β </tr>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β <tr valign="top">
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td>Phone:</td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td><netui:textBox dataSource="actionForm.customer.phone"></netui:textBox>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β </td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β </tr>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β <tr valign="top">
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td>Email:</td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β <td><netui:textBox dataSource="actionForm.customer.email"></netui:textBox>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β </td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β </tr>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β </table>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β  Β Β Β Β Β </td>
Β Β Β Β Β Β  Β Β Β Β Β Β Β Β Β Β Β </tr>
Β Β Β Β Β Β  Β Β Β Β Β </table>
Β Β Β Β Β Β  Β Β Β Β Β <br />
Β Β Β Β Β Β <netui:button value="updateCustomer" type="submit" />
Β Β Β Β Β Β </netui:form>
#============================
# End of code snippet
#============================

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of suprapto45suprapto45πŸ‡ΈπŸ‡¬

Ok,

So where is your problem now? You should have updateCustomer.do method in your Controller with the ActionForm within the method. Right?

It should be something like

protected Forward updateCustomer(WhateverForm form)

The problem is that, although I have

<netui-data:declarePageInput required="true" type="model.Customer" name="getCustomerByIdResult" />

in the form page code, the data doesn't show up -- the form stays blank. I debugged the control method and indeed data is present in "getCustomerByIdRsult" -- I'm missing the syntax to make the form populated with this data while STILL being an ActionForm.

ASKER CERTIFIED SOLUTION
Avatar of suprapto45suprapto45πŸ‡ΈπŸ‡¬

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Will try it tomorrow, thanks for the reply.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of suprapto45suprapto45πŸ‡ΈπŸ‡¬

I will not be available to reply you until mid Jan 2007. I will be going off for my vacation tommorow.

Happy New Year 2007.
David

Will check when I have time in those days, didn't had time recently... sorry to keep the question hanging
JSP

JSP

--

Questions

--

Followers

Top Experts

JavaServer Pages (JSP) allow the development of dynamically generated web pages. It uses the Java programming language; JSP pages are translated into servlets at runtime, with each servlet being cached and reused until the JSP is modified. JSP allows Java code to be interleaved with static web markup content, so the resulting page can be compiled and executed on the server to deliver the content.