/    Sign up×
Community /Pin to ProfileBookmark

displaying SELECT

folks

i have a JSP application where at one place i will be displaying a SELECT list with the data from the backend i.e. populating list dynamically, I am getting some weired display, I appreciate if you could let me know where the problem is , Below is the code what i am doing :–

<form id=”form1″ action=”” onsubmit=”” style=”margin:auto;”>
<p style=”text-align:center”>
<%
String arg =”contact”;
ViewableCollection stuff = ResourceBroker.getObjects(arg);
DynamicObject dyno = (DynamicObject) stuff.get(0);
String html = stuff.toHtml();
System.out.println(“HTML OUTPUT:” + html);
Hashtable entity = Entity.getEntities();
Enumeration enum = entity.keys();
while (enum.hasMoreElements()) {
String key = (String) enum.nextElement();
Entity en = (Entity) entity.get(key);
String entityName = en.entityName;
System.out.println(“Entity Types:” + entityName);
String htmlStr = “<select name=”entityNames” onchange=”Process(this.options[this.selectedIndex].value);”>”;
htmlStr +=” <option value=”-1″ >Please Select One</option>”;
htmlStr +=” <option value=””+entityName +”” >”+entityName+”</option>”;
htmlStr+=”</select>”;
System.out.println(“HTML OUT : ” + htmlStr);
String arr = “hai”;
%>
<div align=”center”><%=htmlStr%></div>
<%
}
%>
</p>
</form>

Any code is appreciated

thanks
GG

[b]Moderators Note[/b]

Please do not cross post.Youar question has been answered in the JS forum.
Crossposting is considered rude.

to post a comment
HTML

0Be the first to comment 😎

×

Success!

Help @gnanesh spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.14,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...