combining tags

2005-07-06 Thread Tom Holmes Jr.

I used to have some JSP code that looked like:

logic:iterate name=myForm property=myDataList id=iter
   html:checkbox name=iter property=checkedRes indexed=true/
   bean:write name=iter property=roomType/
  html:text name=iter property=numItems indexed=true 
style=width:40/

/logic:iterate

I'd like to switch to something likes this:
c:forEach items=${SelectedRoomsForm.roomsList} var=data 
varStatus=status

   html:checkbox name=data property=checkedRes indexed=true/
   c:out value=${data.roomType}/
  html:text name=data property=numItems indexed=true 
style=width:40/

/c:forEach

The c:out tag I am sure works, but I am not sure about the 
html:checkbox or the html:text


Does this code look ok, or is there something I have to change?

Thanks.
 Tom

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



taglibs help

2005-07-06 Thread syed abrar
  
Hello,
  Iam new to this Struts framework.I have been assigned a complex GUI 
coding.
   The screen has two frames :In one frame we have the family(family name 
as a link and a checkbox to select) and in the second frame we have the family 
members corresponding to the family.The family members(family member name and a 
checkbox) are to be displayed when the family name link in first frame is 
clicked.In the second frame also we have checkbox for the user to select.  
   The user is allowed to select either the complete family by checking 
the chebox in the first frame or individual family memebers by selecting the 
checkboxes in the second frame.
   If a family name is checked in the first frame,and then the link on it 
