About popup hide

Question F
1.How dose JPopupMenu or JMenuItem hiden ,when click any where .
2.How dose JComboBox's dropdown hidden ,when click any where.
3.Question1,2 is one answer?
I tried to read JComponent ,Popup ,PopupFactory ,JPopupMenu,JCombox and others source code,but in few day I can't find the way .Please help me and give directions B
JTextField editing ,dropdown a JPopupMenu contain maybe input words,but focus lost,can't still edit JTextField;
Edited by: tlw_ray on Oct 22, 2008 11:40 PM

Thans for you camickr .
My question is I dosen't know the theory , how swing manage popup item hiden;
I want a JTextField ,when I input word,it can drop down a popup assistant help me auto complete.
First I use PopupFactory to implement the function,but finally I notice that I can't hide the popup in an evnent.
Then I think maybe use somethin like menu can implement the function.So I use JPopupMenu ,but when it popup,the JTextField's focuse lose,I can't input still.then when JPopupMenu shown I set jTextField to requestFocuse().That's all .My problem resolved.But I still dose't know how the JPopupMenu hiden ,when click any where but the menu.And I tried use JWindow ,but it dosen't catch the deActive window event.
I hope can understand how swing manager popup show or hiden,maybe intro some article or indicate some code block can help me .I like java for he tell me what he do when a program running,
Utility Class:
import java.awt.Component;
import javax.swing.JFrame;
Author:唐力伟
E-Mail:[email protected]
Date:2008-10-22
Description:
public class Shower {
     public static void show(Component comp,int width,int height){
          JFrame f=new JFrame();
          f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          f.setSize(width, height);
          f.setLocationRelativeTo(null);
          f.add(comp,"Center");
          f.setVisible(true);
     public static void show(Component comp){
          show(comp,400,300);
}Here is my exmaple code:
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Window;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JTextField;
import javax.swing.JWindow;
import javax.swing.Popup;
import javax.swing.PopupFactory;
import tlw.example.Shower;
Author:tlw_ray
E-Mail:[email protected]
Date:2008-10-23
Description:input assistant
public class JTextFieldKindsOfPopup extends JPanel{
     private static final long serialVersionUID = 1L;
     public static void main(String[] args) {
          JTextFieldKindsOfPopup wp=new JTextFieldKindsOfPopup();
          Shower.show(wp);
     JTextField jtfWindowPopuup=new JTextField("Edit for Popup JWindow",20);
     JTextField jtfMenuPopup=new JTextField("Edit for Popup JPopupMenu",20);
     JTextField jtfPopup=new JTextField("Edit for PopupFactory Popup",20);
     Window popupWindow=new JWindow();
     JPopupMenu popupMenu=new JPopupMenu();
     Popup popup;
     JPanel popupPane=new JPanel();
     public JTextFieldKindsOfPopup(){
          add(jtfWindowPopuup,"North");
          add(jtfMenuPopup,"South");
          add(jtfPopup,"Center");
          //popup window
          popupWindow.setPreferredSize(new Dimension(300,300));
          popupWindow.setBackground(Color.red);
          popupWindow.setBounds(20, 20, 100, 100);
          popupWindow.setAlwaysOnTop(true);
          popupWindow.addWindowListener(new WindowListener());
          jtfWindowPopuup.addKeyListener(new KeyAdapter(){
               public void keyPressed(KeyEvent e){
                    popupWindow.setVisible(true);
                    //JWindow dosen't catch windowDeactivated event;
          //popup menu
          JMenuItem menuItem1=new JMenuItem("Item1");
          JMenuItem menuItem2=new JMenuItem("Item2");
          JMenuItem menuItem3=new JMenuItem("Item3");
          popupMenu.add(menuItem1);
          popupMenu.add(menuItem2);
          popupMenu.add(menuItem3);
          jtfMenuPopup.addKeyListener(new KeyAdapter(){
               public void keyPressed(KeyEvent e){
                    popupMenu.show(jtfMenuPopup, 0, jtfMenuPopup.getHeight());
                    jtfMenuPopup.requestFocus();
                    //this way can resolve,input assistant
          //popup factory
          popupPane.setBackground(Color.blue);
          popupPane.setPreferredSize(new Dimension(100,100));
          jtfPopup.addKeyListener(new KeyAdapter(){
               public void keyPressed(KeyEvent e){
                    popup=PopupFactory.getSharedInstance().getPopup(JTextFieldKindsOfPopup.this, popupPane, 100, 100);
                    popup.show();
                    //what event can i set the popup hide()?
                    //maybe popupFactory dosen't use for this ,it just use to Tooltip.
     class WindowListener extends WindowAdapter{
          @Override
          public void windowDeactivated(WindowEvent e) {
               popupWindow.setVisible(false);
}Here is my function code
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.text.Collator;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import java.util.Vector;
import javax.swing.JCheckBox;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JSpinner;
import javax.swing.JTextField;
import javax.swing.SpinnerNumberModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
Author:tlw
E-Mail:[email protected]
Date:2008-10-23
Description:
public class MSearch1 extends JPanel {
     private static final long serialVersionUID = 1L;
     public static void main(String[] args) {
          final MSearch1 ms=new MSearch1();
          ms.setItems(new String[]{"aaa","aab","aac","W3.UNIT1.E0003","W3.UNIT1.E0004","W3.UNIT1.E0005"});
          final JCheckBox jckDropDownMode=new JCheckBox("isDropDownMode");
          jckDropDownMode.setSelected(ms.getIsDropDown());
          jckDropDownMode.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent e){
                    ms.setIsDropDownModel(jckDropDownMode.isSelected());
          final JCheckBox jckFilterMode=new JCheckBox("isFilterMode");
          jckFilterMode.setSelected(ms.getIsFilterMode());
          jckFilterMode.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent e){
                    ms.setIsFilter(jckFilterMode.isSelected());
          final SpinnerNumberModel jspinModel=new SpinnerNumberModel(8,3,15,1);
          final JSpinner jspinnerRows=new JSpinner(jspinModel);
          jspinnerRows.setToolTipText("drop down item count.");
          jspinnerRows.addChangeListener(new ChangeListener(){
               public void stateChanged(ChangeEvent e) {
                    int rowCount=jspinModel.getNumber().intValue();
                    ms.setRows(rowCount);
          JPanel paneLeft=new JPanel();
          paneLeft.setLayout(new GridLayout(3,1));
          paneLeft.add(jckDropDownMode);
          paneLeft.add(jckFilterMode);
          paneLeft.add(jspinnerRows);
          JPanel pane=new JPanel();
          pane.setLayout(new BorderLayout());
          pane.add(ms,"Center");
          pane.add(paneLeft,"West");
          Shower.show(pane);
     /*---------user interface element-----------*/
     private JTextField jtfInput=new JTextField();
     private JList jlistReservior=new JList();
     private JScrollPane jscroll4List=new JScrollPane(jlistReservior);
     private JPopupMenu jpopup4List=new JPopupMenu();
     /*---------self property--------------*/
     private boolean isDropDownMode=true;
     private boolean isFilterMode=true;
     private int rows=8;
     private String[] items;
     /*---------constructor--------------*/
     public MSearch1(){
          initUI();
          initEvent();
     private void initUI(){
          jtfInput.setColumns(20);
          //Dimension listSize=new Dimension(20*16,rows*25);
          //jscroll4List.setPreferredSize(listSize);
          setLayout(new BorderLayout());
          add(jtfInput,"North");
          dropModelRefresh();
     private void initEvent(){
          jtfInput.getDocument().addDocumentListener(inputChange);
          jtfInput.addKeyListener(inputKeyListener);
          jtfInput.addComponentListener(resizeListener);
          jlistReservior.addMouseMotionListener(mouseOverShow);
          jlistReservior.addMouseListener(clickSelect);
     //filter items who start with user input;
     private void doFilter(){
          String txt=jtfInput.getText().toLowerCase();
          if(isFilterMode){
               if(items==null){
                    throw new RuntimeException("please use setItems() to initialize items for select¡£");
               List fileteredList=new Vector();//<String>
               for(int i=0;i<items.length;i++){
                    if(items.toLowerCase().startsWith(txt)){
                         fileteredList.add(items[i]);
               jlistReservior.setListData(fileteredList.toArray());
               jlistReservior.setSelectedIndex(0);
          }else{
               jlistReservior.setSelectedIndex(-1);
               for(int i=0;i<items.length;i++){
                    if(items[i].toLowerCase().startsWith(txt)){
                         jlistReservior.setSelectedValue(items[i], true);
                         return;
     private void refreshPopup(){
          if(isDropDownMode){
               if(jpopup4List==null){
                    jpopup4List=new JPopupMenu();
                    jpopup4List.add(jscroll4List);
               jpopup4List.show(jtfInput, jtfInput.getX(), jtfInput.getY()+jtfInput.getHeight());
               jtfInput.requestFocus();
     //listening user jtfInput change;
     private DocumentListener inputChange=new InputChange();
     class InputChange implements DocumentListener{
          public void changedUpdate(DocumentEvent e) {inputChanged();}
          public void insertUpdate(DocumentEvent e) {inputChanged();}
          public void removeUpdate(DocumentEvent e) {inputChanged();}
          private void inputChanged(){
               doFilter();
               refreshPopup();
     //listening user mouse double click jtfInput
     private DoubleClickDropDown clickDropDown=new DoubleClickDropDown();
     class DoubleClickDropDown extends MouseAdapter{
          public void mouseClicked(MouseEvent e){
               if(e.getButton()==MouseEvent.BUTTON1
                         && e.getClickCount()==2){
                    refreshPopup();
     //listening user click drop down list menu ,select item;
     private ClickSelect clickSelect=new ClickSelect();
     class ClickSelect extends MouseAdapter{
          public void mouseClicked(MouseEvent e){
               selectInDropDown();
     private void selectInDropDown(){
          jtfInput.setText(jlistReservior.getSelectedValue().toString());
          jpopup4List.setVisible(false);
     //listening user control key;
     private KeyListener inputKeyListener=new InputKeyListener();
     class InputKeyListener extends KeyAdapter{
          public void keyPressed(KeyEvent e){
               int selected=jlistReservior.getSelectedIndex();
               if(e.getKeyCode()==KeyEvent.VK_UP){
                    if(selected>0){
                         jlistReservior.setSelectedIndex(selected-1);
               }else if(e.getKeyCode()==KeyEvent.VK_DOWN){
                    if(selected<(jlistReservior.getModel().getSize()-1)){
                         jlistReservior.setSelectedIndex(selected+1);
               }else if(e.getKeyCode()==KeyEvent.VK_ENTER){
                    selectInDropDown();
     //listening list mouse over select
     private MouseMotionAdapter mouseOverShow=new MouseOverSelect();
     class MouseOverSelect extends MouseMotionAdapter{
          public void mouseMoved(MouseEvent e){
               int selected=jlistReservior.getSelectedIndex();
               int current=jlistReservior.locationToIndex(e.getPoint());
               if(selected!=current)
                    jlistReservior.setSelectedIndex(current);
     //listening when jtfInput resize
     private ComponentListener resizeListener=new ResizeListener();
     class ResizeListener extends ComponentAdapter{
          public void componentResized(ComponentEvent e){
               refreshSize();
     /*--------------weather drop down mode---------------------*/
     public boolean getIsDropDown(){
          return isDropDownMode;
     * É趨ÏÂÀģʽ£¬»ò¹Ì¶¨Ä£Ê½¡£É趨ºó×Ô¶¯Ë¢Ð½çÃæ¡£
     * @param dropDown true ±íʾÏÂÀģʽ£¬false ±íʾ¹Ì¶¨Ä£Ê½
     public void setIsDropDownModel(boolean dropDown){
          isDropDownMode=dropDown;
          dropModelRefresh();
          validate();
          repaint();
     private void dropModelRefresh(){
          if(isDropDownMode){
               remove(jscroll4List);
               jpopup4List.add(jscroll4List);
               jtfInput.addMouseListener(clickDropDown);
          }else{
               jpopup4List.remove(jscroll4List);
               add(jscroll4List,"Center");
               jtfInput.removeMouseListener(clickDropDown);
     /*--------------------drop down items-------------------------*/
     public void setItems(String[] strs){
          items=strs;
          refreshItems();
     public String[] getItems(){
          return items;
     private void refreshItems(){
          //if is filter mode ,items may be ordered;
          Comparator cmp = Collator.getInstance(Locale.getDefault());
          java.util.Arrays.sort(items, cmp);
          jlistReservior.setListData(items);
     /*---------------------weather filter mode------------------------*/
     public void setIsFilter(boolean isFilter){
          isFilterMode=isFilter;
          refreshItems();
     public boolean getIsFilterMode(){
          return isFilterMode;
     /*---------------------size property---------------------------------*/
     public int getRows(){
          return rows;
     public void setRows(int rowCount){
          rows=rowCount;
          refreshSize();
          validate();
          repaint();
     public int getColumns(){
          return jtfInput.getColumns();
     public void setColumns(int colCount){
          jtfInput.setColumns(colCount);
          validate();
          repaint();
     private void refreshSize(){
          Font font=jlistReservior.getFont();
          FontMetrics fm=jlistReservior.getFontMetrics(font);
          int height=fm.getHeight()*rows;
          //int height=jlistReservior.getFixedCellHeight()*rows;
          System.out.println(jlistReservior.getFixedCellHeight());
          Dimension size=new Dimension(jtfInput.getWidth(), height);
          jscroll4List.setPreferredSize(size);
     /*--------------------input text property-------------------*/
     public String getText(){
          return jtfInput.getText();
     public void setText(String text){
          jtfInput.setText(text);
Edited by: tlw_ray on Oct 23, 2008 10:56 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

Similar Messages

  • Popup.hide() leaves a blank rectangle on Panels! Help!

    Hi, I have a really annoying problem that I've been trying to get rid of for much too long:
    My program has a JFrame containing 5 JPanels. Whenever the user does something wrong, I pop up an error message using the following code:
    public void catchError(String input)
         errorLabel.setText(input);
         popup = p.getPopup(((Component)mainPanel), ((Component)errorPanel), mainPanel.getWidth()/2, mainPanel.getHeight()/2);
         popupIsVisible = true;
         popup.show();
    Where errorLabel, errorPanel and Popup have all been initialized at the outset.
    When the user clicks on the popup's "OK" button (in ErrorPanel) I do popup.hide().
    But there ends up being a blank gray rectangle where the popup was before I hid it! It overlaps 3 panels, and doing validate() or repaint() on them still leaves this annoying blank space "on top" of whatever they're drawing.
    This doesn't always occur, but it usually does.
    Thanks for your help - I really appreciate it!
    -Jakob

    I guess a call to SwingUtilities.invokeLater is needed, so the error event is handled and a moment later, on the awt thread the drawing of your popup occurs.

  • Popup.hide doesn't work

    Hi,
    i want to run a long-running procedure, showing popup while it's working.
    in my managed bean i invoke code which is called from command button
    private RichPopup p1
    public String cb1_action() {
    RichPopup.PopupHints ph = new RichPopup.PopupHints();
    ph.add(RichPopup.PopupHints.HintTypes.HINT_ALIGN, RichPopup.PopupHints.AlignTypes.ALIGN_AFTER_END);
    p2.show(ph);
    Object result = operationBinding.execute();
    p1.hide();
    So , wierdly, upon button pressed , i see table populating, then popup appears, and that's it, it never closes.
    what's wrong?
    Regards,
    AB

    first of all, the referenced page code is below: (maybe is missed something...)
    upon login, this page is stuck somewhere in the middle, is the status bar there is a message "Done, but with errors"
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document title="title" id="d1">
    <af:messages id="m1"/>
    <af:resource type="javascript">
    function enforcePreventUserInput(evt) {
    var popup = AdfPage.PAGE.findComponentByAbsoluteId('p1');
    if (popup != null) {
    AdfPage.PAGE.addBusyStateListener(popup, handleBusyState);
    evt.preventUserInput();
    function handleBusyState(evt) {
    var popup = AdfPage.PAGE.findComponentByAbsoluteId('p1');
    if (popup != null) {
    if (evt.isBusy()) {
    popup.show();
    else if(popup.isPopupVisible()) {
    popup.hide();
    AdfPage.PAGE.removeBusyStateListener(popup, handleBusyState);
    </af:resource>
    <af:form id="f1" styleClass="OraNav3Selected">
    <af:popup id="p1" binding="#{Report.p1}" contentDelivery="immediate" partialTriggers="t1">
    <af:dialog id="d2" type="none" title="Working ..." closeIconVisible="false">
    <af:panelGroupLayout id="pgl1" layout="vertical" halign="center">
    <af:image source="/images/oralogo_small.gif" id="i1"/>
    <af:image source="/images/animbar.gif" id="i2"/>
    <af:outputText value="... please wait" id="ot11"/>
    </af:panelGroupLayout>
    </af:dialog>
    </af:popup>
    <af:popup binding="#{Report.p2}" contentDelivery="immediate" id="p2">
    <af:outputText value="... please wait" id="ot12"/>
    </af:popup>
    <af:panelGroupLayout layout="scroll" styleClass="AFStretchWidth" id="pgl111">
    <af:panelGroupLayout id="pgl4" layout="horizontal" styleClass="AFStretchWidth">
    <af:image source="logo.png" partialTriggers="banklist" id="i3"/>
    <af:outputFormatted value="Отчет по заявкам" id="of1" inlineStyle="font-size:large;"/>
    </af:panelGroupLayout>
    <af:panelGroupLayout id="pgl3" layout="horizontal" inlineStyle="width:635px;" landmark="banner">
    <af:inputDate value="#{bindings.d1.inputValue}" label="date1"
    required="#{bindings.d1.hints.mandatory}" columns="12"
    shortDesc="#{bindings.d1.hints.tooltip}" id="id1">
    <f:validator binding="#{bindings.d1.validator}"/>
    <af:convertDateTime pattern="#{bindings.d1.format}"/>
    </af:inputDate>
    <af:inputDate value="#{bindings.d2.inputValue}" label="date2"
    required="#{bindings.d2.hints.mandatory}" columns="12"
    shortDesc="#{bindings.d2.hints.tooltip}" id="id2">
    <f:validator binding="#{bindings.d2.validator}"/>
    <af:convertDateTime pattern="#{bindings.d2.format}"/>
    </af:inputDate>
    </af:panelGroupLayout>
    <af:panelBorderLayout id="pbl1" inlineStyle="width:2000px; height:50px;">
    <f:facet name="start">
    <af:group id="g1">
    <af:panelGroupLayout layout="horizontal" id="pgl2">
    <!--af:commandButton text="Run" id="cb1" icon="/execute-2s.png"
    disabled="#{!bindings.executeVO.enabled}"
    actionListener="#{bindings.executeVO.execute}"
    partialTriggers="t1">
    <af:clientListener method="enforcePrevenUserInput" type="click"/>
    </af:commandButton-->
    <af:commandButton text="Export to Excel" id="cb2" icon="/excel-11s.PNG" blocking="true"
    binding="#{Report.cbExcel}" action="#{Report.cbExcel_action}">
    <af:exportCollectionActionListener type="excelHTML" exportedId="t1" filename="export.xls"/>
    </af:commandButton>
    </af:panelGroupLayout>
    <f:verbatim>
    </f:verbatim>
    </af:group>
    </f:facet>
    <f:facet name="bottom">
    <af:statusIndicator id="si23" shortDesc="Busy" binding="#{Report.statusInd3}"
    inlineStyle='background-image:url("/running.PNG");'/>
    </f:facet>
    <f:facet name="end"/>
    <af:commandButton text="Logout" icon="/logout-1s.PNG" id="cb4" action="#{Report.onLogoutButtonPressed}"
    blocking="true"/>
    </af:panelBorderLayout>
    <af:table value="#{bindings.scrOptyVO12.collectionModel}" var="row" rows="#{bindings.scrOptyVO12.rangeSize}"
    emptyText="#{bindings.scrOptyVO12.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.scrOptyVO12.rangeSize}" rowBandingInterval="0"
    filterModel="#{bindings.scrOptyVO11Query.queryDescriptor}"
    queryListener="#{bindings.scrOptyVO11Query.processQuery}" filterVisible="true" varStatus="vs"
    selectedRowKeys="#{bindings.scrOptyVO12.collectionModel.selectedRow}"
    selectionListener="#{bindings.scrOptyVO12.collectionModel.makeCurrent}" rowSelection="single"
    inlineStyle="height:715px;width:1255px" width="1255" columnStretching="multiple" id="t1">
    <af:column sortProperty="#{bindings.scrOptyVO12.hints.ProductName.name}" filterable="true" sortable="true"
    headerText="name" id="c15">
    <af:inputText value="#{row.bindings.ProductName.inputValue}"
    label="#{bindings.scrOptyVO12.hints.ProductName.label}"
    required="#{bindings.scrOptyVO12.hints.ProductName.mandatory}"
    columns="#{bindings.scrOptyVO12.hints.ProductName.displayWidth}"
    maximumLength="#{bindings.scrOptyVO12.hints.ProductName.precision}"
    shortDesc="#{bindings.scrOptyVO12.hints.ProductName.tooltip}" id="it1"/>
    </af:column>
    </af:table>
    </af:panelGroupLayout>
    </af:form>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:preferred-managed-bean-name:Report-->
    </jsp:root>

  • Javascript popup hides behind the Flex

    Hi,
    I am using a Flex in our asp.net application. When a popup
    open the it hides behind the flex. i used wmode transparent when
    load the flex but it is not properly running. But when i deploy my
    application in my local machine or local LAN then it is working. it
    also working in firefox but in case of IE 7 when i deploy the site
    in our server and accessing through internet the it is gone behind
    the flex,but in case of firefox it is running perferctly.
    Thanks

    This forum is for Flex 1.5, and is all but abandoned.
    Post your question in the Flex General discussion forum
    instead.
    Tracy

  • A Question about popup keyword in ABAP programming

    Hello Expert,
    When I write ABAP code like following statement,
    START-OF
    The system will popup a help window to suggest the relevant ABAP keyword. in this case, the popup keyword is START-OF-SELECTION.
    My question is, if the popup keyword is what i want, how can i select the popup keyword. I tried ''ENTER' key when the keyword popup, but it doesn't work.
    Can any expert tell me how to to set the hot key to select the popup keyword? Your help will greatly speed up my development.
    Thanks in advance,
    Best Regards, Yongbo.

    Hi Yongbo,
    Use Tab key instead of Enter. If you want to use Enter for code completion, check out [OSS note 1042863|https://service.sap.com/sap/support/notes/1042863|Note 1042863 - Inserting code hints using the ENTER key].
    Cheers, harald

  • Javascript/html question about popup window title

    I am displaying an uploaded pdf file using wpg_docload.download_file in a popup window (using javascript open).
    How can I change the title of this popup window.

    Thanks to Jes (John Scott at shellprompt.net) for a solution for my version of this problem; set the Content-Disposition in the HTTP header to indicate your required filename. Example:
    I have an 'On-Load - Before Header' process on the ApEx page I want to use 'host' my PDF document generator. The page is called from a popup JavaScript call, allowing us to rely on ApEx authorisation and authentication. The Source of this process looks like the following:
    declare
    myblob blob;
    begin
    -- Call procedure to gereate PDF document in a blob and pass it back
    myprocedure_to_generate_blob( in_parameter, in_parameter, myblob);
    owa_util.mime_header('application/pdf',false);
    htp.p('Content-Length: ;||dbms_lob.getlength(myblob));
    -- This line sets the filename (which could be dynamic)
    htp.p('Content-Disposition: attachment;filename=mypdffile.pdf');
    owa_util.http_header_close;
    wpg_docload.download_file(myblob);
    -- Stop Apex from trying to render more of the page (we've finished)
    htmldb_application.g_unrecoverable_error := true;
    end;

  • Error about Popup glossary in web version

    Thanks for your answer, Steve!
    My authorware piece can read and parsing xml file on web. So
    it can use the data on xml file.
    But there are some problems! In my piece I want to meaning of
    some words by using popup glossary in "showMe" folder of authorware
    programs. In standalone program, it worked well. But in web version
    starting htm file, there were "Authorware Web Player Error" message
    like this
    "Error downloading content file.
    File on server is missing or has wrong length:
    http://......./popup.txt"
    I add popup.txt file in the file tab. Is there any problem I
    don't know?
    thanks.

    Get the properties of the popup.txt file and note the byte
    filesize.
    Then open the published .aam file in notepad and see if the
    entry for
    popup.txt includes the same byte length. If not, that's the
    problem.
    Everytime you edit the popup.txt file so it's byte size
    changes, you'll
    have to be sure the .aam entry matches it...OR, just remove
    the byte
    entry from the .aam entirely.
    Erik
    JjanguFather wrote:
    > Thanks for your answer, Steve!
    >
    > My authorware piece can read and parsing xml file on
    web. So it can use the
    > data on xml file.
    >
    > But there are some problems! In my piece I want to
    meaning of some words by
    > using popup glossary in "showMe" folder of authorware
    programs. In standalone
    > program, it worked well. But in web version starting htm
    file, there were
    > "Authorware Web Player Error" message like this
    >
    > "Error downloading content file.
    > File on server is missing or has wrong length:
    http://......./popup.txt"
    >
    > I add popup.txt file in the file tab. Is there any
    problem I don't know?
    >
    > thanks.
    >
    Erik Lord
    http://www.capemedia.net
    Adobe Community Expert - Authorware
    http://www.adobe.com/communities/experts/
    http://www.awaretips.net -
    samples, tips, products, faqs, and links!
    *Search the A'ware newsgroup archives*
    http://groups.google.com/group/macromedia.authorware

  • ?? about popup window using javascript

    I am launching a popup window using the following script.
    locate.onRelease = function(){
    getURL("javascript:n_name=window.open('
    http://www.wesitename.com/webpage.cfm','name_name1','width=720,height=330,scrollbars=yes') ;void(0);");
    Right now all of my links load in the same popup window...
    but if that window isn't closed for (instance if it was minimized)
    by the user... and the user clicks another link for this popup...
    it stays behind the main page rather than coming to the front
    again..
    My question is... Is there anyway to assure that this browser
    window comes to the front when updated with a new click???
    Thank you in advance
    - Me

    chess4thestupid wrote:
    > I am launching a popup window using the following
    script.
    >
    > locate.onRelease = function(){
    >
    > getURL("javascript:n_name=window.open('
    http://www.wesitename.com/webpage.cfm','n
    >
    ame_name1','width=720,height=330,scrollbars=yes');void(0);");
    > }
    >
    > Right now all of my links load in the same popup
    window... but if that window
    > isn't closed for (instance if it was minimized) by the
    user... and the user
    > clicks another link for this popup... it stays behind
    the main page rather than
    > coming to the front again..
    >
    > My question is... Is there anyway to assure that this
    browser window comes to
    > the front when updated with a new click???
    >
    > Thank you in advance
    YOu could change the name_name1 for each link to name_2 name3
    and so on.
    By using same window name you load content into the same
    window, using new
    name makes automatically totally new request and new pop up.
    Regards
    Urami
    Happy New Year guys - all the best there is in the 2006
    <urami>
    http://www.Flashfugitive.com
    </urami>
    <web junk free>
    http://www.firefox.com
    </web junk free>

  • Perplexed about popups

    I have a form that I am working on and need to control a popup that is in a repeating subform.  Everything works great with one exception.  I have a popup that appears if the value of a calculated field is "High" another for "Low" and another for "Medium", again this popup works great, no problem. What I would like to do is have the popup appear only once for each of the values.  For example, if the "Low" popup has appeared once, I don't want it to appear again if another subforms value if "Low" and so forth. 
    This is the formula I am currently using.
    if ((Value1.rawValue == "Select") || (Value2.rawValue == "Select"))
    this.rawValue = null;
    else if ((Value1.rawValue == 1) && (Value.rawValue == 1))
    this.fontColor = "0,100,0";
    xfa.host.messageBox("Some text goes here", "User Notice", 3, 1);
    this.rawValue = "Low";
    else if ((Value1.rawValue == 1) && (Value2.rawValue == 2))
    this.fontColor = "255,128,0";
    xfa.host.messageBox("Some text goes here", "User Notice", 3, 1);
    this.rawValue = "Moderate";
    Anyone have any ideas on a way to accomplish this??
    Thanks,
    Eagle

    You could create a variable (in Form Properties) set to 0 and then when the pop-up box first appears set the variable to 1. Then in your  elseif statement add a && variable == 0. That way if they popup has already appeared it wont show again.

  • Question for Carl about Show/Hide Detail Rows

    Carl,
    In your example http://htmldb.oracle.com/pls/otn/f?p=11933:1:2549476012987299
    is there a way to modify the javascript code to include multiple variables being passed in, vs just the pID being passed in?
    How can I pass the additional variables below:
    function ShowHideDetailRow(pThis, pTable, pTR, pID,pID2, pID3){
    var l_Detail = 'detail' + pID; //how can I append pID2 and pID3 here?
    var l_NumCells = pTR.cells.length;
    if (pTR.rowIndex == pTable.rows.length - 1 ||
    pTable.rows[pTR.rowIndex+1].className != "detail")
    gURL = 'f?p=&APP_ID.:12:'+html_GetElement('pInstance').value+'::NO:RP:P12_SID:'+ pID;//how can I append pID2 and pID3 here?

    Hello,
    Sure just add the parameters in like you have shown javascript is very lenient when it comes to adding parameters.
    And as for the URL all you have to do is follow the APEX URL syntax.
    http://download-west.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28550/concept.htm#BEIFCDGF
    Carl

  • I need to hide a popup with custom buttons

    When they click the button I want t he popup to cancel. THe button invokes a background process. How do I achieve this?
    The button has the download listener on it.

    Hi,
    You can bind the popup to the managed bean who invokes the process:
    RichPopup popup;
    public RichPopup getPopup() {
      return popup;
    public void setPopup(RichPopup popup) {
      this.popup = popup;
    ...And then put this code in the action listener:
    public void invokeProcess(ActionEvent actionEvent) {
      popup.hide();
    }Hope this helps.
    AP

  • Cancel / Reset links in popup dialog

    Hi, I'm new to ADF 11g (using Jdeveloper 11.1.1.4.0) so this is probably an easy question. I have a popup dialog (using <af:popup>, <af:dialog>), and in the dialog, I want to have Cancel and Reset links. I know that if I set the type attribute of <af:dialog> to "cancel", I could get a Cancel button for free. But I want to have a Cancel link instead of a button so I have the type attribute of <af:dialog> set to "none" to not show any of the default buttons. How could I best implement a Cancel link as a commandLink or goLink? The documentation for <af:dialog> at http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_dialog.html says this about the cancel button behavior and I just want to have the same for my Cancel link:
    The ESC key, "cancel" button and close icon queues a client dialog event with a "cancel" outcome. Dialog events with a "cancel" outcome will not be sent to the server.
    Also, I want to have a Reset link in my dialog that just resets the form fields in the dialog. How would this be done? I saw that there's a <af:resetButton> component available, but this renders as a button and again I want to have a Reset link instead of a button.
    Thanks.

    Ok, this worked for me:
    <af:resource type="javascript">
    function closePopup(actionEvent) {
    var eventSource = actionEvent.getSource();
    var popup = eventSource.findComponent("p1"); // p1 is the id of my popup
    popup.hide();
    actionEvent.cancel();
    </af:resource>
    <af:commandLink text="Cancel" id="cl1" partialSubmit="true">
    <af:clientListener type="click" method="closePopup"/>
    </af:commandLink>
    Interestingly, I found that if I did not have partialSubmit="true" on the commandLink, then the popup would disappear on its own. I did not even have to have a clientListener on the commandLink. I guess this is due to the following mentioned at http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_dialog.html
    Using partial submit custom buttons is recommended because by default, a popup will not restore visibility after a full postback. The immediate parent (af:popup) controls this behavior. If the parent popup's autoCancel property is enabled, full submit commands will cause the popup dialog to auto-dismiss. When the autoCancel property is disabled, full submit commands will restore visibility on postback. See the af:popup tag documentation for more information on controlling aspects of auto-dismissal.
    Does anyone know what the difference between using popup.hide() and popup.cancel() would be in the above javascript? They seem to have the same effect. Also, do I really need to have actionEvent.cancel() in the above javascript? I have seen that in some other examples, but not really sure if it's really necessary as having it there or not there doesn't seem to make a difference either.

  • How to generate a popup window?

    i want to click on a link...in response of this a popup window opens and show the details...help me regarding this...

    can u please explain me in bit detail.I can try...
    About Popup
    A Popup is displaying a Component somewhere on (or outside) the screen. When you create a new Popup object you specify the coordinates of the Popup relative to another Component (this other Component could be null)
    How to use it
    You should create your own subclass of javax.swing.Popup to use a Popup, because the constructors are Protected. I have an example for you. Also have a look at the API or some of the links other people have listed.
    Example
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.event.*;
    public class PopupEx extends JFrame{
         private javax.swing.Popup pop; 
         private JLabel lab = new JLabel("text");      
         public static void main(String args[]){
              PopupEx f = new PopupEx();
         public PopupEx(){
              //setting the JLabel and placing it in the JFrame
              lab.setBackground(Color.red);
              lab.setOpaque(true);
              lab.setFont(new Font("Curier",Font.PLAIN,200));
              add(lab);
              pack(); //setting the size of the JFrame
              //popup
              pop = new Poppy(this, new JPanel(), 10, this.getWidth()/2) ;           
              pop.show(); //makes the Poppy show at the position (10, this.getWidth()/2) - relative to this
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              setVisible(true);
         public class Poppy extends Popup implements ActionListener{
              private JPanel pan;
              private JLabel mess = new JLabel("I love Java!");
              private JButton b   = new JButton("ok");
              //Constructor
              //Overrides the Popup(Component owner,Component contents,int x,int y)               
              public Poppy(Component owner, JPanel contents, int x, int y){
                   super(owner,contents,x,y);
                   pan = contents;
                   pan.setBackground(Color.yellow);
                   mess.setFont(new Font("Curier",Font.PLAIN,20));
                   pan.add(mess);
                   pan.add(b);
                   b.addActionListener(this);
              public void actionPerformed(ActionEvent e){
                   this.hide();
         }//end of Poppy
    }If you have questions, just ask!

  • How do i hide urls in the address bar

    hi can u tell me how to hide urls in the address bar or to encrypt it
    thanks

    Ok how do you do that without using a popupWhat popup?didn't you see watercolours post about popups? i think you need to reread the thread ....

  • How to invoke popup from managed bean

    Hi Can anyone give me idea for invoking a pop-up from method in the managed bean plz,
    Here my coding,
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" binding="#{backingBeanScope.backing_untitled5.d1}">
    <af:form id="f1" binding="#{backingBeanScope.backing_untitled5.f1}">
    <af:commandButton text="commandButton 2"
    binding="#{backingBeanScope.backing_untitled5.cb2}"
    id="cb2"
    action="#{backingBeanScope.backing_untitled5.cb2_action}"/>
    </af:form>
    <af:popup binding="#{backingBeanScope.backing_untitled5.p1}" id="p1">
    <af:panelWindow binding="#{backingBeanScope.backing_untitled5.pw1}"
    id="pw1"/>
    </af:popup>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_untitled5-->
    </jsp:root>
    Managed bean coding,
    import javax.faces.context.FacesContext;
    import oracle.adf.view.rich.component.rich.RichDocument;
    import oracle.adf.view.rich.component.rich.RichForm;
    import oracle.adf.view.rich.component.rich.RichPanelWindow;
    import oracle.adf.view.rich.component.rich.RichPopup;
    import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
    import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
    import org.apache.myfaces.trinidad.util.Service;
    public class Untitled5 {
    private RichForm f1;
    private RichDocument d1;
    private RichPopup p1;
    private RichPanelWindow pw1;
    private RichCommandButton cb2;
    public void setF1(RichForm f1) {
    this.f1 = f1;
    public RichForm getF1() {
    return f1;
    public void setD1(RichDocument d1) {
    this.d1 = d1;
    public RichDocument getD1() {
    return d1;
    public void setP1(RichPopup p1) {
    this.p1 = p1;
    public RichPopup getP1() {
    return p1;
    public void setPw1(RichPanelWindow pw1) {
    this.pw1 = pw1;
    public RichPanelWindow getPw1() {
    return pw1;
    public void setCb2(RichCommandButton cb2) {
    this.cb2 = cb2;
    public RichCommandButton getCb2() {
    return cb2;
    public String cb2_action() {      .
    FacesContext context = FacesContext.getCurrentInstance();
    ExtendedRenderKitService extRenderKitSrvc =
    Service.getRenderKitService(context, ExtendedRenderKitService.class);
    extRenderKitSrvc.addScript(context,"AdfPage.PAGE.findComponent('" + p1 + "').show();");
    return null;
    looking for ur reply
    Regards,
    Tom

    If you are using JDev 11.1.1.3, then in a managed bean method use the following to show or hide the popup:
    RichPopup.PopupHints hints = ...<set_the_hints>...;
    p1.show(hints);
    // or
    p1.hide();If you are using an older JDev 11g, then use the following:
       * Hides a popup.
       * @param popup Popup to be hidden.
      public static void hidePopup(RichPopup popup) {
        FacesContext context = FacesContext.getCurrentInstance();
        String popupId = popup.getClientId(context);
        StringBuilder script = new StringBuilder();
        script.append("var popup = AdfPage.PAGE.findComponent('").append(popupId).append("'); ")
              .append("if (popup.isPopupVisible()) { ")
              .append("popup.hide();}");
        ExtendedRenderKitService erks =
          Service.getService(context.getRenderKit(), ExtendedRenderKitService.class);
        erks.addScript(context, script.toString());
       * Shows a popup.
       * @param popup Popup to be shown
      public static void showPopup(RichPopup popup) {
        showPopup(popup, null);
       * Shows a popup alligned to the start of specified UI component.
       * @param popup Popup to be shown
       * @param component UI component to allign to
      public static void showPopup(RichPopup popup, UIComponent component) {
        FacesContext context = FacesContext.getCurrentInstance();
        String popupId = popup.getClientId(context);
        String alignId = (component==null) ? null : component.getClientId(context);
        StringBuilder script = new StringBuilder();
        script.append("var popup = AdfPage.PAGE.findComponent('").append(popupId).append("'); ")
              .append("if (!popup.isPopupVisible()) { ")
              .append("var hints = {}; ");
        if (alignId!=null) {
          script.append("hints[AdfRichPopup.HINT_ALIGN_ID] = '").append(alignId).append("'; ")
                .append("hints[AdfRichPopup.HINT_ALIGN] = AdfRichPopup.ALIGN_AFTER_START; ");
        script.append("popup.show(hints);}");
        ExtendedRenderKitService erks =
          Service.getService(context.getRenderKit(), ExtendedRenderKitService.class);
        erks.addScript(context, script.toString());
      }You can find these methods in the Steve Muench's utility class JSFUtils.
    Dimitar
    Edited by: Dimitar Dimitrov on Nov 15, 2010 2:59 PM

Maybe you are looking for