How to display content with dynamic folder path
Hi Experts,
I have a folder with subfolders. This subfolders are named as weeknumbers. What we want is: depending on the weeknumber, the right folder with content is showing automatically. In week 1 we see the content of week 1 , in week 2 we see the content of week 2 etc.
How to achive this, what is the best way?
Thanks in advance,
Joeri
Hi Joeri,
I would follow the below procedure...
1. create a the KM navigation iViews for each of the folders in KM (Week1, Week2 etc).
2. Create a JSP(PAR) or an HTML to access these iViews (as [Link1], [Link2] etc on a JSP or an HTML)
3. Create an iView from PAR (if JSP-PAR)
OR Create a KM Document iView for the HTML Page (Store the HTML Page in KM again)
I hope this would help you.
Cheers!!!
Biroj Patro.
Similar Messages
-
How to display data with dynamic columns in JavaServerFaces?
I have a simple JSF application, where I click a button, it will display another page with data table of 2 columns and 3 rows of data. These data are �hard coded� for testing only.
In the jsp I will use like this:-
<h:dataTable
value="#{dataBean.users}"
var="record">
<h:column>
<h:outputText value="#{record.name}"/>
</h:column>
<h:column>
<h:outputText value="#{record.title}"/>
</h:column>
</h:dataTable>
Let�s say, if my data cannot be defined in advance in terms of quantity and names, how should I write my jsp and how should I define in java program?
For example, instead of the columns �name� and �title� as in above, I will know the column names and the number of columns at run time, how should I do?You need a custom component in this case. There afew out there, you may want to check what is out there before you write your own
-
How to display string with XML content in 4.6?
Hi,
I`d like to know how to display string with XML content in it for 4.6.
4.6 has not method parse_string.
And example like this is not helpful:
DATA: lo_mxml TYPE REF TO cl_xml_document.
CREATE OBJECT lo_mxml.
CALL METHOD lo_mxml->parse_string
EXPORTING
stream = gv_xml_string.
CALL METHOD lo_mxml->display.
Thank you.Hi,
May be you can use fm SAP_CONVERT_TO_XML_FORMAT. But it have some issues with memory usage, the program consumed tons of memory during convert.
a® -
We just set up a web site with InContext editing following the procedures in Business Catalyst documentation to do that. But now when we go to the administration section of the site, and turn on InContext editing, it won't let us update the text. We receive an error message:
"This region contains content with dynamic behavior added..."
Does anyone know what causes this problem, and how to fix it?Hi,
InContext Editable (ICE) regions can only contains static areas like text and static assets, it cannot wrap around javascript – populated areas or dynamic content like slideshows. (most likely causing the error)
ICE can edit only static page content such as regular HTML content. It cannot edit any element that is dynamically updated for example a div (or another element) which is manipulated (created or its contents are modified) by JS– populated areas or dynamic content like slideshows. It cannot edit menus, content holders or content outputted by system modules or tags either.
By default, on a page that has no ICE editable regions defined the editor attempts to find any regions you might want to edit and if possible make them editable. If it does not find the correct regions you want to edit you will need to explicitly define some editable regions.
Refer to this article on Defining InContext Editing editable regions - http://kb.worldsecuresystems.com/838/cpsid_83855.html?bc-partner
Hope this helps!
-Sidney -
Websites Displaying Content with Security Certificate Errors
Can anyone explain what those yellow banners on the top of the screen that say "Internet Explorer blocks websites displaying content with security certificate errors, etc." mean and why they keep you our of certain websites and how you can get rid of them? (Sorry for the run-on sentence/question.)
Thank you!LadyMac wrote:
Can anyone explain what those yellow banners on the top of the screen that say "Internet Explorer blocks websites displaying content with security certificate errors, etc." mean and why they keep you our of certain websites and how you can get rid of them? (Sorry for the run-on sentence/question.)
Thank you!
It means there is a problem with the sites security certificate.
There should be a "Continue to this website (not recommended)" message. I would not recommend doing that unless it is a site you know and trust.
In IE10 you can not disable that feature.
The following link will provide more information.
http://windows.microsoft.com/en-us/windows-vista/about-certificate-errors -
How to generate report with dynamic variable number of columns?
How to generate report with dynamic variable number of columns?
I need to generate a report with varying column names (state names) as follows:
SELECT AK, AL, AR,... FROM States ;
I get these column names from the result of another query.
In order to clarify my question, Please consider following table:
CREATE TABLE TIME_PERIODS (
PERIOD VARCHAR2 (50) PRIMARY KEY
CREATE TABLE STATE_INCOME (
NAME VARCHAR2 (2),
PERIOD VARCHAR2 (50) REFERENCES TIME_PERIODS (PERIOD) ,
INCOME NUMBER (12, 2)
I like to generate a report as follows:
AK CA DE FL ...
PERIOD1 1222.23 2423.20 232.33 345.21
PERIOD2
PERIOD3
Total 433242.23 56744.34 8872.21 2324.23 ...
The TIME_PERIODS.Period and State.Name could change dynamically.
So I can't specify the state name in Select query like
SELECT AK, AL, AR,... FROM
What is the best way to generate this report?SQL> -- test tables and test data:
SQL> CREATE TABLE states
2 (state VARCHAR2 (2))
3 /
Table created.
SQL> INSERT INTO states
2 VALUES ('AK')
3 /
1 row created.
SQL> INSERT INTO states
2 VALUES ('AL')
3 /
1 row created.
SQL> INSERT INTO states
2 VALUES ('AR')
3 /
1 row created.
SQL> INSERT INTO states
2 VALUES ('CA')
3 /
1 row created.
SQL> INSERT INTO states
2 VALUES ('DE')
3 /
1 row created.
SQL> INSERT INTO states
2 VALUES ('FL')
3 /
1 row created.
SQL> CREATE TABLE TIME_PERIODS
2 (PERIOD VARCHAR2 (50) PRIMARY KEY)
3 /
Table created.
SQL> INSERT INTO time_periods
2 VALUES ('PERIOD1')
3 /
1 row created.
SQL> INSERT INTO time_periods
2 VALUES ('PERIOD2')
3 /
1 row created.
SQL> INSERT INTO time_periods
2 VALUES ('PERIOD3')
3 /
1 row created.
SQL> INSERT INTO time_periods
2 VALUES ('PERIOD4')
3 /
1 row created.
SQL> CREATE TABLE STATE_INCOME
2 (NAME VARCHAR2 (2),
3 PERIOD VARCHAR2 (50) REFERENCES TIME_PERIODS (PERIOD),
4 INCOME NUMBER (12, 2))
5 /
Table created.
SQL> INSERT INTO state_income
2 VALUES ('AK', 'PERIOD1', 1222.23)
3 /
1 row created.
SQL> INSERT INTO state_income
2 VALUES ('CA', 'PERIOD1', 2423.20)
3 /
1 row created.
SQL> INSERT INTO state_income
2 VALUES ('DE', 'PERIOD1', 232.33)
3 /
1 row created.
SQL> INSERT INTO state_income
2 VALUES ('FL', 'PERIOD1', 345.21)
3 /
1 row created.
SQL> -- the basic query:
SQL> SELECT SUBSTR (time_periods.period, 1, 10) period,
2 SUM (DECODE (name, 'AK', income)) "AK",
3 SUM (DECODE (name, 'CA', income)) "CA",
4 SUM (DECODE (name, 'DE', income)) "DE",
5 SUM (DECODE (name, 'FL', income)) "FL"
6 FROM state_income, time_periods
7 WHERE time_periods.period = state_income.period (+)
8 AND time_periods.period IN ('PERIOD1','PERIOD2','PERIOD3')
9 GROUP BY ROLLUP (time_periods.period)
10 /
PERIOD AK CA DE FL
PERIOD1 1222.23 2423.2 232.33 345.21
PERIOD2
PERIOD3
1222.23 2423.2 232.33 345.21
SQL> -- package that dynamically executes the query
SQL> -- given variable numbers and values
SQL> -- of states and periods:
SQL> CREATE OR REPLACE PACKAGE package_name
2 AS
3 TYPE cursor_type IS REF CURSOR;
4 PROCEDURE procedure_name
5 (p_periods IN VARCHAR2,
6 p_states IN VARCHAR2,
7 cursor_name IN OUT cursor_type);
8 END package_name;
9 /
Package created.
SQL> CREATE OR REPLACE PACKAGE BODY package_name
2 AS
3 PROCEDURE procedure_name
4 (p_periods IN VARCHAR2,
5 p_states IN VARCHAR2,
6 cursor_name IN OUT cursor_type)
7 IS
8 v_periods VARCHAR2 (1000);
9 v_sql VARCHAR2 (4000);
10 v_states VARCHAR2 (1000) := p_states;
11 BEGIN
12 v_periods := REPLACE (p_periods, ',', ''',''');
13 v_sql := 'SELECT SUBSTR(time_periods.period,1,10) period';
14 WHILE LENGTH (v_states) > 1
15 LOOP
16 v_sql := v_sql
17 || ',SUM(DECODE(name,'''
18 || SUBSTR (v_states,1,2) || ''',income)) "' || SUBSTR (v_states,1,2)
19 || '"';
20 v_states := LTRIM (SUBSTR (v_states, 3), ',');
21 END LOOP;
22 v_sql := v_sql
23 || 'FROM state_income, time_periods
24 WHERE time_periods.period = state_income.period (+)
25 AND time_periods.period IN (''' || v_periods || ''')
26 GROUP BY ROLLUP (time_periods.period)';
27 OPEN cursor_name FOR v_sql;
28 END procedure_name;
29 END package_name;
30 /
Package body created.
SQL> -- sample executions from SQL:
SQL> VARIABLE g_ref REFCURSOR
SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2,PERIOD3','AK,CA,DE,FL', :g_ref)
PL/SQL procedure successfully completed.
SQL> PRINT g_ref
PERIOD AK CA DE FL
PERIOD1 1222.23 2423.2 232.33 345.21
PERIOD2
PERIOD3
1222.23 2423.2 232.33 345.21
SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2','AK,AL,AR', :g_ref)
PL/SQL procedure successfully completed.
SQL> PRINT g_ref
PERIOD AK AL AR
PERIOD1 1222.23
PERIOD2
1222.23
SQL> -- sample execution from PL/SQL block
SQL> -- using parameters derived from processing
SQL> -- cursors containing results of other queries:
SQL> DECLARE
2 CURSOR c_period
3 IS
4 SELECT period
5 FROM time_periods;
6 v_periods VARCHAR2 (1000);
7 v_delimiter VARCHAR2 (1) := NULL;
8 CURSOR c_states
9 IS
10 SELECT state
11 FROM states;
12 v_states VARCHAR2 (1000);
13 BEGIN
14 FOR r_period IN c_period
15 LOOP
16 v_periods := v_periods || v_delimiter || r_period.period;
17 v_delimiter := ',';
18 END LOOP;
19 v_delimiter := NULL;
20 FOR r_states IN c_states
21 LOOP
22 v_states := v_states || v_delimiter || r_states.state;
23 v_delimiter := ',';
24 END LOOP;
25 package_name.procedure_name (v_periods, v_states, :g_ref);
26 END;
27 /
PL/SQL procedure successfully completed.
SQL> PRINT g_ref
PERIOD AK AL AR CA DE FL
PERIOD1 1222.23 2423.2 232.33 345.21
PERIOD2
PERIOD3
PERIOD4
1222.23 2423.2 232.33 345.21 -
PPR Report ,How to display Label with TOTAl
Hi,
How Can i display PPR Report ,How to display Label with TOTAl like
[http://apex.oracle.com/pls/apex/f?p=267:30:]
Thanks
Edited by: 805629 on Jan 6, 2011 3:34 AMHi,
For PPR Report:
Select "Yes" in "Enable Partial Page Refresh" item of "Layout and Pagination" region in Report Attributes of that report.
For display Label with TOTAL:
Use "Break Formatting" region in Report Attributes of that report.
Regards,
Kartik Patel
http://patelkartik.blogspot.com/
http://apex.oracle.com/pls/apex/f?p=9904351712:1 -
When I bring up Explorer and click on Icloud i get a message that access is blocked from displaying content with security errors
The new iTunes has a somewhat different look from the previous version. You can get the old look back if you prefer it by doing View > Show Sidebar in iTunes. Or you can adapt to the new look.
-
How to display content items in two columns?
I have a simple content area set up, that I am adding items in
(items that happen to be uploaded documentation files). I have a
page created that displays the Content Area, with my own
headers/banners etc.
I want to display the item(s) under each folder in the content
are, in two columns, but I can't figure out how?
Thanks.Dave,
Edit the Folder Style. Select the Folder Layout tab. Select
the Region Properties you want to modify (e.g. Regular Items).
Near the bottom of the page you can specify the number of
columns.
Regards,
Jerry -
Just need to know how to move contents of a folder PLEASE :)
Hi all Need to know something?.
I want to move the contents of a folder to another.
I am using this code to move a file to another but how do I move the whole contents to another.
public void moveBack() {
try {
selectedFileName = (String) OrdersUploadFileNameHashtable.get(
(String) jOrdersUploadList1.getSelectedValue());
ShortFileName = (String) jOrdersUploadList1.getSelectedValue();
if (!jOrdersUploadList1.getSelectedValue().equals(null)) {
File w = new File(EpodConstants.ORDERS_TO_UPLOAD_DIR, selectedFileName);
File f = new File(EpodConstants.ORDERS_PENDING_DIR, selectedFileName);
if (w.renameTo(f))
System.out.println("ok");
else {
JOptionPane.showMessageDialog(null,
"No Order Selected",
"You must Select a Order to Move",
JOptionPane.INFORMATION_MESSAGE);
}here's my solution:
* Copy a file. The destination file name can be different from the source file name. Rules:
* <ul>
* <li>If destination is an existing directory, <i>source</i> is copied to this directory
* <li>If destination is an existing file, this file is overwritten.
* <li>If destination is a file name with leading path, leading path is created.
* <li>If destination is just a file name, path of <i>source</i> is used as destination.
* <li>If destination ends with a File.separatorChar, it is created as the destination directory.
* </ul>
* @param source Name of file (incl. path) to copy.
* @param destination Name of destination file to copy to.
* @throws IOException
* @see <a href="http://java.sun.com/docs/books/performance/1st_edition/html/JPIOPerformance.fm.html">I/O Performance</a>
public static void copyFile(String source, String destination) throws IOException {
if (source != null && destination != null) {
File sourceFile = new File(source);
if (sourceFile.exists() && sourceFile.isFile()) { //no directory?
File destFile = new File(destination);
if (destFile.exists()) {
if (destFile.isDirectory()) { //1. existing destination directory
destFile = new File(destination + File.separatorChar + sourceFile.getName());
} else { //2. existing destination file
//ignore, overwrite existing destination file
} else { //destination does not exist
int index = destination.lastIndexOf(File.separator);
if (index > -1) { //3. file has leading directory path or is directory
if (index == (destination.length() - 1)) { //destination is directory?
File destDir = new File(destination);
destDir.mkdirs();
destFile = new File(destDir + sourceFile.getName());
} else { //destination is directory + file
String destDir = destination.substring(0, index + 1);
File destDirFile = new File(destDir);
if (!destDirFile.exists()) {
destDirFile.mkdirs(); //create destination directory tree
} else { //4. file has no leading directory path
destFile = new File(sourceFile.getParent() + File.separatorChar + destination);
BufferedInputStream in = null;
BufferedOutputStream out = null;
try {
in = new BufferedInputStream(new FileInputStream(sourceFile));
out = new BufferedOutputStream(new FileOutputStream(destFile));
int c;
while ((c = in.read()) != -1) { //read next byte of data until end of stream is reached
out.write(c);
out.flush();
} finally {
if (in != null) { in.close(); }
if (out != null) { out.close(); }
}//else: source file does not exist or is a directory
}//else: no input values available
}//copyFile()
* Copy all files of a directory to a destination directory. If the destination file does not exist, it
* is created. If copy of one file throws an exception, copy of remaining files continue, so that at least
* all files without exceptions get copied.
* @param sourceDir Source directory to copy all files from.
* @param targetDir Destination directory to copy all files to.
* @throws IOException
public static void copyFiles(String sourceDir, String targetDir) throws IOException {
IOException exception = null;
if (sourceDir != null && targetDir != null) {
File sourceFile = new File(sourceDir);
if (sourceFile.exists() && sourceFile.isDirectory()) {
File targetFile = new File(targetDir);
if (!targetFile.exists()) {
targetFile.mkdirs();
//for all files of source dir do:
String[] filesToCopy = sourceFile.list();
int count = filesToCopy.length;
for (int i = 0; i < count; i++) { //for each source file do
String fileName = filesToCopy;
File file = new File(sourceDir + File.separatorChar + fileName);
if (file.isFile()) {
try {
copyFile(sourceDir + File.separatorChar + fileName, targetDir);
} catch (IOException ioe) {
exception = ioe;
} else { //file is directory
try {
copyFiles(sourceDir + File.separatorChar + fileName, targetDir + File.separatorChar + fileName);
} catch (IOException ioe) {
exception = ioe;
}//next file
}//else: source directory does not exist
}//else: input values not available
if (exception != null) {
throw exception;
}//copyFiles() -
How to display data with the same text and key in the drop down list?
Hi All,
Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
REPORT ZTESTING.
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST,
c(20) type c.
* c = 'select any'.
data:begin of itab occurs 0,
kunnr like kna1-kunnr,
name1 like kna1-name1,
end of itab.
data:begin of jtab occurs 0,
kunnr like kna1-kunnr,
land1 like kna1-land1,
end of jtab.
PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
default 'SELECT'.
AT SELECTION-SCREEN OUTPUT.
NAME = 'p_list'.
VALUE-KEY = 'Name'. "---> Data for key is the same with text
VALUE-TEXT = 'Name'. "--> Data for text is the same with key
APPEND VALUE TO LIST.
VALUE-KEY = '2'.
VALUE-TEXT = 'Country'.
APPEND VALUE TO LIST.
CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
start-of-selection.
select kunnr name1 up to 20 rows from kna1 into table itab.
select kunnr land1 up to 20 rows from kna1 into table jtab.
case p_list.
when '1'.
loop at itab.
write:/ itab-kunnr,itab-name1.
endloop.
when '2'.
loop at jtab.
write:/ jtab-kunnr,jtab-land1.
endloop.
endcase.
<Added code tags>
Moderator Message: Please use the "code" tags to format your code snippet.
Edited by: Suhas Saha on Nov 17, 2011 11:19 AMshawnTan wrote:
Hi All,
>
> Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
>
>
REPORT ZTESTING.
>
> TYPE-POOLS: VRM.
>
> DATA: NAME TYPE VRM_ID,
> LIST TYPE VRM_VALUES,
> VALUE LIKE LINE OF LIST,
> c(20) type c.
>
> * c = 'select any'.
>
> data:begin of itab occurs 0,
> kunnr like kna1-kunnr,
> name1 like kna1-name1,
> end of itab.
>
> data:begin of jtab occurs 0,
> kunnr like kna1-kunnr,
> land1 like kna1-land1,
> end of jtab.
>
> PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
> default 'SELECT'.
>
> AT SELECTION-SCREEN OUTPUT.
>
> NAME = 'p_list'.
>
> VALUE-KEY = 'Name'. "---> Data for key is the same with text
> VALUE-TEXT = 'Name'. "--> Data for text is the same with key
> APPEND VALUE TO LIST.
>
> VALUE-KEY = '2'.
> VALUE-TEXT = 'Country'.
> APPEND VALUE TO LIST.
>
> CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
>
> start-of-selection.
> select kunnr name1 up to 20 rows from kna1 into table itab.
> select kunnr land1 up to 20 rows from kna1 into table jtab.
>
> case p_list.
> when '1'.
> loop at itab.
> write:/ itab-kunnr,itab-name1.
> endloop.
>
> when '2'.
> loop at jtab.
> write:/ jtab-kunnr,jtab-land1.
> endloop.
> endcase.
>
> <Added code tags>
>
> Moderator Message: Please use the "code" tags to format your code snippet.
>
> Edited by: Suhas Saha on Nov 17, 2011 11:19 AM
This surely seems to be a bug to me(if not by design), did you check for any SAP notes? Perhaps a front end trace can help(Note 407743) !
-Rajesh. -
How to display UI elements dynamically on the click of a radiobutton
hi all,
I have created two radio buttons rb1, rb2 dynamically. If i click on rb1, ......
one label, one inputfield (ie., some UI elements ) must be displayed in the same view & if i click on rb2, other UI elements must display.
can anyone tell how to display UI elements which were created dynamically on the click of a radio button.
thanks & regards,
vilaHi,
1. Create a context attribute name visible1 of type type com.sap.ide.webdynpro.uielementdefinitions.Visibility(using brose button in the type property of context)
2. Bind this context to all tha elements of that you want to make visible when radio button 1 is clicked to their visibility property.
3. Create a context attribute name visible2 of type com.sap.ide.webdynpro.uielementdefinitions.Visibility(using brose button in the type property of context)
4. Bind this context to all tha elements of that you want to make visible when radio button 2 is clicked to their visibility property.
5. Create actions for both radio button1 say action1 and for radio button2 say action2.
6. In action1 write this line of code
wdContext.currentContextElement.setVisible1(WDVisibility.VISIBLE);
wdContext.currentContextElement.setVisible2(WDVisibility.BLANK);
7. In action2 write this line of code
wdContext.currentContextElement.setVisible2(WDVisibility.VISIBLE);
wdContext.currentContextElement.setVisible1(WDVisibility.BLANK);
Regards,
Murtuza -
How to display field information dynamically in reports
How to display field information, depending on the description in DOMAINS..dynamically in reports...
give an example.
ThanksHi
the text u should take into the internal table for that and
it should send into the ALV_GRID_DISPLY
SLIS_FIELDCATALOG_T_ALV-SELECTION_TEXT = " DOMAIN".
other wise u should set in the write statement
write : / ' '. -
How to display rectangles with the following code in a JPanel?
I am trying to make a bunch of random rectangles appear inside a JPanel on a GUI form. Im not sire how to display the form and panel with random rectangles. I have in my package the MyRectangle class, a blank JForm class called RectGUI and the class for the panel RectGUIPanel. The following code is from my panel and it should create random rectangles okay but how do I display them inside of a Panel on my RectGUI form? Thanks for the assistance.
//Declare variables
private int x;
private int y;
private int width;
private int height;
private Color color;
Random rand = new Random();
public class RectanglePanel extends JPanel
public void displayRectangles()
// Declare an arraylist of MyRectangles
ArrayList<MyRectangle> myArray = new ArrayList<MyRectangle>();
int maxNumber = 300;
// Declare Frame and Panel
JFrame frame = new JFrame();
Container pane = frame.getContentPane();
RectanglePanel rect = new RectanglePanel();
// Set Frame attributes
frame.setSize(700, 500);
frame.setLocation(100,100);
frame.setAlwaysOnTop(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setTitle(" Rectangle Program");
frame.setVisible(true);
for (int i = 0; i < maxNumber; i++)
MyRectangle rec = createRandomRec();
myArray.add(rec);
rect.repaint();
public MyRectangle createRandomRec()
x = rand.nextInt();
y = rand.nextInt();
width = rand.nextInt();
height = rand.nextInt();
color = new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
return new MyRectangle(x, y , width, height, color);
}I am trying to make a bunch of random rectangles appear inside a JPanel on a GUI form. Im not sire how to display the form and panel with random rectangles. I have in my package the MyRectangle class, a blank JForm class called RectGUI and the class for the panel RectGUIPanel. The following code is from my panel and it should create random rectangles okay but how do I display them inside of a Panel on my RectGUI form? Thanks for the assistance.
//Declare variables
private int x;
private int y;
private int width;
private int height;
private Color color;
Random rand = new Random();
public class RectanglePanel extends JPanel
public void displayRectangles()
// Declare an arraylist of MyRectangles
ArrayList<MyRectangle> myArray = new ArrayList<MyRectangle>();
int maxNumber = 300;
// Declare Frame and Panel
JFrame frame = new JFrame();
Container pane = frame.getContentPane();
RectanglePanel rect = new RectanglePanel();
// Set Frame attributes
frame.setSize(700, 500);
frame.setLocation(100,100);
frame.setAlwaysOnTop(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setTitle(" Rectangle Program");
frame.setVisible(true);
for (int i = 0; i < maxNumber; i++)
MyRectangle rec = createRandomRec();
myArray.add(rec);
rect.repaint();
public MyRectangle createRandomRec()
x = rand.nextInt();
y = rand.nextInt();
width = rand.nextInt();
height = rand.nextInt();
color = new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
return new MyRectangle(x, y , width, height, color);
} -
How to include content with MyFaces?
Hi.
I have what must be a common problem: I wish to include HTML content from a source file in a JSF file. I am using MyFaces, but I think the problem is more general.
I currently can include static content trivially, with a jsp:include tag:
<f:subview id="content">
<f:verbatim>
<jsp:include page="home.html" />
</f:verbatim>
</f:subview>The problem occurs when I want to choose the content file dynamically, based on a value from the backing bean. This fails:
<f:subview id="content">
<f:verbatim>
<jsp:include page="#{backingBean.currentContent}" />
</f:verbatim>
</f:subview>I understand why this fails: the JSP EL does not recognize the Faces value. I have tried various ways to circumvent this including trying to use various types of includes, using iframe tags (with and without the htmlTag tag), etc. But all these have failed. I know the HTML content itself needs to be wrapped in verbatim tags, but I can easily place those in the content files if needed.
What is the right way to include simple HTML source files from Faces? Searching various forums and documentation, I could not find any clear instructions that worked.
Thanks.
+ RichardYou could try using <c:import> instead of <jsp:include> (and remove the verbatims, of course). I haven't tried that with simple html though, but I think it should work.
jimbo
Maybe you are looking for
-
How do I print borderless on HP Deskjet 1510
HP Deskjet 1510 doesn't allow me to print my ACTUAL SIZE document on a A4 size paper. My documents are in PDF form and are all in A4 size. When I print it, bottom part of my documents gone. Am using a window 8, Adobe reader latest version 11.09.
-
Major Problem w/ USB Sound Interface Driver
I want to start off saying that I have Parallels Desktop installed w/ a Windows 7 Guest OS. I have the Audio 8 DJ driver installed on Windows 7 AND OSX Lion. However when I plug the Audio 8 DJ interface in, it allows me to choose whether it will be c
-
Drag and Drop Image onto Native Application
I am interested in dragging and dropping an image from a java app to a native app (such as MS-WORD, etc), i have been able to DnD text but have been unsuccessful with images. any tips, resources? Thanks
-
How to implement enter-query , execute-query in Apex Forms
Hi, I am new to Oracle Application Express. I want to know what is the equivalent of ENTER-QUERY and EXECUTE-QUERY features of Oracle Forms in Oracle APEX? I saw a lot of documentation, but everywhere I found that APEX forms only have 3 database acti
-
I am trying to generate a 6i report in Adobe PDF format by making a call in a form to a Reports Server on the web, and then automatically have an e-mail generated with the report as an attachment. When generating the report directly from Report 6i Bu