Iterate over some output text in a panel Grid

Hello folks
Are any of you doing something like this in JSC
<code>
<%
for (int i = 0; i<4; i++)
%>
<h:panelGrid bgcolor="gray" binding="#{Page1.gridPanel1}" id="gridPanel1" style="height: 73px; left: 0px; top: 120px; position: absolute" width="216">
<h:outputText binding="#{Page1.outputText1}" id="outputText1" value="Author"/>
<h:outputText binding="#{Page1.outputText2}" id="outputText2" value="Summary"/>
<h:outputText binding="#{Page1.outputText3}" id="outputText3" value="Article link"/>
</h:panelGrid>
<%
%>
</code>
What I'm trying to do is something like data table, except that I want to have control over where the output text goes, and how it is presented.
In data table all I get is a predefined table (I�m unable to format it the way I would like) so lets do it the old way - link some output text to a database or maybe an array which holds the "data" then loop over it x number of times to display the content kind of like this
For (less than x times) do
Author name
Date article written
Summary article
Link to more of the article
This would be the way I used to this, now I�m curios how this is done using JSF
<% loop here %> does not mix well in Creator, error not well formed
I�m unable to format a data table in any respect except number of rows and stuff
So Any suggestion on how to really do this effectively in JSC/JSF
Thanks Bjorn

