Dynamic populate Jtextfield
I have the following problem .
I have an applet maden by two Jpanel , the first one contains a Jtable I would like to populate the Jtextfield on the second panel as a consequence of the row selected in the Jtable.
Waht type of listener I need to use on Jtextfiled to accomplish the task ? Any example ?
Waht type of listener I need to use on Jtextfiled to accomplish the task ? You don't add a listener to the text field. You add a ListSelectionListener to the ListSelectionModel of the table. When the table selections changes you update the text field.
Similar Messages
-
Dynamically populate a record group on the fly uisng LOV
Hi,
I want to create dynamically populate a record group on the fly uisng LOV.
1. This is how the RG_BANKNAME Record Group object look like
Object : Record Group
Name : RG_BANKNAME
Record Group Query : SELECT NAME, SHORT_NAME FROM C_BANKS
2. I create the Push Button and when user click it will popup the LOV.
DECLARE
rg_id RecordGroup;
errcode NUMBER;
status BOOLEAN;
BEGIN
rg_id := Find_Group('RG_BANKNAME');
IF Id_Null(rg_id) THEN
Message('No such group: ',ACKNOWLEDGE);
RAISE Form_Trigger_Failure;
ELSE
errcode :=POPULATE_GROUP(rg_id);
SET_LOV_PROPERTY('LV_NAME', TITLE, 'My Own LOV');
SET_LOV_PROPERTY('LV_NAME', GROUP_NAME, rg_id);
SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Title, 'NAME');
SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Width, 150);
SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Title, 'SHORT NAME');
SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Width, 100);
status := Show_LOV('LV_NAME',10,20);
IF NOT status THEN
Message('You have not selected a value.');
Bell;
END IF;
END IF;
END;
My question is do I need to create the LOV Object name call 'LV_NAME'? since I don't have this
create on my design times, because I thought it can be done dynamically on the fly.
The problem is compliant that the Lov Id is not valid.
Thanks
David
Edited by: user445990 on May 24, 2011 9:19 PMHello,
You request is not clear. Do you need to display the LOV or not ? In other words, what is the goal of your record group ?
Francois -
How to dynamically populate a listbox with the values in the database
Hi,
How do dynamically populate the list box with the values in the oracle database. I want to load the list box at run time.Plz anybody help me out to find a solution for this problem.
Thanks in advance...
Regards,
Shiva.u can wite code like this..on jsp page
<%
ResultSet rs = stmt.executeQuery("select vender_name from vendors");
%>
<select name = "vendorlist">
<%
while(rs.next()){
String vname = rs.getString(1);
%>
<option value="<%=vname%>"><%=vname%></option%>
<%
rs.close();
%> -
Dynamically Populate a Panel Dashboard in a Fragment
I am working with a customized Panel Dashboard in a fragment (jsff). The user can customize the dashboard (re-order panel boxes, define number of columns, add/remove panel boxes, etc.) and our goal is to persist these customizations so they are available across different sessions. To achieve this, I created several database tables for these customizations and tied them to the user table. When the user opens the application, the dashboard fragment is the first fragment to display. I am loading the information from the database then constructing the Panel Dashboard. The dashboard starts out with a static set of Panel Boxes (as seen in main_dashboard.jsff below), then based on the data, I re-order them and set rendered equal to false for panel boxes which the user removed.
My problem is I need to do this before the page is rendered. To do this, I am calling the customization method from the constructor of my backing bean. The RichPanelDashboard which I bind the UI Component to is not yet available. I have tried several things which did not work, including:
- Adding the @PostConstruct annotation to my customization method.
- Pulling the component from the View Root: RichPanelDashboard mainDashboard = ( RichPanelDashboard )FacesContext.getCurrentInstance().getViewRoot().findComponent( "mainDash" );
- Added a "preRenderComponent" event to the page: <f:event type="preRenderComponent" listener="#{main_dashboard.setupCustomDashboard}"/> (after a web search, it appears the f:event tag is not supported in ADF Fragments).
I've encountered this problem in the past with different UI Components. Most notably, I needed to populate a SelectOneListBox before the page is rendered. I solved the problem by adding a <f:selectItems> child to the <af:selectOneListBox> and setting the value of that tag to a List of SelectItems in my backing bean and populating that list on bean instantiation. Is there a similar option for a Panel Dashboard and a List of Panel Boxes? The thought of using an <af:forEach> tag had crossed my mind to populate the panel dashboard with panel boxes, but as you can see in my code below, I am already using <af:forEach> to dynamically populate the first panel box with command links. Unless there is a way to dynamically populate a panel dashboard with dynamically populated panel boxes in the fragment, I don't think the for each approach will work (there doesn't appear to be a way to dynamically populate the panel boxes with UI components in the backing bean either).
Sample code is below. Any suggestions are greatly appreciated.
main_dashboard.jsff
{code}
<af:panelDashboard id="mainDash" columns="2" rowHeight="250px" styleClass="AFStretchWidth" inlineStyle="height:1000px;"
dropListener="#{main_dashboard.handleReorder}" binding="#{main_dashboard.panelDashboard}">
<!--f:event listener="#{main_dashboard.setupCustomDashboard}" type="preRenderComponent"/-->
<af:panelBox id="openedBox" text="Recently Opened">
<af:componentDragSource/>
<af:forEach var="item" items="#{main_dashboard.openedCommandLinks}">
<af:commandLink text="#{item.text}" partialSubmit="true"
actionListener="#{main_dashboard.editorFiredFromDashboard}"/>
</af:forEach>
</af:panelBox>
<af:panelBox id="editedBox" text="Recently Edited">
<af:componentDragSource/>
<af:outputText value="Recently Edited" id="ot2"/>
</af:panelBox>
<af:panelBox id="openCPsBox" text="My Open Config Packages">
<af:componentDragSource/>
<af:outputText value="My Open Config Packages" id="ot3"/>
</af:panelBox>
<af:panelBox id="testBox" text="Test Panel Box">
<af:componentDragSource/>
<af:outputText value="For Testing Purposes Only" id="ot4"/>
</af:panelBox>
</af:panelDashboard>
{code}
MainDashboardBackingBean (main_dashboard)
{code}
private RichPanelDashboard panelDashboard;
public MainDashboardBackingBean() {
setupCustomDashboard();
// Using @PostConstruct annotation did not work
// @PostConstruct
public void setupCustomDashboard() {
// Set custom column count
Integer selectedColumnCount = customDashboardDcl.getColumnCount();
// Pulling from FacesContext did not work
// RichPanelDashboard mainDashboard = ( RichPanelDashboard )FacesContext.getCurrentInstance().getViewRoot().findComponent( "mainDash" );
// mainDashboard.setColumns( selectedColumnCount );
// Null Pointer happens here
panelDashboard.setColumns( selectedColumnCount );
// Create the new ordered list
if( customDashboardMap != null ) {
List<String> reorderedIdList = new ArrayList<String>( customDashboards.size() );
for( Integer key : customDashboardMap.keySet() ) {
String customId = customDashboardMap.get( key );
for( UIComponent currChild : panelDashboard.getChildren() ) {
String currId = currChild.getId();
if( customId == currId ) {
reorderedIdList.add( currId );
break;
// Unused Panel Boxes must still be added, but not rendered
for( UIComponent currChild : panelDashboard.getChildren() ) {
String currId = currChild.getId();
if( !reorderedIdList.contains( currId ) ) {
currChild.setRendered( false );
reorderedIdList.add( currId );
// Apply the changes
ComponentChange change = new ReorderChildrenComponentChange( reorderedIdList );
change.changeComponent( panelDashboard );
AdfFacesContext.getCurrentInstance().addPartialTarget( panelDashboard );
public RichPanelDashboard getPanelDashboard() {
return panelDashboard;
public void setPanelDashboard(RichPanelDashboard panelDashboard) {
this.panelDashboard = panelDashboard;
{code}Hi,
I did actually populate my panelDashboard with a forEach over a list of dashboard items.
<af:panelDashboard id="pd1" columns="2" rowHeight="#{pageFlowScope.myDashboard.rowHeight}"
binding="#{pageFlowScope.myDashboard.dashboard}"
dropListener="#{pageFlowScope.myDashboard.move}">
<af:forEach items="#{pageFlowScope.myDashboard.dashboardItems}"
var="panels">
<af:panelBox text="#{panels.localizedTitel}"
id="${panels.id}" background="medium" showDisclosure="false">
<af:region value="#{panels.regionTaskflow}"
id="r2"/>
<af:componentDragSource/>
</af:panelBox>
</af:forEach>
</af:panelDashboard>
All my panels are rendered as regions that are dynamically filled with single page task flows which are bound to the page containing the dashboard.
My DashboardItem class creates the RegionModel from the task flow binding
public RegionModel getRegionTaskflow() {
String regionBinding = "#{bindings." + taskflow + ".regionModel}";
RegionModel model = (RegionModel)JSFUtils.resolveExpression(regionBinding);
return model;
I don't know if that's a good practice but it works.
Hope that helps,
Achim -
How to dynamically populate IDropDownListController
Hi!
My question is how can I dynamically populate the IDropDownListController widget? In the sample project WriteFishPrice the entries are all static, but I need to add or remove entries in the list. Thanks for any pointers!Assuming you want to add inside a controller or an observer to you panel
Here's a function I use.
void MyDialogController::InitialiseDropdown(K2Vector<PMString> &stringArray, const WidgetID &widgetId)
InterfacePtr<IPanelControlData> panelControlData(this, UseDefaultIID()); // i can get a Panelcontoldata because my controller is in the kDialogBoss
if (panelControlData == nil)
ASSERT_FAIL("panelControlData invalid");
do
IControlView* view = panelControlData->FindWidget(widgetId);
if (view == nil)
ASSERT_FAIL("control view invalid");
InterfacePtr<IStringListControlData> stringListControlData(view, UseDefaultIID());
if (stringListControlData == nil)
ASSERT_FAIL("invalid stringListControlData");
break;
// Clear the drop down list.
stringListControlData->Clear(
kFalse, // don't invalidate.
kFalse // don't notify
// Add their names to the drop down.
K2Vector <PMString>::iterator iter;
for (iter = stringArray.begin(); iter < stringArray.end(); iter++)
PMString server = *iter;
server.SetTranslatable(kFalse);
stringListControlData->AddString
server,
IStringListControlData::kEnd,
kFalse, // don't invalidate.
kFalse //don't notify.
view->Invalidate();
while(false); -
How to dynamically populate data from a data source
What I am trying to do:
I am building a simple blog reader application with two screens, 'Home' and 'FeedR'.
The data needed for this to work is an excel table 'Blogs'; which has the following columns:
BlogName, image, Source
I have created about 6 REST data sources from the RSS feeds of these blogs and added their names into the excel table.
The home has an "Image Gallery with Text", which has the blog image and BlogName on it. On the select event, I want to navigate to the second screen and populate the text gallery with the feed details.
The Problem:
So, when I have only feed, I can do something like:
'Navigate(FeedR, ScreenTransition!UnCover);Collect([@blogposts], rss_aspx!channel!item)'.
When I have more than one feed; I would like to be able to do something like:
'Navigate(FeedR, ScreenTransition!UnCover);Collect([@blogposts],
(Blogs!Source)!channel!item)'.
The Question:
Is dynamically populating the name of the data source work? If yes, how do I do it? If no, is there a way around it?
I was looking at UpdateContext(), but does not seem like a feasible option.
Thanking you...
Hemanthyou wanted a onchange for a htmlb:inputfield which would also trigger server event. try the following code.
<htmlb:inputField id = "test"
alignment = "LEFT"
size = "6"
required = "TRUE"
doValidate = "TRUE"
type = "INTEGER"
/>
<bsp:htmlbEvent id="myid" onClick="myonclick" name="ValueChanged" />
<script for="test" event=onchange type="text/javascript">
alert(this.value);
ValueChanged();
</SCRIPT>
if the value in the inputfield is changed it would trigger a alert at the client side and also trigger a server event. now you can caputre the value in oninputprocessing.
Hope this helps.
do let us know if you need help in how to capture this value in oninputprocessing.
Regards
Raja -
Dynamically populate pdf File name in 'Save As' dialogue box
We have rendered a pdf using adobe webservice.
Once the pdf is generated , and we click on saveAs menu dialogue box opens and default name is populated in fileName field.
Can it be possible to populate that name dynamically ? We tried using response.addheader() but it didnt work.
Note : We are using java to create xml which we are passing to adobe webservice.Hi Jaynet,
In order to re-produce this, you need to answer "yes" to the rename file prompt and then continue with step 5 (above).
The reason for this is not an exercise in futility - I assure you. At my work and elsewhere, when web developers have created features to permit the end user to save web data in Excel format, often times the Excel files are saved locally in Excel's
html format (but with the .xls
extension).
(I actually prefer the .xls
extension, because it is easier to just double-click the file to open in Excel, rather than to select the open-with and then select Excel. a file with the .html extension will default open in your default browser. Now, I could change my default program
for the .html extension, but that would only solve a part of the problem and would not really address the bigger issue and that being that Microsoft changed a behavior in Excel and may not even be aware that it was a much used feature. )
To continue, when I go to open the resulting Excel file, I am prompted with the message that the file type does not match the extension (which is fine and not bothersome to me). It's at this point when I go to save the file that I get really annoyed.
In previous versions of Excel, the default file name would be pre-filled with the current name of the file and the default file type would state that it is a Web html file. I would just change the file type to Excel Workbook and hit enter to save.
I would be prompted with "Are you sure you want to overwrite your existing file?" message and I would click "yes" and that would be that.
However, in Excel 2010, because the default file name is blank, I then need to re-type the name into the field to save the file.
Any help is greatly appreciated.
Thanks -
Dynamic populate works in livecycle, but not in reader
When I'm in Livecycle, my dropdown list is dynamically populated from my XML file when i preview it, but when I open the PDF in Reader 8.0, it does not auto-populate. I've specified where my XML file is, so it should be able to find it.
The free version of Adobe Reader (i.e. the one that's freely available for download from Adobe) doesn't allow 'data import' - which is what I think you're doing with your XML file - unless the PDF has been magically 'unlocked' via LiveCycle Forms ES or Reader Extensions ES.
But, if the version of Reader you're using is the one that comes with Acrobat Professional (which also includes LiveCycle Designer), then the above doesn't apply, and as far as I know 'data import' should work.
I should point out that I'm not an Adobe expert, I'm just sharing knowledge I've struggled to obtain via the same route as you - i.e. having to rely on message boards and blogs.
If only there was an equivalent of MSDN for Adobe.... -
Scrollbar doesn't show up on the panel while dynamically adding JTextFields
I have a dynamic user iterface, where the JTextFields are added dynamically to a JPanel within the JFrame upon the click of a JButton. How do I use the JScrollPane so that the Vertical Scroll bar shows up for the JPanel as soon added TextFields go out of range? The Panel has a null layout coz I want the textfields at specific positions on the panel. The problem lies in showing the Vertical scroll bar once the text fields in the JPanel exceeds the Panel's size. The scrolls don't seem to show up. Please help!
public Scenario() // Constructor
textPanel = new JPanel();
textPanel.setLayout(null);
textPanel.setSize(508, 520);
textPanel.setLocation(10,10);
//..........lines of code
public void addComponent(String text)
j = j + 30;
i = i+1;
String lineno = Integer.toString(i) + ".";
field = new JLabel(lineno);
field.setBounds(90,j,20,24);
textPanel.add(field);
if (addline){
content = new JTextField(text);
content.setBounds(108,j,400,24);
content.setBackground(new Color(255,255,255));
textPanel.add(content);
addline = false;
invscenario = false;
else if(invscenario) {
content = new JTextField(text);
content.setBounds(108,j,50,24);
content.setEditable(false);
textPanel.add(content);
try{
if (content.getText().length()!= 0)
Statement statement1 = conn.createStatement();
String query1 = "SELECT * FROM scenario " + "WHERE scenario_num LIKE '" + text + "'";
rs = statement1.executeQuery(query1);
rs.next();
int recordNumber = rs.getInt(1);
if(recordNumber != 0)
labelcontent = new JLabel(rs.getString(3));
labelcontent.setBounds(165,j,100,24);
textPanel.add(labelcontent);
}// end try
catch(SQLException e)
System.out.println(e);
invscenario = false;
addline = false;
scrollPane = new JScrollPane(textPanel);
scrollPane.add(textPanel);
contentPane.add(scrollPane);
contentPane.repaint();
show();I guess since you don't have a layoutmanager you have to set the viewport dimensions of your JScrollPane manually.
Try something like
scrollPane.getViewport().reshape(....);
zk -
Financial Reporting - Dynamically populate Prior Year
Hi,
I need assistance on building one of the user reports.
The report needs to provide data for the last 11 months including the current selection. For example, if the user selects "Sep" period, the report should give data from Oct 08 to Sep 09.
The Period dimension in the report is set to the "Current point of view" and Year is set to Current year (2009).
I have used the relative function to offset and populate the period. However, as in the above example when the data is needed for Oct, Nov and Dec "2008" the year still remains FY09 and thereby shows wrong data (Oct 09, Nov 09, Dec 09 data).
Is there a function or any other way available in Studio to dynamically change the year to prior year when Period hits Dec?
Or is there any other way of populating 12 months prior data?
Kindly assist. Any help is much appreciated.
Regards,
RSHi,
As per my understanding of this requirement I would like to give you one suggestion.
You take Years as well in POV and whenever user select time Period 'Dec' then he should kindly select year as prior year(FY08).
i.e whenever user select any month apart from 'Dec' then he should select year FY09 through POV window while running the report.
This shall not be a good solution for this but shall help to show some expected result.. :)
Thanks... -
Access dynamically created JTextField
i need to create an unknown number of JTextField in my GUI, and this number depends on a user-input value.
Subsequently, i will need to read the strings from the JTextField. This is how I dynamically created my JTextField:
while (i < num-1) {
rangePanel.add(new JTextField("0")); // 0 is merely a default value
how can i access the created JTextFields?
thanxIs this the preferred style?
I currently have an array of JTextFields but am having real grief (input on screen not availble fro getText(), etc.), code fragment:
JTextField [] tf = new JTextField[10];
for (i=0, i<10; i++) {
ft[i] = new JTextField(15);
user enters data on screen...
String str = tf[0].getText() returns blank. Also <tab>ing jumps between first position and where ever mouse originally landed in field. -
How do you dynamically populate a list?
Hello! Can anybody tell me how to fill a drop down list or combo box dynamically? For example, I want to grab the unique values of a database (error_source), and populate a drop down list with those unique values. This way I won't have to constantly be updating the static entry list every time one changes.
Thanks for the help!Hi Sara,
have you tried the dynamic entry list? If not open the properties of your drop-down-list select the entry list tab. Then choose dynamic another popup appears. In this popup you have to select your system (your database or another data source), then you can select table. Now choose output under the output port. Then you can assign for the output port a value (this is the key) and a text (the text is displayed in the drop down).
If you have any problems with the entry list then this following wiki entry can help:
<a href="https://wiki.sdn.sap.com/wiki/display/VC/DynamicEntryListdoesnotwork">https://wiki.sdn.sap.com/wiki/display/VC/DynamicEntryListdoesnotwork</a>
Best Regards,
Marcel -
How to dynamically populate a manager name and level for any user who login
Hi All,
I need some help in doing this in my DB:
Table 1 is the the manager hierarchy {which basically shows the structure of every employee's org).
Table 2 is a list of all people manager ( all these usernames will also be in table 1). What i need to find is using the username from Table 2, the highest level that username exists in the manager hierarchy.
For ex:
Table 1: { What this shows is Sam is CEO and Jeff reports to him. So for Sam, he will exist on all 15 levels and Jeff will have Sam has his top level manager and then Jeff will repeat for all remaining levels till 15.
Manager Level 0 Level 1 Level 2 Level 3...Level15
Sam Sam Sam Sam Sam
Sam Jeff Jeff Jeff Jeff
Now in Table 2:
User Name Manager Level/Name
Sam Manager Level 0 Sam
Jeff Manager Level 1 Jeff
As you see, for each user name in Table i want to populate their high level from the manager hierarchy {their record in manager hierarchy).
Hope This helps to clear the confusion.
ThanksHello,
this is the forum for the tool {forum:id=260}. Please mark this question as answered, so others know that they can ignore it.
Then post again in {forum:id=75}
Regards
Marcus -
How do I dynamically populate a pdf series
I have designed a pdf form with 40+ fields, two of which I want to populate with client provided data, currently the client provided data has come from excel and has been saved as txt (tab delaminated) data.
From this point as the headers are matching the form so I can use Tools>More Form Option>Manage Form Data>Import Data to individually assign the records values to the pdf form.
Can this task be automated fo that for each record in my import .txt file the data is imported and a separate pdf is saved as a different file so that i have a set of pdfs for users filled in as required?This process is known as Mail Merging, and I've developed a tool for Acrobat that does exactly that.
Have a look here: http://try67.blogspot.com/2011/09/acrobat-mail-merge-and-email.html -
Trying to dynamically populate html:options
I am using iframe.
on the first frame the user inputs letters and the database is searched for anything that starts with those letters.
<html:text property="usersInput"/>
<html:submit value="search" onclick="middle.document.forms[0].property='list'"/>
the second frame "middle" is suppose to display the results of the search.
html:select property="list">
<html:options property="list"/>
</html:select>
of course with this code the second frame "middle" gives an err msg, because list is null.
Is there anyway to get around this so that initially the select list that appears on the pages is empty and then when the search is done (button is clicked) the list will populate with the results?I guess there must be something wrong with my question :( no one is helping me. Well let me ask this...
With formbeans and iframes...
Is the information process while in the <html:form>...</html:form> or once it leaves the form? because now I'm doing the search in one frame and then onclick="..." I'm calling another frame to display the results of the search using <html:select><html:options>...</html:select>, but I keep getting an err msg "null pointer".
It seems like the information from the first iframe, either has not been "processed" or got "deleted" by the formbean, when the second frame tries to access it.
Can someone please give me an idea of what's going on. I'VE HIT A WALL!!!!
Maybe you are looking for
-
IMac G5 Internal Hard Drive Not Recognized
I shut down my iMac G5 with the power button and not through the typical shutdown procedure once and then when it booted up it would not get past the gray screen. I eventually used the Leopard DVD to try to boot it and was able to get to disk utility
-
Db13 Error BR0981W During CheckDB
Hi Experts, I' running ECC5.0 with Oracle. While CheckDB in db13 I'm recieveign following error from few days. BR0981W Not enough disk space for the total maximum size 90000.000 MB of 9 files of tablespace PSAP<SID> on disk device 5578786, missing at
-
Nested Navigation Menu, Pure CSS
Argh! Can anyone help me perfect my nested navigation menu?? I had originally built it as a single level vertical menu, but now need to add 2 more levels. I got the second level working fine, except I can't get the rollover effect to line up correctl
-
Should show up under your profile - Activity
-
Hard lockup when closing laptop lid (Linux 2.6.23)
I just found this out a few days ago, telling my laptop to shut down a few hours later, and still finding it running half a day later, severely overheated (!). I am running a custom kernel (2.6.23.1 with some of the kamikaze broken out patches). I ge