html:option tag with jbo:RowSetIterate
Hi
I am trying to build a list box using the following code.
<html:select property="providerTypeId">
<html:option value=""> </html:option>
<jbo:RowsetIterate datasource="PModule.ProviderTypeLuVO">
<html:option value="<jbo:ShowValue datasource='PModule.ProviderTypeLuVO' dataitem='ProviderTypeId' />"> <jbo:ShowValue datasource="PModule.ProviderTypeLuVO" dataitem="ProviderType" />-<jbo:ShowValue datasource="PModule.ProviderTypeLuVO" dataitem="ProviderTypeDesc" /> </html:option>
</jbo:RowsetIterate>
</html:select>
-- The list box builds like this
<option value="<jbo:ShowValue datasource="P.ProviderTypeLuVO" dataitem="ProviderTypeId" />">10-PHYSICIAN, M.D</option>
The value is not retrieved from the ShowValue tag.
Can some one help on this issue.
Thanks
Do you have the taglib correct at the top of the page ?
i.e.
<%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
Rather than the ShowValue tag I tend to use the Row tag to have the row as an object on which I can call the getAttribute method to then populate the combo / list box.
e.g.
<select name="recallPriorityCode">
<option value="">
</option>
<jbo:RowsetIterate datasource="spds">
<jbo:Row id="sprow" datasource="spds" action="Current" />
<%
String priorityCode = sprow.getAttribute("PriorityCode").toString();
String priorityDescription = sprow.getAttribute("PriorityDescription").toString();
%>
<option value="<%= priorityCode %>">
<%= priorityDescription %>
</option>
</jbo:RowsetIterate>
</select>
Hope this helps.
Similar Messages
-
How to populate the <html:option> tag dynamically
I have a tree view, in tree view tag ( <layout:maeuItem> tag i have written "onclick " event )
<layout:menuItem key="${agrovoc.AGURI}" link="#"
onClick="return copyVal(this)">
<script language="javascript" type="text/javascript">
function copyVal(obj){
str= obj.innerHTML;
l = str.length-4;
xyz= str.substring(12,l);
document.getElementById('agrovoc').value =document.getElementById('agrovoc').value + xyz+'\n';
</script>Here "xyz" contains the Term ( the term clicked in the tree view) now i want add these terms ( clicked in tree view) into <html: option> tag.... how to do this.. plz give me some ideas
<html:select property="agrovocbuffer" size="10" >
<html:option value="" styleId="agrovoc1"></html:option>
</html:select>Hi,
i have tried with this, it's works fine... but when i click on the next page ( i mean 2 or 3 page etc ) the content of <html:option> are erasing (deleting).. i wanted those terms wht i have selected in the 1st page to remain in <html:option> when i click on 2 nd page also...
Tree view code
<layout:menuItem key="${agrovoc.AGURI}" link="#"
onClick=" copyVal(this)">JavaScript
<script language="javascript" type="text/javascript">
var i=0;
var myArray=new Array();
function copyVal(obj){
var flag=0;
str= obj.innerHTML;
l = str.length-4;
xyz= str.substring(12,l);
while (xyz != null) {
for( var l=0;l<myArray.length;l++){
if( myArray[l]==xyz){flag=1;alret("The Term is already selected.");}
if(flag!=1){
document.getElementById('agrovoc').options[i] =new Option(xyz,xyz);
myArray=xyz;
i++;
//alert(i);
xyz=null;
function del(){
var oc=document.getElementById('agrovoc').options;
//alert(oc.length);
firstBox = document.getElementById('agrovoc');
selectedOption = firstBox.options[firstBox.selectedIndex].value;
selected = firstBox.options[firstBox.selectedIndex].index;
//alert(selected);
for( var l=0;l<myArray.length;l++){
if( myArray[l]==selectedOption){myArray[l]="";}
firstBox.options[firstBox.selectedIndex] = null;
var oc=document.getElementById('agrovoc').options;
//alert(oc.length);
for(var x=selected;x<oc.length;x++,selected++)
document.getElementById('agrovoc').options[x] =new Option(firstBox.options[selected].value);
i=oc.length;
</script>
<html:select> code<div align="left" id="hopt">
<td valign="top">
<logic:present name="hcount">
<html:select property="agrovocbuffer" size="15" styleId="agrovoc" multiple="true" style="width:200px;" >
<html:option value="" ></html:option>
</html:select><html:button property="button" onclick="del()"> DEL</html:button>
</logic:present>
</td>
</div>
And all the above code is in <html:form> tag & i have written a custom pagination page
Now i want all terms which are in <html:option> remain in options when i goto 2 nd page..
how to do this? In the DOM inspector i'm getting the options, but when see the source HTML there are no <html:options>.. when click on the 2 page link the terms which are in <html:option> are not going to the "Action" class .. :(
how to do this .. any idea plz..? -
html:option tag in STRUTS
How can I put a "selected" attribute in the <html:option> tag in STRUTS? In regular HTML, I can say:
<select name="test">
<option name="opt1" selected>Option 1</option>
</selected>
But I can't use the "selected" key word in the STRUTS tag:
<html:select property="myList">
<logic:equal name="myListElement" value="Hello World">
<html:option value="opt1" selected>Option 1</html:option>
</logic:equal>
<logic:notEqual name="myListElement" value="Hello World">
<html:option value="other opts">Other opts</html:option>
</logic:notEqual>
</html:select>
How can I get the following to work?
Thanks,
DylanDavidHymes wrote:
He is trying to pre-select an option, not determine which option is selected. I have the same question, anyone know the answer?Ugh! Why're you replying to a thread from over 4 years ago?? Couldn't you start your own topic?
Take a look at this topic from yesterday: http://forum.java.sun.com/thread.jspa?threadID=5223675 -
Problem with html:select or html:options tags using struts,jsp and tomcat
Hi
I'm updating a Struts-Project to a new layout and therefore rework all jsp Sites.
I'm also using a new Folder-Structure and update therefore my struts-config file.
My Problem now is:
Till now, we had a select-field with a code like this:
< html:form action="/timetableAction" method="POST">
< table width="53%" border="0">
< tr>
< td>< html:radio property="dauer" value="semester"
/></ td>
< html:select property="semester" size="1">
< htmlptions name="semesterList" />
</ html:select>
</ html:form>
The problem now is, that whenever I use any <html:xy> tag, the tomcat server I use can not show the page, he shows just the headers of the template, but not the
content.-jsp-File where the form would be in. He stops right in the middle of the html page, when he notices the <html:xy> tags.
And the funny thing is, that he has no problem to show a page when there is a <html:errors> within it? Why could this be? the struts-html.tld File is well included and teh Tomcat Server shows no exceptions.
Waiting for you answers and thanksThank you, I already got the answer in another forum
-
Struts - HTML:link tag with dynamic page attribute?
I am trying to use the html:link but the page value is dynamic (resulting from the bean within the iterate tag). The code below doesn't work - error. Is there a way to use all Struts tags and make this happen. Any ideas?
<logic:iterate id="myMenuForm" property="menuItem" scope="session" name="menuForm" > <html:link page="<bean:write name="myMenuForm" property="menuDisplayName"/>"> <bean:write name="myMenuForm" property="menuDisplayName"/> </html:link> </logic:iterate> Thanks,
mlvThanks for all your help. Based on all you your comments, it is now working
and I thought I would provide some details about how I got it working.
There are not that many examples within the Struts documentation.
id = unique name for the object that can be referenced within the iterate
tag.
name = is the Bean, in this case it's the ActionForm, that contains the List
object that will be iterated. In my case, I have a ActionForm that contains
a List property that contains all the menu item rows from the databse.
property = is the property name within the ActionForm that is the List
object. Links to the getter method
Within the <bean:write> tag you use the id name to get a handle on the final
object from the iterate tag and the property is one of the property values
within the bean that is contained within the List.
So in this case I have a ActionForm bean that contains a List property that
contains a collection of beans.
FormAction - bean
property menuItems of type List contains:
- row 1 = bean (with a property of menuDisplayName)
- row 2 = bean (with a property of menuDisplayName)
- row 3 = bean (with a property of menuDisplayName)
Here's the JSP code for the tag.
<logic:iterate id="myMenuForm" name="menuForm" property="menuItem" >
<html:link page="www.yahoo.com"/>
<bean:write name="myMenuForm" property="menuDisplayName"/>
</html:link>
</logic:iterate>Now I would like to make the <html:link> page attribute value dynamic from
the iterate bean. Therefore, you can make the url for the link dynamic If
you know how to do that, please feel free to provide some help. -
On iOS7.0.3 html select tag with attribute 'multiple' crashes Safari
Try loading an HTML page on Safari that has:
<div>Multi-Select Picklist- tap on this to crash the iOS app
<select id="12121" title="Available" multiple="multiple" size="3" style="width: 120px;">
<optgroup label="Available">
<option value="1">AAAAAA</option>
<option value="2">BBBBBB</option>
<option value="3">CCCCCC</option>
<option value="4">DDDDDD</option>
</optgroup>
</select>
</div>
Safari will crash once you tap on the picklist. If I remove the attribute 'multiple' or if you have set it as multiple="multiple" it will work, but then it will offcourse not allow multiple selection. At least need to know a workaround.You might be better of asking this in the Developer forum. They might know more information about that, or at least in the Safari forum. I'll ask the moderators to move this for you.
-
HTML Embed tag with Autoplay not working with MP4 file
Hi,
I've added this embed tag for my MP4 movie:
<embed src="myMovie.mp4" width="502" height="309" autoplay="true" scale="tofit">
It's about 40 Mb big - so I obviously want to start playing as soon as possible so viewers will not wait for a long download. Problem is - it seems to ignore the Autoplay tag - resulting in waiting for a long time seeing the QT logo, and then starts when it's all downloaded.
Is that because it's an MP4 and not MOV?
Do I have the tag wrong?
Alternatively - is there any way to add a progress bar to show the download progress (aside from doing it through Flash)?
Thanks.Thanks,
While it might be outdated - the "embed" tag worked on both IE and Firefox. I've tried this new code and for some reason it only works in IE, but not in Firefox. I don't know whether I should revert back to the "embed" tag or figure out what would make the new code universal to both browsers.
Regarding the file itself - I've closed in in a container of MOV in QTPro - and will soon upload it and check it. However, I've tried to re-export that MOV again with the "fast start" check marked - and it bounced the size up from 40 Mb to 267 Mb! I'm still trying different methods of compression - but not seeing good size/quality results. The original came out of Prism Video.
Thanks. -
HTML Table TAG with ID problem when using AJAX
Hi, My application is running fine with firefox 3 and below version,
When i was using my application (with ajax technology) with firefox 4 and above version, then getting error(typeerror, element is null)
The problem is, <tr id="root">
When i use <div id="root"> instead of <tr id="root"> working fine with firefox all version.
If i use <tr id="root"> this is work with firefox 3 and below version..
Please why happens like this.. and please help me in this;
Thanks and REgards,
Sathiya.railsHi,
We have already fixed this problem.
It has done in sp46, sp10.
In any case best way is , "id" should be defined always.
Regards,
Vitaly -
Query on struts html:optionsCollection tag !
Hi,
I've a query on struts <html:optionsCollection tag. I'm trying to render the values of an arraylist using the optionsCollection . The arraylist is stored as a part of form object. But the issue is that each row of arraylist contains a string data. The arraylist is returned by a remote process.Now, when I use the following struts code,
<html:select property="userProxy" size="1" >
<html:optionsCollection property="userProxy" value="" label=""/>
</html:select>
what shud be the value for value and label , as the arraylist contains only one string per row . The userProxy is the arraylist field defined in the form object.
My question, will I be able to use the <html:optionsCollection tag in this scenerio ?
I'll really appreciate if someone can get back to me on this.
ThnxThe html:optionsCollection tag is designed to work with a collection of beans, each with a "label" and "value" attribute.
If you only have a list of strings, then you probably want to use the html:options tag.
Note that your ActionForm should have two attributes
// form bean"
String userProxy; //stores the currently selected userProxy
List userProxyList; //list of userProxies.
// assume appropriate get/set methods
// the jsp page:
<html:select property="userProxy" size="1" >
<html:options property="userProxyList"/>
</html:select>Cheers,
evnafets -
hi all,
i need to get the selected value from the option element.how can i get it?
what is the type expresiion in tha value field.....
this code is not working at all. i am getting the entire string inside the quotes...as selected value...what i want...is vale of that expression in quotes...
="<bean:write name="currency" property="key"/>"//// anyone knoe?
<html:select name="currency"
property="currencyCode">
<logic:iterate id="currency" name="currencyList">
<html:option value="<bean:write name="currency" property="key"/>"><bean:write name="currency" property="key"/> <SELECTED></html:option>
</logic:iterate> </html:select>You can never use tags as attributes for other tags. Only strings, and expressions.
What you seem to want is this:
<html:select property="currencyCode">
<html:options collection="currencyList" property="key"
</html:select>
I would recommend you check out the html:options tag
http://struts.apache.org/userGuide/struts-html.html#options
It takes a collection of items and generates multiple options for you.
It also deals with selecting the correct value for you.
Cheers,
evnafets -
Hello all,
Does anyone know if the struts html:iterate tag can be used to iterate through an ArrayList? Can you populate a html:radio tag with such an iterator?
If anyone has code examples of these, they would be MOST appreciated!
Thank you!I have an ArrayList object that contains a collection of Listing objects.
The Listing object has two methods getID, getName
In the ActionForm there is a variable listingData of List type. How can I use the logic:iterate tag to traverse the ArrayList object and display the id and name of the ListingObjects?
What has to be added in the logic:iterate tag below?
<table>
<logic:iterate id="listingForm" name="listingForm" property="listingData">
<tr>
<td>
// Here I want to output the value of ids
</td>
<td>
// Here I want to output the value of names
</tr>
</logic:iterate>
</table>Do I need a nested logic:iterate tag?
Should the ArrayList be populated with a J2SE class rather than a business object, i.e. the Listing class? -
Issues with UpdateAction and later using jbo:RowsetIterate
Hello -
I am putting together a BC4J/Struts web app and am having some issues
with using the oracle.jbo.html.struts11.actions.UpdateAction class.
I am trying to figure out the correct way to reset a row after validation exceptions
so that <jbo:RowsetIterate> doesn't blow up when it hits the row if the user doesn't fix the
data they entered in to pass validation.
Call the objects being update 'Accounts'.
Pass 1:
User changes account data in an edit page and submits.
Struts hands off control to an action that is a subclass of UpdateAction which invokes super.execute(...).
UpdateAction does its thing - catches the validation errors and sticks them in ActionErrors.
Control gets passed back to the edit page with the errors displayed.
This is expected. HOWEVER, if the user goes to a page that lists accounts (via <jbo:RowsetIterate>) it blows
up on the edited account because it tries to validate the row. So...
Pass 2:
After super.execute(...) check to see if any errors happened (by whether or not the forward returned indicated success).
If there were errors, refresh the row via:
BC4JContext context = BC4JContext.getContext(request);
Row row = context.getRow();
row.refresh(Row.REFRESH_WITH_DB_FORGET_CHANGES | Row.REFRESH_REMOVE_NEW_ROWS);
This works (not blowing up if user goes back to listing page) for emptying a mandatory field (JBO-27014)
but not for inserting too much data into a field (JBO-27010). I've tried this with REFRESH_UNDO_CHANGES as
well with the same results. So...
Pass 3:
Instead of refreshing the row in my update action, rollback the transaction via:
BC4JContext.getContext(request).getApplicationModule().getTransaction().rollback();
However this seems unnessary - I don't want to rollback the whole transaction just to undo changes to one row. Is there some better way to fix the issue?
Any suggestions?
Thanks,
-- ScottI don't know why either, but I'd love to fix it. Please install one of the debug packages (this looks like x86_64?):
http://dev.archlinux.org/~dreisner/kmod … pkg.tar.xz
http://dev.archlinux.org/~dreisner/kmod … pkg.tar.xz
Run 'gdb --args depmod 3.2.2-1-ARCH'. When it crashes, type 'bt full'. Post all that output here (either in code tags or on a paste service) -
Help Implementing HTML OPTION with HTML
Hi:
I have a HTML page with the folowing code:
</SELECT></TD>
</TR>
<TR>
<TD width="156">Mode</TD>
<TD width="86"></TD>
<TD width="206"><SELECT name="mode">
<OPTION value="regmode" selected>REG Mode</OPTION>
<OPTION value="testmode">TEST Mode</OPTION>
<OPTION value="devmode" selected>Dev Mode</OPTION>
</SELECT></TD>
I need help to implement the OPTION using JSP and JavaBean,
For a simple text entry I am using the following code:
<input size=20 type=text name=userID value=<jsp:getProperty name="_welcomeJSPBean" property="userID"/>>
I am looking for a similar way to get all the posibles values for the HTML OPTION,
Thank in Advance.
LeonardoThis is why many of the tag libraries and frameworks exist. I use Struts, and it has html taglib that includes tags for automating select/option to a very high degree.
If the list is dynamic, you can use:
<html:select property="commtypeno">
<html:options collection="commtypeList" property="commtypeno" labelProperty="commtype" />
</html:select>
Or, if the list is static, you can use:
<html:select property="commtypeno">
<html:option value="1">Type 1</html:option>
<html:option value="2">Type 2</html:option>
<html:option value="3">Type 3</html:option>
</html:select>
Anthony -
How to compare result from sql query with data writen in html input tag?
how to compare result
from sql query with data
writen in html input tag?
I need to compare
user and password in html form
with all user and password in database
how to do this?
or put the resulr from sql query
in array
please help me?Hi dejani
first get the user name and password enter by the user
using
String sUsername=request.getParameter("name of the textfield");
String sPassword=request.getParameter("name of the textfield");
after executeQuery() statement
int exist=0;
while(rs.next())
String sUserId= rs.getString("username");
String sPass_wd= rs.getString("password");
if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
exist=1;
if(exist==1)
out.println("user exist");
else
out.println("not exist"); -
How to set an attribute of a HTML tag with a value in the Servlet
I have a HTML page and a Servlet.
The HTML page sends a request to the Servlet.
The Servlet has to read the contents of the HTML page. When the Servlet encounters the body tag it should set the bgcolor attribute of the body tag with a string(For eg.a string called color with a value blue) in the servlet.
After doing this the Servlet has to update the original HTML page with the changes (in the body tag).
I need a help on this.Hi sangee,
you could get what you want to do by using a Java Server Page instead of both a HTML page and a Servlet.
I should code something like this:
<%Strung color="yourColor"%>
<html><head><title></title></head>
<body bgcolor="<%=color%>
</body>
</html>
Maybe you are looking for
-
How many Macs can i run CS4 On?
My buddy and i are web site designers and really want cs4 design premium its 600 in the educational store which isnt that bad but i dont have the money for it now but 300 bucks we can do is there any way we would be able to run it on more than one ma
-
Strange Print Sharing Issue from Leopard 10.5.1 to XP machine
Hi, I'm experiencing an issue with sending a print job from an XP-based PC to a Leopard-based PC which has a printer attached to it (Xerox Printer). The software that's used as a print server is efi Splash Server which routes a non-standard IP addres
-
Filter condition in query designer
Hi Friends, Can any one please tell me? Query is done on Multiprovider (made of Cube 1 to Cube 6 ) and in query designer under filter tab i have seen case 1: 1) Fiscal year variant F4 2) Cube 1 Questions: 1) what is the use of Fiscal year variant F4
-
How many objects are in my map?
hi all I nead help in a question about maps in java: In one map could be stored various references with diferent keys to just one real object. How can i count all objects referenced by my map? (not all references with map.size()) Is it wise to use a
-
Can I reinstall music and photos from my ipad