Problem getting jsp component from jspdynpage
Hi,
I am making a call in my java class in method
doProcessBeforeOuput with the following call
table = (TableView) this.getComponentByName("tableview_AddMaterial");
Object[] objs = this.getComponents();
Both return nulls for the object, how does someone access the jsp tables or text fields defined by id in htmlb in your java code I did check and all these are defined
private IPageContext pageContext;
private IPortalComponentRequest request;
private IPortalComponentResponse response;
private IPortalComponentSession session;
private IPortalComponentContext userContext;
private IPortalComponentProfile userProfile;
Also here is my htmltable in the jsp
<hbj:tableView
id="tableview_AddMaterial"
model="DHB.queryResultsModel"
design="TRANSPARENT"
headerVisible="false"
footerVisible="true"
visibleRowCount="50"
visibleFirstRow="1"
selectionMode="MULTISELECT">
</hbj:tableView>
Any help would be greatly appreciated and I do reward points for helpful answers
Cheers,
Devlin
Hi Devlin
You can access the fields in jsp as follows.For example, consider tableview with id "myTableView".
<b>TableView table = (TableView) this.getComponentByName("myTableView");</b>
If you add this line, you can get all the values related to tableview.For example, to get the first visible row of the tableview, the code goes as follows.
<b>int firstVisibleRow = table.getVisibleFirstRow();</b>
Jsp for the same:
==================
<hbj:tableView
id="myTableView"
model="tablebean.model"
design="ALTERNATING"
headerVisible="true"
footerVisible="true"
selectionMode="MULTISELECT"
headerText="Office locations"
visibleFirstRow="1"
visibleRowCount="5"
rowCount="16"
width="500px">
</hbj:tableView>
Try and let me know the results.
Hope this helps.
Regards
Yoga
Similar Messages
-
Problem using jsp:include from inside a custom tag
Hi, All !
I have a problem using <jsp:include> from inside a custom tag. Exception is:
"java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
could not do this. Is it a bug, since in the 1.1 spec is said: "The
BodyContent is a subclass of JspWriter that can be used to process body
evaluations so they can retrieved later on."
My code is:
<wfmklist:items>
<jsp:include page="item.jsp" flush="true"/>
</wfmklist:items>
This is an area of contention with WL. It is not so tolerant with regards to
the spec. I spent several days recently trying to convince it to accept the
specification in regards to bodies and includes and it appears to have
successfully rebuffed my efforts.
Frankly, this is very disappointing. It appears that some shortcuts were
taken on the way to JSP 1.1 support, and the result is a very hard-coded,
inflexible implementation. As I have not seen the implementation myself, I
hate to assume this, however one could posit that the term "interface" was a
foreign concept during the implementation, other than as some annoying
intermediary reference requiring an immediate cast to a specific Weblogic
class, which in turn is apparently required to be final or have many final
methods, as if being optimized for a JDK 1.02 JIT.
I am sorry that I don't have any positive suggestions other than to use a
URL object to come back in an execute the necessary "include" directly. You
lose all context (other than session) and that can cause its own problems.
However, you can generally get the URL approach to work, and you will
hopefully avoid further frustration.
Peace,
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com
Tangosol: How Weblogic applications are customized
"Denis" <[email protected]> wrote in message
news:[email protected]...
> Hi, All !
> I have a problem using <jsp:include> from inside a custom tag. Exception
is:
> "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
>
> Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
> could not do this. Is it a bug, since in the 1.1 spec is said: "The
> BodyContent is a subclass of JspWriter that can be used to process body
> evaluations so they can retrieved later on."
>
> My code is:
> ...
> <wfmklist:items>
> <jsp:include page="item.jsp" flush="true"/>
> </wfmklist:items>
> ...
-
How can i get a component from frame?
how can i get a JTextField component from the frame?
in my program i use button and text fields, when button is pressed the action listener performs the needed actions: it must take the values in the text fields and do something with them,
for example i have a button - view:
look at the comments
public class _ActionListener_search implements ActionListener {
private JFrame frame;
private database dtbs;
public _ActionListener_search(JFrame frame, database dtbs) {
this.frame = frame;
this.dtbs = dtbs;
@Override
public void actionPerformed(ActionEvent arg0) {
if (arg0.getActionCommand().equals("view_person"))
//HERE i want to get values from text fields!
//i need to get JTextField component from frame and use it
view.addActionListener(new _ActionListener_search(frame, dtbs));how can i do it?
is this a correct way?Encephalopathic wrote:
If you know that you're going to need the data held in them why not give the class that holds them a public method that returns the Strings that they hold.
public String getTextFieldXyzText()
return textFieldXyz.getText();
}Then if your actionlistener has a reference to this class's object, it can simply call the above method.That's what I was thinking. The view has a method getXyzText() and the listener (or some larger, enclosing controller) knows the view.
What I would get away from is a single, switch-board listener hooked to a 100 unrelated buttons. -
Problems getting selected values from HtmlSelectManyCheckbox
Hello,
I am having problems getting values via getSelectedValues() from my HtmlSelectManyCheckbox component. The method returns an object array but the values are the same as the initial selectItems property.
JSP:
<h:selectManyCheckbox id="checkBox"
binding="#{userEditBean.manyCheckbox}"
value="#{userEditBean.groupIds}"
layout="pageDirection">
<f:selectItems value="#{userEditBean.allGroups}"/>
</h:selectManyCheckbox>
<h:commandButton action="#{userEditBean.ok}" value="OK"/>Bean:
public class UserEditBean extends BaseBean {
private HtmlSelectManyCheckbox manyCheckbox = new HtmlSelectManyCheckbox();
private String[] groupIds= {};
private List allGroups = new ArrayList();
public String[] getGroupIds() {
groupIds= backing.getSomeIds();
return groupIds;
public void setGroupIds(String[] ids) {
this.groupIds= ids;
public HtmlSelectManyCheckbox getManyCheckbox() {
return manyCheckbox;
public void setManyCheckbox(HtmlSelectManyCheckbox newC) {
this.manyCheckbox = newC;
public List getAllGroups() {
allGroups = backing.getAllGroups();
return allGroups;
public void setAllGroups(List newList) {
this.allGroups = newList;
public String ok() {
Object o = manyCheckbox.getSelectedValues();
}The problem is, the getSelectedValues() returns the values from the initial state of the page. The is no mark of the changes made by the user. Any help will be appreciated
Thanks,
MatekYour approach is somewhat odd. The selected values are just reflected in the groupIds, but you're overridding it with backing.getSomeIds() each time when the getter is called.
Here is a basic working example:<h:selectManyCheckbox value="#{myBean.selectedItems}">
<f:selectItems value="#{myBean.selectItems}"/>
</h:selectManyCheckbox>
<h:commandButton value="submit" action="#{myBean.action}" />MyBeanprivate List<String> selectedItems;
private List<SelectItem> selectItems;
// + getters + setters
// You can use initialization block or constructor to prepopulate the selectItems.
selectItems = new ArrayList<SelectItem>();
//or
public MyBean() {
selectItems = new ArrayList<SelectItem>();
public void action() {
// The selected items are reflected in selectedItems.
for (String selectedItem : selectedItems) {
System.out.println(selectedItem);
} -
Problem getting correct data from MS Access after doing an Update
Hi all,
I have a problem getting correct data after doing an update. This is the scenario
I am selecting some(Eg: All records where Column X = �7� ) records and update a column with a particular value (SET Column X = �c� ) in all these records by going through a while loop. In the while loop I add these records to a vector too, and pass it as the return value.
After getting this return value I go through a for loop and get each record one by one from the DB and check if my previous update has actually happened. Since No errors were caught while updating DB, I assume all records are updated properly but my record set shows one after another as if it has not been updated. But if I open the DB it is actually updated.
This does not happen to all records, always it shows like this
1st record Mode = �c�
2nd record Mode = �7�
3st record Mode = �c�
4nd record Mode = �7�
9th record Mode = �c�
10th record Mode = �7�
I am relatively new to java and this is someone elses code that I have to modify,So I am not sure if there some thing wrong in the code too
//Here is the method that gets records and call to update and add to vector
public static Vector getCanceledWorkOrders() throws CSDDBException{
//Variable declaration
try {
objDBConn = DBHandler.getCSDBCon();
strSQL = "SELECT bal bla WHERE [Detailed Mode])=?)";
objStmt = objDBConn.prepareStatement(strSQL);
objStmt.setString(1, '7');
objWOPRs = objStmt.executeQuery();
while (objWOPRs.next()) {
//Add elements to a vector by getting from result set
//updating each record as PROCESSING_CANCELLED_WO(c)
iRetVal = WorkOrderDetailingPolicy.updateRecordStatus(objPWODP.iWorkOrderNumber, objPWODP.strPersonInformed, EMSConstants.PROCESSING_CANCELLED_WO);
if (iRetVal == -1) {
throw new NewException("Updating failed");
catch (Exception e) {
vecWONumbers = null;
throw new CSDDBException(e.getMessage());
}finally{
try {
objWOPRs.close();
objStmt.close();
DBHandler.releaseCSDBCon(objDBConn);
catch (Exception ex) {}
//return vector
//here is the code that actually updates the records
public static int updateRecordStatus(int iWONumber, String strPerInformed , String strStatus) throws CSDDBException{
PreparedStatement objStmt = null;
Connection objDBConn = null;
String strSQL = null;
int iRetVal = -1;
try{
objDBConn = DBHandler.getCSDBCon();
objDBConn.setAutoCommit(false);
strSQL = "UPDATE Table SET [Detailed Mode] = ? WHERE bla bla";
objStmt = objDBConn.prepareStatement(strSQL);
objStmt.setString(1, strStatus);
objStmt.execute();
objDBConn.commit();
iRetVal = 1;
}catch(Exception e){
iRetVal = -1;
}finally{
try{
objStmt.close();
DBHandler.releaseCSDBCon(objDBConn);
}catch(Exception ex){}
return iRetVal;
//Here is the code that call the records again
public static WorkOrderDetailingPolicy getWorkOrders(int iWorkOrderNo) throws CSDDBException{
Connection objDBConn = null;
PreparedStatement objStmt = null;
ResultSet objWOPRs = null;
WorkOrderDetailingPolicy objPWODP = null;
String strSQL = null;
try {
objDBConn = DBHandler.getCSDBCon();
strSQL = "SELECT * FROM [Work Order Detailing] WHERE [Work Order No] = ?";
objStmt = objDBConn.prepareStatement(strSQL);
objStmt.setInt(1, iWorkOrderNo);
objWOPRs = objStmt.executeQuery();
if (objWOPRs.next()) {
objPWODP = new WorkOrderDetailingPolicy();
objPWODP.iWorkOrderNumber = objWOPRs.getInt("Work Order No");
//......Get Record values
catch (Exception e) {
objPWODP = null;
throw new CSDDBException(e.getMessage());
}finally{
try {
objWOPRs.close();
objStmt.close();
DBHandler.releaseCSDBCon(objDBConn);
catch (Exception ex) {}
return objPWODP;
}Hello,
Can you put an example of your problem online?
Are you sure you're not having problems with case sensitive data?
Thanks,
Dimitri -
Get back component from JPanel
by java
I know JPanel can get back components by JPanel.getComponents() like
private JPanel panelCenter = new JPanel ();
panelCenter.getComponents();
I want to know is JPanel able to get component just by the specified component's name?
e.g. panelCenter.getComponent("buttom");
or like vb.net Me.Controls("buttom").Visible = True
Thanks
Francis SZENone of JPanel, JComponent, Container or Component have a method to get a component by name.
You can either:
1. Keep references to the objects you place in your JPanel (highly recommended :)
or
2. Iterate over the result of getComponents() and test for getName().equals(requestedName) -
I'm having problems getting my updates from the App Store. Nothing is showing up.
I can't get my updates from the App Store . The screen is completely blank . Anyone have a solution ?
The update server is down; try this temporary workaround
App Store>Purchased>Select "All"
Note: Look out for apps that have the word "Update"
http://i1224.photobucket.com/albums/ee374/Diavonex/9c256282736869f322d4b3071bbb2 a82_zps51a6f546.jpg -
Problem getting arraylist values from request
Hi All,
I am trying to display the results of a search request.
In the jsp page when I add a scriplet and display the code I get the values else it returns empty as true.Any help is appreciated.
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<%@ include file="/includes/header.jsp"%>
<title>Research Results</title>
</head>
<body>
<div class="ui-widget ui-widget-content">
<%
ArrayList<Research> research = (ArrayList<Research>) request.getAttribute("ResearchResults");
Iterator iterator = research.iterator();
while(iterator.hasNext()){
Research r = (Research) iterator.next();
out.println("Result Here"+r.getRequesterID());
out.println("Result Here"+r.getStatus());
%>
<form>
<c:choose>
<c:when test='${not empty param.ResearchResults}'>
<table cellspacing="0" cellpadding="0" id="research" class="sortable">
<h2>RESEARCH REQUESTS</h2>
<tr>
<th><a href="#">RESEARCH ID</a></th>
<th><a href="#">REQUESTOR NAME</a></th>
<th><a href="#">DUE DATE</a></th>
<th><a href="#">REQUEST DATE</a></th>
<th><a href="#">CLIENT</a></th>
<th><a href="#">STATUS</a></th>
<th><a href="#">PRIORITY</a></th>
</tr>
<c:forEach var="row" items="${param.ResearchResults}">
<tr title="">
<td id="researchID">${row.RESEARCH_ID}</td>
<td>${row.REQUESTER_FNAME} ${row.REQUESTER_LNAME}</td>
<td><fmt:formatDate pattern="MM/dd/yyyy" value="${row.DUE_DATE}"/></td>
<td><fmt:formatDate pattern="MM/dd/yyyy" value="${row.CREATED_DATE}"/></td>
<td>${row.CLIENT}</td>
<td>
<c:choose>
<c:when test="${row.STATUS=='10'}">New Request</c:when>
<c:when test="${row.STATUS=='20'}">In Progress</c:when>
<c:when test="${row.STATUS=='30'}">Completed</c:when>
</c:choose>
</td>
<td>
<c:choose>
<c:when test="${row.PRIORITY=='3'}">Medium</c:when>
<c:when test="${row.PRIORITY=='2'}">High</c:when>
<c:when test="${row.PRIORITY=='1'}">Urgent</c:when>
</c:choose>
</td>
</tr>
</c:forEach>
</table>
</c:when>
<c:otherwise>
<div class="ui-state-highlight ui-corner-all">
<p><b>No results Found. Please try again with a different search criteria!</b> </p>
</div>
</c:otherwise>
</c:choose>
</form>
<%@ include file="/includes/footer.jsp"%>
</div>
</body>
</html>What is ResearchResults?
Is it a request parameter or is it a request attribute?
Parameters and attributes are two different things.
Request parameters: the values submitted from the form. Always String.
Request attributes: objects stored into scope by your code.
They are also accessed slightly differently in EL
java syntax == EL syntax
request.getParameter("myparameter") == ${param.myparameter}
request.getAttribute("myAttribute") == ${requestScope.myAttribute}
You are referencing the attribute in your scriptlet code, but the parameter in your JSTL/EL code.
Which should it be?
cheers,
evnafets -
Problem getting krUFS values from SunMC 4.0 on Sunfire X2100
If I use the snmpget command to ask the SunMC agent for the krUFS oids I'm interested in (Mount point, SystemSize, PctUsedSpace), I get no error, but I get no data either (i.e. returned value is "" for all).
I'm able to get this data for T1000 and Sun Blade 2500's w/ no problem.Hi Arutherford,
Arutherford wrote:
If I use the snmpget command to ask the SunMC agent for the krUFS oids I'm interested in (Mount point, SystemSize, PctUsedSpace), I get no error, but I get no data either (i.e. returned value is "" for all).
I'm able to get this data for T1000 and Sun Blade 2500's w/ no problem.So, you're getting numbers from SPARC systems, but not x86? Is it possible some of your systems have the "Kernel Reader" module and other have "Kernel Reader Simple" loaded? Or is the X2100 maybe using ZFS (which SunMC doesn't track, you'd need SystemMonitor)
Regards,
[email protected]
http://www.HalcyonInc.com -
Problem getting updated values from DCIteratorBinding
Hello,
I have one af:table which is binded using DataControl based on ViewObject.
I typed some values in each column and now I want to access those values from the iterator but its giving me initial value at the time page loaded.
//getting the iterator
DCIteratorBinding itr = ADFUtils.findIterator("ViewObject1Iterator");
Row row[] = itr.getAllRowsInRange();
String deptName = (String) row[1].getAttribute("deptName");
The strange thing is, I have another ViewObject binded to af:table and it works fine I do not know whats wrong here
any ideas?
many thanksHi,
the code seems okay and if it works with another VO but not this particular, then the issue obviously is not in teh Java code but the page code. Since you have a working and a not working solution, i don't think its an issue with the product.
Frank -
Problem getting JSP examples to work
Hi,
I just installed weblogic few days back. I'm trying to run the jsp examples.
I cannot get them work. I keep getting 404 object not found error when I try
an url like
http://localhost:7004/examplesWebApp/HellowWorld.jsp
. I followed the docs and run the scripts.
There is a HellowWorld.jsp file under
.\bea\wlserver\config\examples\applications\defaultWebApp.
Also I can run petstore fine or hellowworld works with default server.
But when I cannot get it tow work with exampleserver
Any pointer to debug is greatly appreciated.
There was a 'servlet mapping' error in hte xml parsing in the weblogic.xml file
which come with istallaiton for the example.
Anyone experienced that.
thanksif you put the HellowWorld.jsp under
\bea\wlserver\config\examples\applications\defaultWebApp. that means you
have it under default webapp, then your url should be:
http://localhost:7004/HellowWorld.jsp
The url pattern should be http://server:port/webappName/filename.jsp
thanks
"b gosh" <[email protected]> wrote in message
news:[email protected]..
>
Hi,
I just installed weblogic few days back. I'm trying to run the jspexamples.
I cannot get them work. I keep getting 404 object not found error when Itry
an url like
http://localhost:7004/examplesWebApp/HellowWorld.jsp
I followed the docs and run the scripts.
There is a HellowWorld.jsp file under
\bea\wlserver\config\examples\applications\defaultWebApp.
Also I can run petstore fine or hellowworld works with default server.
But when I cannot get it tow work with exampleserver
Any pointer to debug is greatly appreciated.
There was a 'servlet mapping' error in hte xml parsing in the weblogic.xmlfile
which come with istallaiton for the example.
Anyone experienced that.
thanks -
Problem getting "Current Step" from task WLI upgraded from 8.1.5 to 10.3
Upgraded an EAR file from 8.1.5 to 10.3.
This included a process that creates a worklist task that shows up in the WLI 10.3 Worklist Console and has a Task Plan ID of /Worklist/Compatibility 8.1.x:9.0.
Had an interface that extended TaskWorkerControl and am able to get TaskInfo that gives the StateType. In WLI 10.3 this provides the value for Working State.
Need the value of the Current Step.
Created a TaskBatchControl but am not able to get any TaskData and so can not get value of the Current Step.
Is it possible to get TaskData from a worklist task that has a Task Plan ID of /Worklist/Compatibility 8.1.x:9.0?This was due to the permissions on the EJB.
-
Problem getting all parameters from multiple select
I have a multiple select option box that's properly displaying all the values. I'm using getParameterValues() to retrieve all of the selections but it returns the string[] with only the first selection made.
JSP:
<select name="selectList" multiple="true" size="2">
<option value="value1"> Select 1
</option>
<option value="value2"> Select 2
</option>
</select>Servlet:
String[] subset = request.getParameterValues("selectList");I think all my code above is fine. Anything else that would cause getParameterValues() to only return the top selected item?
Thanks!The HTML cod is written in incorrect syntax, the browser nor the Server will understand.
If you write it in XHTML then the proper syntax is:
<select name="selectList" multiple="multiple" >
If you write it in plain old HTML then the proper syntax is:
<select name="selectList" MULTIPLE >
(I'm not sure about this HTML syntax, but definitely the XHTML syntax shown above is correct) -
Problem getting Multiple Values From BPEL.
I have created the BPEL process (jdeveloper 11g) R1 which reads the data from database adapter and I have to iterate the values one by one from while loop.
I have created while activity and I want to assign my column value to one variable , I am following the concat option for assigning value.but I a was not able to concat my generated string please help me out.
Below are the Expression that should be concated.
bpws:getVariableData('Variable_ForCount','/client:WfApproval/client:WFApproval/client:approverName')
I want to make the Expression as per following:
bpws:getVariableData('Variable_ForCount','/client:WfApproval/client:WFApproval[bpws:getVariableData(My Count)]/client:approverName')
can we use Escape for ' .
Thank you,
Sandeep.Hi,
Here is an example from one of my flows - may be that will help you form your query:
<copy>
<from expression="bpws:getVariableData('receivePedidoFromSelector_InputVariable','payload')/ns2:ServicioMovil/ns2:Componentes/ns2:BONO[bpws:getVariableData('CuentaBONO')]/ns2:InstanciaComponente"/>
<to variable="AuxiliarAddons"
part="payload"
query="/ns133:AddonsRequest/ns133:Addons/ns133:Addon/ns133:AddonIdCRM"/>
</copy>
CuentaBONO -- this is the array index -
Problem getting songs back from lost Ipod Touch onto computer?
I lost my Ipod Touch a month ago and I download my songs of the Touch's Itune store, not on my computer. Now I lost quite a few songs and since I did not sync the new songs onto my computer, its not on my computer. Is there anyway I can get back the songs I bought through the Itunes of Ipod Touch back onto my computer's Itunes? I hope you can understand what I'm saying, its a bit confusing.
ThanksSorry, but officially Apple does not allow redownloads of purchased items other than iPhone/iPod touch applications. It's your responsibility to make backup copies in case something goes wrong with your system or your iPod is lost, as unfortunately it apparently did in your case, and you lose all your purchases. The official statement of their policy can be found here, among other places. If your hard drive was erased and you don't have a backup of your purchased items, you're probably out of luck and will need to repurchase your tracks.
You can try contacting iTunes Store Customer Service and explaining what happened. Reportedly in some cases Apple has allowed redownloading on a one-time basis. But don't count on it.
Message was edited by: Dave Sawyer
Maybe you are looking for
-
Missing Codec in iTunes 10.4?
Greetings, I have several movies that I copied from VHS and converted to Quicktime last winter that played in an older version of iTunes within Snow Leopard. Now that I have upgraded to Lion, they will no longer play in iTunes. I could convert them o
-
How can I download CS3 from my old laptop to a new one?
-
Hi, Can we triger XI interface using Database trigger? I mean some database trigger sends (triger not on receive side) message to XI and integration starts. thanks in advance. KP
-
User-Exit for KO04(order manager)
Hi Gurus! I have created a user-exit to check validation for internal orders that checks to see that the material number and serial number exist for a particular internal order type and it works fine . I had to include another order type for the sam
-
I pod will not charge. Battery Failure??
Ok, I have seen this posted before and I have read through all of the suggestions, but none of them have worked so far. Any help would be great. The computer recognizes the Ipod, when plugged into the usb its glows solid yellow like it is charging. A