I`ve been looking some more into the case and I think its becoming more of a
design matter...

I dont know if I am using struts the right way or not.
Problem is that I am building business logic into my forms.. Is this good or
not?
<logic :if you are a business customer (based on a session bean)...  >
    <html:text ask for his VAT number>
</logic>

Should I make 2 different pages or use tiles or something completely else?
problem is that on the first page I ask 5 questions to the customer. Based
on their choices the second form is built up. all business related stuff...

I  tried to write a validator like requiredif but based on beans from
somewhere in your scope
struts logic can work on beans from your session or request scope because it
has streight access to the pagecontext
I dont find a way to really access my pageContext in the validator.
but do you want your validator actually reading from your request scope or
session scope?

tnx for your time :)

Alexander Craen



----- Original Message ----- 
From: "Alexander Craen" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, March 02, 2004 3:38 PM
Subject: Re: Struts logic combined with the struts validator


> Well ,
>
> I thought about this as well.. however I cannot put bogus information in
the
> fields because their 'NULL' value matters to the registration process
>
> I would have to filter on the bogus information... which I would not like
to
> do
>
> tnx
>
> Alexander Craen
>
> ----- Original Message ----- 
> From: "Matt Bathje" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, March 02, 2004 3:24 PM
> Subject: Re: Struts logic combined with the struts validator
>
>
> > Alexander -
> >
> > Usually when I have this situation I just put in an else (or a
> > logic:notEqual in your case) which prints out the form field as hidden
> with
> > some "bogus" data in it. That "bogus" data will be enough to make the
> > validation pass of course.
> >
> > I had thought about doing the requiredifpresent or something like that,
> but
> > this always seemed much simpler.
> >
> > Matt Bathje
> >
> > ----- Original Message ----- 
> > From: "Alexander Craen" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, March 02, 2004 8:14 AM
> > Subject: Re: Struts logic combined with the struts validator
> >
> >
> > > Maybe i`ll better rephrase my question to make it more easy for the
> reader
> > > :)
> > >
> > > I want to make a field in a form required when it exists on the form
> > >
> > > if it is not on the form (due to some logic tags that make it
> disappear),
> > I
> > > dont want to generate an error.
> > >
> > > How would I best solve this?
> > >
> > > make a new validator "requiredifpresent" ?
> > > or could I use the requiredif together with some logic based on values
> in
> > > other beans ?
> > >
> > >
> > > ----- Original Message ----- 
> > > From: "Alexander Craen" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, March 02, 2004 11:25 AM
> > > Subject: Struts logic combined with the struts validato
> > >
> > >
> > > > Hello,
> > > > I am making a registration procedure that works with some logic
based
> on
> > > the
> > > > choices the customer makes on a previous page
> > > >
> > > > <logic:equal name="LogonForm" property="customertype"
scope="session"
> > > > value="business">
> > > >     <span class="label"><label><bean:message
> > > > key="text.data.label.bill_vat_number"/></label></span>
> > > >     <html:text property="bill_vat_nr" styleId="bill_vat_nr" />
> > > > </logic:equal>
> > > >
> > > > Problem description :
> > > > When a customer is of customertype 'business' the field bill_vat_nr
is
> > > > showed on the page and is required when a customer is not of
> > customertype
> > > > 'business' the field bill_vat_nr is not showed on the page and
> theirfor
> > is
> > > > not required
> > > >
> > > > I tried to use a standard struts validator implementation
> > > > <field property="bill_vat_nr" depends="required">
> > > >     <arg0 key="text.data.label.bill_vat_number"/>
> > > >     <arg1 key="${dummy}"/>
> > > > </field>
> > > >
> > > > I first thought about using the requiredif implementation. Problem
is
> > that
> > > I
> > > > only get it to work with elements from the same form.
> > > >
> > > > The result :
> > > > The bill_vat_nr is required even if it has been left out of the form
> by
> > > > struts logic
> > > >
> > > > My question :
> > > > Is their a way to combine struts logic and the validator framework?
Do
> I
> > > > have to write a custom validator that does some kind of
introspection
> on
> > > the
> > > > jsp? Or are their validators that are used for that purpose? What
> would
> > be
> > > > the best solution to tackle this problem?
> > > >
> > > > Tnx in advance
> > > > Alexander Craen
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



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

Reply via email to