stuck with 1.0.2

2002-05-10 Thread Michael Dingler

Hi there,

I'm currently rewriting some protoype parts of an web
application with struts. Unfortunately I've got to use
1.0.2, so I miss some neat opportunities...

Once again it's a dynamic forms problem, at least I think
so...
One page where I have the problem is the user administration
part. Basically, you should be able to add new users,
change the permissions of existing ones or delete them.

So my pure JSP prototype with lots of ugly scriptlets
looked something like this:

--
 New User:   Profile [Adminstrator]  |Submit|

Existing Users:
Delete? Name:   Profile:
  [ ]   User1   [User]
  [ ]   User2   [Administrator]
  [ ]   User3   [Owner]

[Submit]
---

The [ ] part below Delete? is supposed to be a checkbox,
That Profile Stuff is a select.
The number of users is variable, of course.

So, what's the best practice for this kind of issue?
As far as I could gather from RTFM  RTFML, I could
model the lines as a Collection and just logic:iterate
over them. That is, if I'd be using 1.1...

I've got it working, but this involves scriptlets and
poking around in the request, just as my initial code
did. Sigh...

...Michael...

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Accessing form beans

2002-04-30 Thread Michael Dingler

Hi there, yet another question...

Is there an easy way to just display some form bean
properties? 
Let's say I've got a form defined as

html:form action=/foo
html:text property=bar /
/html:form

Now I just want to display an additional value from
the form bean as configured in the struts-config.xml
file.
As there's no html:write I have to use bean:write
which on the other hand requires a name.
To get things working I have to change the first line
to 
html:form type=com.yoyodyne.FooAction type=FooForm
 action=/foo

Is there a more elegant and less redundant way?

...Michael...

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Accessing form beans

2002-04-30 Thread Michael Dingler

Nicolas De Loof wrote:
 
 If /foo is mapped to FooForm bean, you can use
 
 bean:write name=FooForm property=xxx /
 
 without changes to your html:form. bean:write will look in scopes for an
 object called FooForm. This has no effect with using html:form or not -
 assuming FooForm is in session or request scope !
 
 If you've got problem with this, perhaps you don't have such an existing
 bean in scope. (look at the scope you setted in struts-config.xml).
 html:form with a type attribute will create one if there's none. html:
 tags can work without such a bean, just displaying no initial data.

Okay, thanks, that works. At least that saves me from putting too
much in the html:form tag, although I still have to repeat the
information from the struts-config in the bean:write tag.

Well, you can't have everything...

...Michael...

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Tab Panes

2002-04-29 Thread Michael Dingler

Hi,

I'm currently implementing a form with quite a lot
of values separated into several categories, and from
regular GUI experience I'd like to use some kind of
tab panes.
I'm implementing it with struts 1.0.2 on BEA Weblogic
and have run into some problems.

My basic idea is to use a single form bean as the
backend and one jsp for every pane. Now when the
user clicks on a pane rider, it should do two things:
forward to the new page and submit the values from the
form.

The forwarding works, I just use a html:link with the
form action and the action class forwards to the correct
pane according to paramId and paramName. But it just won't
seem to submit. Isn't onclick=document.forms[0].submit();
enough?

It looks like this:

JSP:
h:link href=/dada.do paramId=newTab paramName=oneTab
onclick=document.forms[0].submit()

Config:
action
   path=/dada
   type=com.consol.DadaAction
   name=DadaForm
   scope=session
   input=/newone.jsp
   forward name=goOne path=/newone.jsp/
   forward name=goTwo path=/newtwo.jsp/
/action

DadaAction:
String tab = request.getParameter(newTab);
if(operative.equals(tab)) {
return (mapping.findForward(goOperative));
}else if(system.equals(tab)) {
return (mapping.findForward(goSystem));
}

I hope someone can help me with this setup or recommend
a better approach. Preferably without additional libraries.

...Michael...

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]