is selected ,then all its family members in the second frame should have the 
initial state as checked.(Totally 38 families and correspondingly 8000 family 
members have to be selected..The state of all the checkboxes have to be 
captured when this page is submitted

If any one of you have any sample code which will be useful fo this 
requirement,send it to me.I will be very thankful for the help.


Regards
Abrar 



Re: taglibs help

2005-07-06 Thread Wendy Smoak
From: syed abrar [EMAIL PROTECTED]

 Iam new to this Struts framework.
 I have been assigned a complex GUI coding.

If you are indeed using Struts, you might want to post to the struts-user
list instead.  (This is taglibs-user.)  You can find info here:
http://struts.apache.org/mail.html

-- 
Wendy Smoak


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



Re: combining tags

2005-07-06 Thread Rahul Akolkar
Tom - Please see reply below:

On 7/6/05, Tom Holmes Jr. [EMAIL PROTECTED] wrote:
 I used to have some JSP code that looked like:
 
  logic:iterate name=myForm property=myDataList id=iter
html:checkbox name=iter property=checkedRes indexed=true/
bean:write name=iter property=roomType/
   html:text name=iter property=numItems indexed=true
 style=width:40/
  /logic:iterate
 
 I'd like to switch to something likes this:
 c:forEach items=${SelectedRoomsForm.roomsList} var=data
 varStatus=status
html:checkbox name=data property=checkedRes indexed=true/
c:out value=${data.roomType}/
   html:text name=data property=numItems indexed=true
 style=width:40/
 /c:forEach
 
 The c:out tag I am sure works, but I am not sure about the
 html:checkbox or the html:text
 
 Does this code look ok, or is there something I have to change?

Though you can mix and match JSTL and the Struts taglibs, you should
be aware of the inter-dependencies between specific tags. For example,
the indexed property of the struts-html tags relies on a parent
logic:iterate to produce the resulting name attribute. I recommend
reading this FAQ page [
http://struts.apache.org/faqs/indexedprops.html ] and the TLD docs in
general.

If you stare at the markup generated by the first snippet, that will
tell you what the JSTL snippet should look like.

-Rahul

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



Re: taglibs help

2005-07-06 Thread Rahul Akolkar
On 7/6/05, Wendy Smoak [EMAIL PROTECTED] wrote:
 From: syed abrar [EMAIL PROTECTED]
 
  Iam new to this Struts framework.
  I have been assigned a complex GUI coding.
 
 If you are indeed using Struts, you might want to post to the struts-user
 list instead.  (This is taglibs-user.)  You can find info here:
 http://struts.apache.org/mail.html
snip/

Thanks Wendy, though Abrar, I wonder if this is even a struts question
just yet. It will help if you specify what view technology you are
using, and if its JSPs, whether you're using JSTL or the Struts
taglibs. The same link from a previous thread is probably going to be
helpful with respect to the last bit (submitting the information using
a collection of checkboxes) if you choose JSPs and further, the Struts
Taglibs [ http://struts.apache.org/faqs/indexedprops.html ]. You will
also need some client-side artifacts to update the view as you
describe.

Looking up JSP, JSTL, Struts and JavaScript references should give you
the right ideas.

-Rahul

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



Re: combining tags

2005-07-06 Thread Wendy Smoak
From: Tom Holmes Jr. [EMAIL PROTECTED]

 I'd like to switch to something likes this:
 c:forEach items=${SelectedRoomsForm.roomsList} var=data
 varStatus=status
 html:checkbox name=data property=checkedRes indexed=true/
 c:out value=${data.roomType}/
html:text name=data property=numItems indexed=true
 style=width:40/
 /c:forEach

 The c:out tag I am sure works, but I am not sure about the
 html:checkbox or the html:text

 Does this code look ok, or is there something I have to change?

Assuming you're not on a JSP 2.0 container (I assume not, or you wouldn't be
using c:out) you might want to switch to the Struts-EL tags instead of the
'classic' taglib.  With the ability to use expressions in the JSTL tags,
you'll quickly get frustrated at NOT being able to do it in the Struts tags.

Indexed tags are now supported within c:forEach loops, according to the
README.txt file included with Struts-EL.  To switch over, look in the
'contrib' directory of the Struts 1.2.7 distribution, get the .jar files and
change to:
 %@ taglib uri=http://struts.apache.org/tags-html-el; prefix=html-el
%
(Some people leave the prefix as 'html'.)

All my checkboxes-within-forEach-loops are 'multibox' not 'checkbox'.  But I
don't use indexed properties, so YMMV.

-- 
Wendy Smoak


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



Re: combining tags

2005-07-06 Thread Tom Holmes Jr.

Wendy Smoak wrote:


From: Tom Holmes Jr. [EMAIL PROTECTED]

 


I'd like to switch to something likes this:
c:forEach items=${SelectedRoomsForm.roomsList} var=data
varStatus=status
   html:checkbox name=data property=checkedRes indexed=true/
   c:out value=${data.roomType}/
  html:text name=data property=numItems indexed=true
style=width:40/
/c:forEach

The c:out tag I am sure works, but I am not sure about the
html:checkbox or the html:text

Does this code look ok, or is there something I have to change?
   



Assuming you're not on a JSP 2.0 container (I assume not, or you wouldn't be
using c:out) you might want to switch to the Struts-EL tags instead of the
'classic' taglib.  With the ability to use expressions in the JSTL tags,
you'll quickly get frustrated at NOT being able to do it in the Struts tags.

Indexed tags are now supported within c:forEach loops, according to the
README.txt file included with Struts-EL.  To switch over, look in the
'contrib' directory of the Struts 1.2.7 distribution, get the .jar files and
change to:
%@ taglib uri=http://struts.apache.org/tags-html-el; prefix=html-el
%
(Some people leave the prefix as 'html'.)

All my checkboxes-within-forEach-loops are 'multibox' not 'checkbox'.  But I
don't use indexed properties, so YMMV.

 

I have no idea if it is a JSP Container 2.0 or not.  I can tell you that 
we are using IBM Websphere 5.1.x Portal Server.   I can also tell you 
that the the imports we are using in our JSP pages look like:

%@ taglib uri=/WEB-INF/tld/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/tld/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/tld/struts-logic.tld prefix=logic %
%@ taglib uri=/WEB-INF/tld/c.tld prefix=c %

And we are using Struts.   My boss has told me at one point that he'd 
wanted to start using JSTL tags more then the older JSP Tag Libraries.  
To me, that means using more of the c:? tags, but we still need to use 
html:? tags.  To my boss, that would mean getting more functionality and 
using expressions as you stated.  For example, rather than writing:


bean:write name=iter property=selectedStartDate1/ -
 bean:write name=iter property=selectedEndDate1/br

Instead we could do:
c:out value=${data.selectedStartDate1} - ${data.selectedEndDate1} /

Doesn't that seem easier to understand?  I just figured we'd get the 
same results when we submit the form.  When using logic:iterate I 
understand how we can do c:out just fine.  And it works fine with 
html:text, but it's when we do c:if test= something that I was 
getting into trouble.  It didn't seem to work?


As Rahul stated, I'll check the generated HTML source and I'll also 
check the Action class to see if the data submitted is the same.


Thanks for the help.

  Tom

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



Re: combining tags

2005-07-06 Thread Wendy Smoak
From: Tom Holmes Jr. [EMAIL PROTECTED]

 I have no idea if it is a JSP Container 2.0 or not.  I can tell you that
 we are using IBM Websphere 5.1.x Portal Server.

A quick Google search didn't turn up the info-- I'm trying to determine
which version of the Servlet specification it implements.  My comment was
merely that if it's Servlet 2.4/JSP 2.0, you probably would have written
${data.roomType}
instead of c:out value=${data.roomType}/.  Not that you wouldn't use
*any* c:xxx tags.

So, let's assume Servlet 2.3/JSP 1.2 for now.

 And we are using Struts.   My boss has told me at one point that he'd
 wanted to start using JSTL tags more then the older JSP Tag Libraries.
 To me, that means using more of the c:? tags, but we still need to use
 html:? tags.

My point was that if you're going to add JSTL to a Struts project, you might
also want to move to Struts-EL in order to gain the ability to use
expressions within the Struts tags, as well as the JSTL-awareness so that
indexed properties will work within an enclosing c:forEach loop.
http://struts.apache.org/faqs/struts-el.html

-- 
Wendy Smoak


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



RE: combining tags

2005-07-06 Thread Karr, David
To clarify some comments from other responders:

It is a good idea to use Struts-EL if you're going to use the JSTL.
However, for this particular example, the Struts tag library itself has
knowledge of c:forEach, as opposed to logic:iterate, so an html
Struts tag that uses indexed=true will work inside a c:forEach, at
least with respect to generating the correct indexed property values.

 -Original Message-
 From: Tom Holmes Jr. [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, July 06, 2005 8:02 AM
 To: Tag Libraries Users List
 Subject: combining tags
 
 
 I used to have some JSP code that looked like:
 
  logic:iterate name=myForm property=myDataList id=iter
 html:checkbox name=iter property=checkedRes 
 indexed=true/
 bean:write name=iter property=roomType/
html:text name=iter property=numItems indexed=true 
 style=width:40/
  /logic:iterate
 
 I'd like to switch to something likes this:
 c:forEach items=${SelectedRoomsForm.roomsList} var=data 
 varStatus=status
 html:checkbox name=data property=checkedRes 
 indexed=true/
 c:out value=${data.roomType}/
html:text name=data property=numItems indexed=true 
 style=width:40/
 /c:forEach
 
 The c:out tag I am sure works, but I am not sure about the 
 html:checkbox or the html:text
 
 Does this code look ok, or is there something I have to change?
 
 Thanks.
   Tom
 
 -
 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]