Hi,
Actually, you have quite a bit of flexibility with the Data Table component.
You can add more than one component to a column,
and you can use an outputText component to hold
HTML formatting tags, such as <br>.
Note: you must uncheck the escape attribute.
And since the data table component produces an HTML <table> tag,
you can also control style with additional style sheet classes (see Tor's blog).
For an example of using the Data Table component
to display the resuts of the Google search web services,
See Beyond the Book at this URL:
http://www.asgteach.com/download/beyond.pdf
The relevant description is section A.5 beginning on page 24.
Hope this helps.
--Gail A.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • What is the best way to store and iterate over lists of words?

    Hi,
    Im trying to create a naive bayesian classifier to attribute aurthorship to some texts. I have three text files in the form of a list of words (listA, listB and listC, where listA is a disputed text and listB, listC are those of known authors). I need to feed these into my program, than compare listA to listB (to check if listA has the same words as listB), perform the classification and do the same for listA and listC.
    Im new to java and would like to know the best way of comparing the text files....could i store listA in an array....listB in a hashmap, iterate over the hashmap to check which words are also contained in listA and store the similar words in a seperate arraylist?
    plz help.

    If you just want to check if one set of words contains another set of words then something implementing java.util.Set might be sufficient. Read the API docs, you don't need to write much code yourself. Maps are for looking up values based on keys; your problem statement doesn't mention that so you don't need them. Lists are for when the order of entries matters. Read this for more information:
    http://java.sun.com/docs/books/tutorial/collections/index.html

  • How can I iterate over the columns of a REF CURSOR?

    I have the following situation:
    DECLARE
       text   VARCHAR2 (100) := '';
       TYPE gen_cursor is ref cursor;
       c_gen gen_cursor;
       CURSOR c_tmp
       IS
            SELECT   *
              FROM   CROSS_TBL
          ORDER BY   sn;
    BEGIN
       FOR tmp IN c_tmp
       LOOP
          text := 'select * from ' || tmp.table_name || ' where seqnum = ' || tmp.sn;
          OPEN c_gen FOR text;
          -- here I want to iterate over the columns of c_gen
          -- c_gen will have different number of columns every time,
          --        because we select from a different table
          -- I have more than 500 tables, so I cannot define strong REF CURSOR types!
          -- I need something like
          l := c_gen.columns.length;
          for c in c_gen.columns[1]..c_gen.columns[l]
          LOOP
              -- do something with the column value
          END LOOP;
       END LOOP;
    END;As you can see from the comments in the code, I couln'd find any examples on the internet with weak REF CURSORS and selecting from many tables.
    What I found was:
    CREATE PACKAGE admin_data AS
       TYPE gencurtyp IS REF CURSOR;
       PROCEDURE open_cv (generic_cv IN OUT gencurtyp, choice INT);
    END admin_data;
    CREATE PACKAGE BODY admin_data AS
       PROCEDURE open_cv (generic_cv IN OUT gencurtyp, choice INT) IS
       BEGIN
          IF choice = 1 THEN
             OPEN generic_cv FOR SELECT * FROM employees;
          ELSIF choice = 2 THEN
             OPEN generic_cv FOR SELECT * FROM departments;
          ELSIF choice = 3 THEN
             OPEN generic_cv FOR SELECT * FROM jobs;
          END IF;
       END;
    END admin_data;
    /But they have only 3 tables here and I have like 500. What can I do here?
    Thanks in advance for any help!

    The issue here is that you don't know your columns at design time (which is generally considered bad design practice anyway).
    In 10g or before, you would have to use the DBMS_SQL package to be able to iterate over each of the columns that are parsed from the query... e.g.
    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2) IS
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_rowcount  NUMBER := 0;
    BEGIN
      -- create a cursor
      c := DBMS_SQL.OPEN_CURSOR;
      -- parse the SQL statement into the cursor
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      -- execute the cursor
      d := DBMS_SQL.EXECUTE(c);
      -- Describe the columns returned by the SQL statement
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      -- Bind local return variables to the various columns based on their types
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000); -- Varchar2
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);      -- Number
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);     -- Date
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);  -- Any other type return as varchar2
        END CASE;
      END LOOP;
      -- Display what columns are being returned...
      DBMS_OUTPUT.PUT_LINE('-- Columns --');
      FOR j in 1..col_cnt
      LOOP
        DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' - '||case rec_tab(j).col_type when 1 then 'VARCHAR2'
                                                                                  when 2 then 'NUMBER'
                                                                                  when 12 then 'DATE'
                                                         else 'Other' end);
      END LOOP;
      DBMS_OUTPUT.PUT_LINE('-------------');
      -- This part outputs the DATA
      LOOP
        -- Fetch a row of data through the cursor
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        -- Exit when no more rows
        EXIT WHEN v_ret = 0;
        v_rowcount := v_rowcount + 1;
        DBMS_OUTPUT.PUT_LINE('Row: '||v_rowcount);
        DBMS_OUTPUT.PUT_LINE('--------------');
        -- Fetch the value of each column from the row
        FOR j in 1..col_cnt
        LOOP
          -- Fetch each column into the correct data type based on the description of the column
          CASE rec_tab(j).col_type
            WHEN 1  THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                         DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' : '||v_v_val);
            WHEN 2  THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                         DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' : '||v_n_val);
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                         DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' : '||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'));
          ELSE
            DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
            DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' : '||v_v_val);
          END CASE;
        END LOOP;
        DBMS_OUTPUT.PUT_LINE('--------------');
      END LOOP;
      -- Close the cursor now we have finished with it
      DBMS_SQL.CLOSE_CURSOR(c);
    END;
    SQL> exec run_query('select empno, ename, deptno, sal from emp where deptno = 10');
    -- Columns --
    EMPNO - NUMBER
    ENAME - VARCHAR2
    DEPTNO - NUMBER
    SAL - NUMBER
    Row: 1
    EMPNO : 7782
    ENAME : CLARK
    DEPTNO : 10
    SAL : 2450
    Row: 2
    EMPNO : 7839
    ENAME : KING
    DEPTNO : 10
    SAL : 5000
    Row: 3
    EMPNO : 7934
    ENAME : MILLER
    DEPTNO : 10
    SAL : 1300
    PL/SQL procedure successfully completed.
    SQL> exec run_query('select * from emp where deptno = 10');
    -- Columns --
    EMPNO - NUMBER
    ENAME - VARCHAR2
    JOB - VARCHAR2
    MGR - NUMBER
    HIREDATE - DATE
    SAL - NUMBER
    COMM - NUMBER
    DEPTNO - NUMBER
    Row: 1
    EMPNO : 7782
    ENAME : CLARK
    JOB : MANAGER
    MGR : 7839
    HIREDATE : 09/06/1981 00:00:00
    SAL : 2450
    COMM :
    DEPTNO : 10
    Row: 2
    EMPNO : 7839
    ENAME : KING
    JOB : PRESIDENT
    MGR :
    HIREDATE : 17/11/1981 00:00:00
    SAL : 5000
    COMM :
    DEPTNO : 10
    Row: 3
    EMPNO : 7934
    ENAME : MILLER
    JOB : CLERK
    MGR : 7782
    HIREDATE : 23/01/1982 00:00:00
    SAL : 1300
    COMM :
    DEPTNO : 10
    PL/SQL procedure successfully completed.
    SQL> exec run_query('select * from dept where deptno = 10');
    -- Columns --
    DEPTNO - NUMBER
    DNAME - VARCHAR2
    LOC - VARCHAR2
    Row: 1
    DEPTNO : 10
    DNAME : ACCOUNTING
    LOC : NEW YORK
    PL/SQL procedure successfully completed.
    SQL>From 11g onwards, you can create your query as a REF_CURSOR, but then you would still have to use the DBMS_SQL package with it's new functions to turn the refcursor into a dbms_sql cursor so that you can then describe the columns in the same way.
    http://technology.amis.nl/blog/2332/oracle-11g-describing-a-refcursor
    Welcome to the issues that are common when you start to attempt to create dynamic code. If your design isn't specific then your code can't be either and you end up creating more work in the coding whilst reducing the work in the design. ;)

  • Truncate output text in hierarchyViewer component

    Hi,
    I want to display the text with truncated to 30 characters only. I identified the outputText and added the truncateAt attribute and set it to 30. but it doesn't seem to work. Moreover the line - truncateAt="30" is underlined with orange squiggly lines indicating that there is some error and when I mouse over it , it says that this attribute is not supported when the component is inside of a hierarchyViewer component.
    Any pointers how can I truncate the output text to 30 characters only?
    Thanks,
    Dhirendra

    hi Vinod,
    Thanks for the reply.
    I have run it and it doesn't work. Use case is that we have a hierarchy viewer and I want to just truncate the long names of the Node Title.
    Here is my local deploy link
    http://rws65447fwks:7101/projectsManagement/faces/ResourceManagementDashboard
    All I want to do is truncate the Node Title and limit it to lets say 30 characters. So "Resources with No Pool Membership" becomes "Resources with No Pool Mem..."
    I tried to change in the jsff file and add the attribute called truncateAt and set it to 30, but as I said it says by underlying squiggly lines that the attribute is not supported.
    Please let me know against what team should I file a bug? or it has to bean SR?
    Thanks,
    Dhirendra

  • How can a TableView iterate over Rows and get Cells?

    I need to iterate over all the rows in a TableView without using Events. I would like to get the total number of rows, the TableRow, and a Cell from a specified TableColumn in the TableRow.
    Something like this:
    for(TableRow tableRow: tableView.getRows()){
        Cell cell = tableRow.getColumn(4).getCell();
        // do something to the cell
    }Is this possible?
    Edited by: Conzar on May 19, 2013 11:18 PM

    However, the problem with the CheckBox has been resolved so I don't need to iterate over the rows any longer.Yep, not using lookups to handle this is a much better solution, I just provided my lookup based solution because you asked for an iterative solution.
    The (lookup) code below doesn't produce any output.It works for me, I included an executable sample so you can try it out.
    My guess is that you aren't taking into account the fact that the lookup is just a snapshot of the table's cells at a moment in time.
    If you do a cell lookup before you show the table on a stage, it's not going to return anything because the cells are only generated on an as needed basis and there is no need to generate any cells before displaying the table on a stage.
    I get the following output on Java8b89 Win7:
    NumberedTableViewSample$2$1@344fe46[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@44187690[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@34618adc[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@61eb7609[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@50b006a1[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@307d4153[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@89b7483[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@70ce61fd[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@178969ad[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@e3149ea[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@3683d879[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@589e421f[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@7e26215b[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@69d59720[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@1ad26ff1[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@32b058e4[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@582e254[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@261c4ebd[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@2cb9cfb[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@63c6fe00[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@16a98443[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@58247401[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@34dc3da4[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@78a62ea[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@29e0032e[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@1781c971[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@18b2e479[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@4801295b[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@19e4c622[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@6a766d41[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@572aed5d[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@3bdf71a4[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@524c48c7[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@47b5a3ea[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@6ef8b38b[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@7fd2ee72[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@4994195c[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@49620450[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@246d8751[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@17e90472[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@def00[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@d1aa50a[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@2a7a58ba[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@2675cbd1[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@1c06ee08[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@1685718d[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@6ba1936c[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@61ef15e5[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@6b2ace30[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@3c4d17c7[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@1c3c9aad[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@27eadfe[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@3f83a064[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@579615f1[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@52a9271b[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@1d221557[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@18947d9e[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@537eab32[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@687cc257[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@3d524978[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@44554375[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@22f89594[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@1f891aaf[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@bafcb2f[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@7ddeea8c[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@26023325[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@4b14700f[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@89eb58[styleClass=cell indexed-cell table-cell table-column]
    NumberedTableViewSample$2$1@6a55a4a6[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@7d95454d[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@375592eb[styleClass=cell indexed-cell table-cell table-column]
    TableColumn$1$1@7add3f35[styleClass=cell indexed-cell table-cell table-column]TestApp:
    import javafx.application.Application;
    import javafx.beans.property.ReadOnlyObjectWrapper;
    import javafx.beans.property.SimpleStringProperty;
    import javafx.beans.value.ObservableValue;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.geometry.Insets;
    import javafx.scene.Group;
    import javafx.scene.Node;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.control.TableCell;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableColumn.CellDataFeatures;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.layout.VBox;
    import javafx.scene.text.Font;
    import javafx.stage.Stage;
    import javafx.util.Callback;
    public class NumberedTableViewSample extends Application {
        private TableView<Person> table = new TableView<>();
        private final ObservableList<Person> data =
            FXCollections.observableArrayList(
                new Person("Jacob", "Smith", "[email protected]"),
                new Person("Isabella", "Johnson", "[email protected]"),
                new Person("Ethan", "Williams", "[email protected]"),
                new Person("Emma", "Jones", "[email protected]"),
                new Person("Michael", "Brown", "[email protected]")
        public static void main(String[] args) {
            launch(args);
        @Override
        public void start(Stage stage) {
            Scene scene = new Scene(new Group());
            stage.setTitle("Table View Sample");
            stage.setWidth(470);
            stage.setHeight(500);
            final Label label = new Label("Address Book");
            label.setFont(new Font("Arial", 20));
            table.setEditable(true);
            TableColumn numberCol = new TableColumn("#");
            numberCol.setMinWidth(20);
            numberCol.setCellValueFactory(new Callback<CellDataFeatures<Person, Person>, ObservableValue<Person>>() {
              @Override public ObservableValue<Person> call(CellDataFeatures<Person, Person> p) {
                return new ReadOnlyObjectWrapper(p.getValue());
            numberCol.setCellFactory(new Callback<TableColumn<Person, Person>, TableCell<Person, Person>>() {
              @Override public TableCell<Person, Person> call(TableColumn<Person, Person> param) {
                return new TableCell<Person, Person>() {
                    @Override protected void updateItem(Person item, boolean empty) {
                        super.updateItem(item, empty);
                        if (this.getTableRow() != null && item != null) {
                          setText(this.getTableRow().getIndex()+"");
                        } else {
                          setText(null);
            numberCol.setSortable(false);
            TableColumn firstNameCol = new TableColumn("First Name");
            firstNameCol.setMinWidth(100);
            firstNameCol.setCellValueFactory(
                    new PropertyValueFactory<Person, String>("firstName"));
            TableColumn lastNameCol = new TableColumn("Last Name");
            lastNameCol.setMinWidth(100);
            lastNameCol.setCellValueFactory(
                    new PropertyValueFactory<Person, String>("lastName"));
            TableColumn emailCol = new TableColumn("Email");
            emailCol.setMinWidth(200);
            emailCol.setCellValueFactory(
                    new PropertyValueFactory<Person, String>("email"));
            table.setItems(data);
            table.getColumns().addAll(numberCol, firstNameCol, lastNameCol, emailCol);
            final VBox vbox = new VBox();
            vbox.setSpacing(5);
            vbox.setPadding(new Insets(10, 0, 0, 10));
            vbox.getChildren().addAll(label, table);
            // this lookup set won't print anything as no cells have been generated.
            for (Node r: table.lookupAll(".table-row-cell")){
                for (Node c: r.lookupAll(".table-cell")){
                    System.out.println(c);
            ((Group) scene.getRoot()).getChildren().addAll(vbox);
            stage.setScene(scene);
            stage.show();
            // now the table has been initially rendered and it's initial set of cells generated,
            // the cells can be looked up.
            for (Node r: table.lookupAll(".table-row-cell")){
                for (Node c: r.lookupAll(".table-cell")){
                    System.out.println(c);
        public static class Person {
            private final SimpleStringProperty firstName;
            private final SimpleStringProperty lastName;
            private final SimpleStringProperty email;
            private Person(String fName, String lName, String email) {
                this.firstName = new SimpleStringProperty(fName);
                this.lastName = new SimpleStringProperty(lName);
                this.email = new SimpleStringProperty(email);
            public String getFirstName() {
                return firstName.get();
            public void setFirstName(String fName) {
                firstName.set(fName);
            public String getLastName() {
                return lastName.get();
            public void setLastName(String fName) {
                lastName.set(fName);
            public String getEmail() {
                return email.get();
            public void setEmail(String fName) {
                email.set(fName);
    }

  • I have a Text control string box with some initial text. I would like to highlight old text with click of mouse and type in new data from keyboard

    I have a text control string box with some initial text (says: Please enter Name). I would like the operator to click on the text control box and have it automatically highlight so that when new data is typed in the old erases (all at once) and the new data is now in the text box.
    I tried using the "Text.Selection" property node and when I run it and put the mouse inside the text box the initial text is highlighted and if I press "delete" on the keyboard or if I start to type in new data the initial data does delete but once I start to type new characters they erase each other. For example if I want to type in “Willi
    am” I type the “W” and then the “I” but the “I” erases the “W” and now I am only left with an “I” in the text box and so on. I appreciate any help

    It seems you are continuously setting the property node over and over again. This should only happen once if you mouse over it.
    Create a property node for your text control with the following three items:
    (1) KeyFocus (wire a "true" constant to it)
    (2) Text.SelStart (Wire a "zero" constant to it)
    (3) Text.SelEnd (Wire a constant containing the string length of the text).
    Put this property node inside an event structure, triggered by "Mouse enter" on the string control.
    (see if the attached example works for you)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Enter_Name.vi ‏23 KB

  • JSF How to iterate over the list of a panelForm's child elements.

    Hi all
    My users have asked me to create a "clear all" button that initializes all input values of a search form's fields to null.
    To do this I created a managed bean and added the following code
    public String ClearFieldsBtn_action()
    String[] fieldIDs = {
    "Material",
    "Description",
    "Length",
    "Width",
    "Thickness",
    for (int i = 0; i < fieldIDs.length; i++ )
    try {       
    AttributeBinding attr = (AttributeBinding)getBindings().getControlBinding(fieldIDs);
    attr.setInputValue( null);
    } catch (Exception e) {
    System.out.println(e.toString());
    return null;
    I wonder if there any other more elegant way to iterate over the fields contained inside the JSF panelForm that contains all these "Material", "Description", etc fields and thus be able to easily transport the same functionality in more that one page?
    Thanks in advance
    Thanassis

    Thanassis,
    I use some code like this (where "target" is a variable in the managed bean representing the parent component - the panelForm in your case):
        List children;
        int  i, cnt;
        children = target.getChildren();
        cnt = target.getChildCount();
        for (i=0; i< cnt; i++)
          // do whatever you need here, such as clearing fields
        }This doesn't operate on the model, just on the UI components themselves. I do use something like this in a superclass backing bean for when I need to iterate over a bunch of UI components.
    John

  • How do I place a transparent image over specific, centered text?

    I'm helping someone with a site that flows sales copy down the center of the browser window. We want to take a transparent oval and place it over a price that will be in the copy. (It would look like someone took a marker and circled the price.)
    I had learned that AP Div could solve this problem and, to an extent, it does. I can place the oval right over the price. But it only works when the copy is left justified, not centered. If the copy is centered, I can place the oval, but if the browser window is resized, the oval stays in place while the copy is reflowed to the new browser window size. Thus the oval is no longer over the correct text.
    Then I learned that Layout Mode might solve this problem, however that has been removed from CS4.
    So now my question is how do I to take a transparent .png file and place it over copy on this site so that if the browser window is resized, the .png file stays with the correct text as the text is "moved" to stay in the center of the brower window?
    I want to avoid the workaround of simply creating a .png with the oval and the price and inserting that in the middle of the copy at the appropriate place. There must be a better way to handle this. Not being too familiar with Dreamweaver, maybe there's some sort of Anchor function similar to one in InDesign that solves this issue.
    I've attached the simple oval .png file we're trying to use for this.
    Thanks in advance for any help.

    How about having the circle underneath the text? I know it's a compromise, but it will be much easier to do as you can assign a background image to the div or table cell which holds the text.
    For example, make a blank graphic and create a class:
    .price
        background-image: url(nocircle.png);
    then assign it to the text and give each text div a unique name
    <div class="price" id="price1">10.99</div>
    then you can turn the background image on and off using Dreamweaver's javascript controls, for example:
    onclick="MM_changeProp('price1','','background-image','url(circle.png)','DIV');"
    Hope that helps.
    Peter

  • Mousing over some UI elements doesn't always display the correct pointer

    When I mouse over some elements in a UI, sometimes the mouse cursor isn't correct. For example, when typing this message, if I open up 'Launchpad' by using the gesture, my mouse cursor stays as the text cursor, not the mouse pointer arrow, as I would expect.
    This is only one example.. i've noticed it happens in many other instances.

    My problem seems to be solved.  My Norton Internet Protection software notified me that the Photoshop Auto Analyzer was using a lot of CPU and memory.  I shut off all Media Analysis in PSE-11, and I have not had any of the problems I mentioned in my posted question.
    I am surprised that my PC chokes up and causes errors when Media Analysis is on.  Has anyone seen this before?

  • Problem of diappeared output text as soon as page refreshes

    Hi all,
    I have jspx page with following code
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:trh="http://myfaces.apache.org/trinidad/html"
              xmlns:tr="http://myfaces.apache.org/trinidad"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <af:document>
          <af:form>
          <af:inputText label="Input some text" id="input" clientComponent="true"/>
          <af:commandButton text="Say Hello">
    <af:clientListener method="sayHello" type="action" />
    </af:commandButton>
    <af:outputText id="greeting" value="" clientComponent="true"/>
    <trh:script>
    function sayHello(actionEvent)
    var component=actionEvent.getSource();
    //Find the client component for the "greeting" af:outputText
    var greetingComponent=component.findComponent("greeting");
    //Set the value for the outputText component
    greetingComponent.setValue("Hello World !");
    </trh:script>
    </af:form>
        </af:document>
      </f:view>
      <!--oracle-jdev-comment:deviceCategory:pda-->
    </jsp:root>When I run this page in output I get an InputText box and a command button "Say Hello" . When I click on the button it shows message "Hello World" for a while and then page gets refreshes and "Hello World" message disappears.
    Is it possible to retain that message? Is it possible to display that message without clicking command button ? How it can be done - Please tell ?
    Thanks !

    Hey branislav,
    Thanks a lot. I figured out problem in my code after looking at your code.
    Now my following modified code is working fine. Problem was I need not to include input text and command button components in <af:form> tag. Only output text need to included in <af:form> tag.
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:trh="http://myfaces.apache.org/trinidad/html"
              xmlns:tr="http://myfaces.apache.org/trinidad"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <af:document>
          <af:inputText label="Input some text" id="input" clientComponent="true"/>
          <af:commandButton text="Say Hello">
            <af:clientListener method="sayHello" type="action"/>
          </af:commandButton>
          <af:form>
            <af:outputText id="greeting" value="" clientComponent="true"/>
          </af:form>
    <trh:script>
    function sayHello(actionEvent) {
         var  component=actionEvent.getSource(); //Find the client component for the "greeting" af:outputText var
          greetingComponent=component.findComponent("greeting"); //Set the value for the outputText component
          greetingComponent.setValue("Hello World !");
    </trh:script>
        </af:document>
      </f:view>
      <!--oracle-jdev-comment:deviceCategory:pda-->
    </jsp:root>Thanks !

  • Issue using JS to change the value of an output text component dynamically

    I am developing an application and I need to change the output text component value at run time when the mouse moves over a field. I am using javascript and then using UIComponent.setproperty to change the value.
    I am not able to do this and am getting nothing.
    Kindly let me know what am I doing wrong
    I am using ADF 11g (10th November release).
    Regards,
    Deepak

    Hi i'm doing the same thing with an input text
    here is my code
    jspx:
    <af:inputText value="#{bindings.MiddleName.inputValue}"
    label="#{bindings.MiddleName.hints.label}"
    required="#{bindings.MiddleName.hints.mandatory}"
    columns="#{bindings.MiddleName.hints.displayWidth}"
    maximumLength="#{bindings.MiddleName.hints.precision}"
    shortDesc="#{bindings.MiddleName.hints.tooltip}"
    id="it4" autoSubmit="true">
    <f:validator binding="#{bindings.MiddleName.validator}"/>
    <af:clientListener type="valueChange" method="mo_UpperCase"/>
    </af:inputText>
    js:
    function mo_UpperCase(event){
    var inputField = event.getSource();
    if (event.getNewValue().toUpperCase()!=event.getNewValue())
    inputField.setValue(event.getNewValue().toUpperCase());
    In my case i change the input text to upercase when the value is changing
    I hope it works with output text also,
    change my examples clientlistener type from valueChange to mouseOver
    If you have more than one component and you need to pass parameters check this thread also:
    bug at af:clientAttribute 11.1.1.2.0
    Tilemahos

  • How to add output text programmatically??

    Hi Team,
    Jdev Version - 11.1.1.6.0
    I have a requirement like-
    I want to add output text on click of button mean programmatically. Everytime i click on button output text get add above previous output Text.
    Just like in blogs user share their comments and once click on share it gets add in list above previous comment.
    I have pop up and once i fill fields in popup and click on OK button of pop up, comment will add in list.
    Could you please help me how i can add output text on click of button one above one.
    Thanks in Advance.
    Thanks & Regards,
    Ramit Mathur

    1) Use a Collection to hold the comments. It could be in-memory (List<String>) or backed by DB (using a ViewObject) depending on your use-case. On every comment submission add the comment to the collection object.
    2) In the page, iterate through the collection using af:iterator and include the output text within the iterator.

  • Debugger output text is centered

    In Coldfusion 9, when I enable "Enable Request Debugging Output" in the administrator settings, the debugging text on my site pages is centered from  "Scope Variables" to the end of the output. One of the fields is so wide that I have to scroll right just to see the centered text.
    I can't find a setting to control the output text to make it a more readable left-aligned. I've been working on a CSS hack to control the styles. But I've only figured out how to do it within the code of each cf template. Has anyone figured how to fix this poorly designed text?
    Thanks!

    Usually this is more a reflection of a problem in the HTML that your own code is generating. Consider that the debugging output is merely HTML at the bottom of the HTML your own page generated. CF sticks a bunch of closing tags into the stream between the two, hoping to “close” any tags you may have left open, but it’s just guessing. You may (indeed, it seems you must) have one open (either a
    tag, or one that sets centering, like
    , or perhaps it’s even some CSS controlling things. 
    But to answer your question, no, there is no feature to control this.
    I would recommend you run your code against an html validator, like http://validator.w3.org/, to find out what is perhaps “broken” about your HTML.
    Hope that helps.
    /charlie

  • Flahing output text

    Hi All,
    i have an adf page that i am displaying status's on they are retrived from a database table...
    i just wanted to know if it was possible to have these status's displayed (currently as output text) with some sort of flashing java script around them...
    is the best way to create some gif files and have them displayed instead of the output text...
    i am using jdeveloper 10.1.3 and oracle 10g...
    any help would be really be appriciated...
    thanks

    Hi,
    you can always add JavaScript on the page, set clientComponent="true" on the output text, find a component handle on the page and do the flashing thing. However, I think that using animated gif is more robust, less error prone and easier to implement
    Frank

  • Table Output text tool tip does not update on PPR

    We have a adf table with a Lov and a out put text .
    On changing the LOV, the out put text also change . but, on we mouse over on the tool tip does not changed . any suggestions ?
    below code :
    <af:outputText value="#{row.PlanTitle}" id="ot4" partialTriggers="soc3 si2"/>
    However , if we refresh the table or reload after save , the toop tip also get change . but we need to update the tool tip on change the lov . any suggestion ?
    Jdev : 11.1.1.3.0
    browser : all ,

    Hi,
    taking it from:
    +"However , if we refresh the table or reload after save , the toop tip also get change . but we need to update the tool tip on change the lov . any suggestion ? "+
    The autput text component is part of a table ? If so then the table needs to be refreshed as the values in there are stamped. If I am wrong with my table assumption and the output text is part of a form, try setting clientComponent="true" for the output text field
    Frank

Maybe you are looking for

  • DSC plantwide architecture

    I would like to get some opinions.  I am developing a large DSC application (LV 8.2 hopefully), that will utilize perhaps 20 different "process computers" running LV DSC, and logging the data back to a central "server" containing the Citadel database

  • Ace - rtcp

    Hi all, I am looking for a rtsp solution, and currently i cann't find an answer. The problem we got: We are using a ace to loadbalance streaming traffic, which uses rtsp/rtcp. rtsp is not a problem, simple vip on port 554 and forwarding to the server

  • Safari quit unexpectedly on Startup

    Today safari began to act a bit funny. When I open safari my home page loads but then after about 5 seconds safari quits unexpectedly. I don't think that anything has changed between last night and this morning with my computer but who knows nowadays

  • Cropping in CS6

    I'm used to correct aberrant lines before I cropped the picture in CS5. I used the short key: alt and clicked on one of the outer frames and I could "distort" the picture to remove the aberrant lines. I tried all short cuts in PS CS6, but I couldn't

  • How can i download adobe flash player on my Coby Kyros MID 1125

    Need to download flash player for Coby Kyros MID 1125