Creating button event
Hi there,
1) I have button and I want to create WhenClikMouse event occurs when click on it from the forms. I'm trying to create button event in PJC, ANYBODY can help?!,,
2) and where should I save the JavaBean class to call it successfuly from the forms (I'm working on oracle 9i and Jdeveloper 9.2).
Hi there,
1) I have button and I want to create WhenClikMouse
event occurs when click on it from the forms. I'm
trying to create button event in PJC, ANYBODY can
help?!,,
2) and where should I save the JavaBean class to call
it successfuly from the forms (I'm working on oracle
9i and Jdeveloper 9.2).Hi - I'd post this to the "Forms" forum on OTN since this is a question about Pluggable Java Components which are a specific (and mighty cool) feature of forms.
There's also some viewlets and documentation from the Forms section on OTN (http://otn.oracle.com/products/forms) and the how-to debug PJC technical note (http://otn.oracle.com/products/forms/htdocs/howto_debug_pjc.html).
-steve-
Similar Messages
-
How to Capture Button event on TrainBean navigation
Hi All
i m being required to capture a button event in train bean Navigation, i m doing customization in Iexpense Module,here in Create IExpenseReport i need to capture the events of Remove,Return etc.how is it possible any clue would be very helpful.
Thanx
Prataptry this..
if (GOTO_PARAM.equals(pageContext.getParameter(EVENT_PARAM))
"NavBar".equals(pageContext.getParameter(SOURCE_PARAM))
// This condition checks whether the event is raised from Navigation bar
// and Next or Back button in navigation bar is invoked.
int target = Integer.parseInt(pageContext.getParameter(VALUE_PARAM));
// We use the parameter "value" to tell use the number of
// the page the user wants to visit.
String targetPage;
switch(target)
case 1: targetPage = "/oracle/apps/dem/employee/webui/EmpDescPG"; break;
case 2: targetPage = "/oracle/apps/dem/employee/webui/EmpAssignPG"; break;
case 3: targetPage = "/oracle/apps/dem/employee/webui/EmpReviewPG"; break;
default: throw new OAException("ICX", "FWK_TBX_T_EMP_FLOW_ERROR");
HashMap pageParams = new HashMap(2);
pageParams.put("empStep", new Integer(target));
pageContext.setForwardURL("OA.jsp?page=" + targetPage,
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
pageParams,
true, // Retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO, // Do not display breadcrumbs
OAWebBeanConstants.IGNORE_MESSAGES);
--Prasanna -
I can no longer create an event on iCal by double clicking on a time or date, nor can I double click on an existing event! HELP!
The only way I have to create an event is by using the "+" button, which is very limiting!
I am running the latest version of Mac OS X and all the updates.
Anyone know how I could get a proper use of my iCal ?
ThanksHi,
If you list the steps you have taken to fix this it will help.
Have you tried using the File > New Event menu item?
Have you logged the user account out/ restarted the computer?
Have you tried un-syncing any accounts synced to Calendar?
Is there some change made to the computer that may have triggered this?
Best wishes
John M -
HT4528 how do I create an event in my calander that repeats the second thursday of every month
how do i create an event in my calander that repeats the second thursday of every month
This should get you started down the pathJust replace User data with your cluster and do the data integrity check in the value change event use a simple one button dialog to notify the user which values are out of compliance and disable and grey the OK button untill all conditions are met.
Jeff
Attachments:
Prompt(Date).vi 50 KB -
Where did access to button events on page 0 go?
Hello.
I have a simple menu system established for my applications where a select list item and a button are created on page 0.
If I choose to "Create a button in a region position" when I establish the button (let's call it "GO_MENU", I am given the option of choosing the button event for branches on the other pages in the Conditions for the branch under "When Button Pressed". So far so good.
However, if I choose "Create a button displayed among this region's items" when I establish the button, the button does not appear in the LOV for the "When Button Pressed" condition in the branches for any of the other application pages. What's magical about this choice that suppresses the availability of the button event from the other pages?
Thanks,
ViniVini,
For your branch,
use condition type: "Request = Expression 1"
expression 1 = P0_GO_MENU
Why it doesn't show your page item button in the LOV? Because it's not a standard button anymore...
I don't have other information... someone from the ApEx dev team should be able to give more technical explanation.
Louis-Guillaume
Homepage : http://www.insum.ca
Blog : http://insum-apex.blogspot.com -
Hi Everybody,
as my first experience in AS3 I'm bulding a photo multigallery. In that gallery I have some buttons, each one pointing to its respective set of images.
Each button is created with the for loop, that picks the information from a XML file. From this XML I get the text of the button, the position etc. What I did with some sucess. But there is a scary problem: I don't know how to make each button load the respective and unique set of images.
I've tryied several different methods, with no effect, to make each loop to give to each button an unique identity to load the respective set of images.
I imagine that the solution pass by the use of arrays. I wrote some code, and I guess that I'm almost there (but not sure). Here is my AS3 code until now:
// CREATE MENU CONTAINER //
var menuContainer:MovieClip = new MovieClip();
menuContainer.x=10;
menuContainer.y=300;
addChild(menuContainer);
// CREATE IMAGES CONTAINER //
var imagesContainer:MovieClip = new MovieClip();
imagesContainer.x=10;
imagesContainer.y=10;
addChild(imagesContainer);
//// LOAD XML ////
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, whenLoaded);
xmlLoader.load(new URLRequest("XML/roiaXML.xml"));
var xml:XML;
function whenLoaded(evt:Event):void {
xml=new XML(evt.target.data);
var mySetsList:XMLList=xml.children();
//// MENU BUTTONS ////
// CREATE ARRAYS //
var totalArray:Array = new Array();
var setNodesArray:Array = new Array();
var setNamesArray:Array = new Array();
// POSITIONING BUTTONS INSIDE MENU CONTAINER//
var rowsQuantity:Number=3;
var columnsQuantity:Number=Math.ceil(mySetsList.length()/rowsQuantity);
var cellWidth:Number=160;
// CREATE BUTTONS //
for (var i:int=0; i< mySetsList.length(); i++) {
var newSetButtonMC:setButtonMC=new setButtonMC();
//what do I do here to make it works? To give each button created a unique id.
setNodesArray.push(i);
//trace(setNodesArray);
var imageNodesArray:Array = new Array();
for (var j:int=0; j<mySetsList[i].IMAGE.length(); j++) {
imageNodesArray.push(mySetsList[i].IMAGE[j].attribute("imageTitle"));
totalArray.push(imageNodesArray);
newSetButtonMC.setButtonText.text=mySetsList.attribute("galeriaTitle")[i];
newSetButtonMC.setButtonText.autoSize=TextFieldAutoSize.LEFT;
var cellX:Number=Math.floor(i/rowsQuantity);
var cellY:Number=i%rowsQuantity;
newSetButtonMC.x=cellX*cellWidth;
newSetButtonMC.y=cellY*(newSetButtonMC.height+10);
newSetButtonMC.addEventListener(MouseEvent.CLICK, onClick);
menuContainer.addChild(newSetButtonMC);
totalArray.push(setNodesArray);
//// MENU BUTTONS ACTIONS ////
function onClick(mevt:MouseEvent):void {
trace(totalArray [0][0]);
trace(totalArray [0][0]);
// in the line above I achieved some success loading a specific info from XML.
// but I don't know what to do with it.
//what do I do here? To make each button to load its own node from XML.
Here is my XML:
<GALERIA galeriaTitle="galeria 01">
<IMAGE imageTitle="imageTitle01">feio.jpg</IMAGE>
<IMAGE imageTitle="imageTitle02">muitofeio.jpg</IMAGE>
<IMAGE imageTitle="imageTitle03">aindamaisfeio.jpg</IMAGE>
</GALERIA>
<GALERIA galeriaTitle="galeria 02">
<IMAGE imageTitle="imageTitle01">estranho.jpg</IMAGE>
<IMAGE imageTitle="imageTitle02">maisestranho.jpg</IMAGE>
<IMAGE imageTitle="imageTitle03">aindamaisestranho.jpg</IMAGE>
</GALERIA>
Thanks everyone . ABSTRATOyou can assign each newSetButtonMC and ivar property that points to its i value or, even easier:
// CREATE MENU CONTAINER //
var menuContainer:MovieClip = new MovieClip();
menuContainer.x=10;
menuContainer.y=300;
addChild(menuContainer);
// CREATE IMAGES CONTAINER //
var imagesContainer:MovieClip = new MovieClip();
imagesContainer.x=10;
imagesContainer.y=10;
addChild(imagesContainer);
//// LOAD XML ////
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, whenLoaded);
xmlLoader.load(new URLRequest("XML/roiaXML.xml"));
var xml:XML;
function whenLoaded(evt:Event):void {
xml=new XML(evt.target.data);
var mySetsList:XMLList=xml.children();
//// MENU BUTTONS ////
// CREATE ARRAYS //
var totalArray:Array = new Array();
var setNodesArray:Array = new Array();
var setNamesArray:Array = new Array();
// POSITIONING BUTTONS INSIDE MENU CONTAINER//
var rowsQuantity:Number=3;
var columnsQuantity:Number=Math.ceil(mySetsList.length()/rowsQuantity);
var cellWidth:Number=160;
// CREATE BUTTONS //
for (var i:int=0; i< mySetsList.length(); i++) {
var newSetButtonMC:setButtonMC=new setButtonMC();
//what do I do here to make it works? To give each button created a unique id.
setNodesArray.push(i);
//trace(setNodesArray);
var imageNodesArray:Array = new Array();
for (var j:int=0; j<mySetsList[i].IMAGE.length(); j++) {
imageNodesArray.push(mySetsList[i].IMAGE[j].attribute("imageTitle"));
nextSetButtonMC.imageArray = imageNodesArray;
//totalArray.push(imageNodesArray);
newSetButtonMC.setButtonText.text=mySetsList.attribute("galeriaTitle")[i];
newSetButtonMC.setButtonText.autoSize=TextFieldAutoSize.LEFT;
var cellX:Number=Math.floor(i/rowsQuantity);
var cellY:Number=i%rowsQuantity;
newSetButtonMC.x=cellX*cellWidth;
newSetButtonMC.y=cellY*(newSetButtonMC.height+10);
newSetButtonMC.addEventListener(MouseEvent.CLICK, onClick);
menuContainer.addChild(newSetButtonMC);
totalArray.push(setNodesArray);
//// MENU BUTTONS ACTIONS ////
function onClick(mevt:MouseEvent):void {
var mc:setButtonMC=setButtonMC(mevt.currentTarget);
for(i=0;i<mc.imageArray.length;i++){
trace(mc.imageArray[i]);
Here is my XML:
<GALERIA galeriaTitle="galeria 01">
<IMAGE imageTitle="imageTitle01">feio.jpg</IMAGE>
<IMAGE imageTitle="imageTitle02">muitofeio.jpg</IMAGE>
<IMAGE imageTitle="imageTitle03">aindamaisfeio.jpg</IMAGE>
</GALERIA>
<GALERIA galeriaTitle="galeria 02">
<IMAGE imageTitle="imageTitle01">estranho.jpg</IMAGE>
<IMAGE imageTitle="imageTitle02">maisestranho.jpg</IMAGE>
<IMAGE imageTitle="imageTitle03">aindamaisestranho.jpg</IMAGE>
</GALERIA>
Thanks everyone . ABSTRATO -
Hi anybody,
I want to use click event button inside abap programe.
how to use click events of button.
anybody tell me.
thanks
s.muthuhiii
use following code.it will create button
START-OF-SELECTION.
SET PF-STATUS 'STATUS'.
PERFORM get_data_kna1.
END-OF-SELECTION.
Now write following code for performing task on clicking that button.
CASE sy-ucomm.
WHEN 'CUSTOMER'.
SELECT SINGLE kunnr
FROM kna1
INTO w_kna1
WHERE kunnr = w_kunnr.
IF sy-subrc <> 0.
MESSAGE e015(zmsg9).
ENDIF.
WHEN 'ORDER'.
SELECT SINGLE vbeln
FROM vbak
INTO w_vbak
WHERE vbeln = w_vbeln.
IF sy-subrc <> 0.
MESSAGE e015(zmsg9).
ENDIF.
ENDCASE.
reward if useful
thx
twinkal -
Scroll bars & creating buttons problem
I am trying to create a basic photo browser. The upper area is the enlarged view of the image. The lower portion is a scrollable view of the thumbnails in the directory chosen. I have most of it working...except that the scrollable view doesn't scroll, and the buttons that I created don't cause the image to show up in the main view port.
There is the main window, divided into two parts: upper and lower. The upper part is the main view, as described above. The lower part is a panel. That lower panel contains two things, another panel and a button. This panel inside the lower section contains the scrollable window; this scrollable window is a viewport onto another panel that contains the dynamically created buttons (which are thumbnails of the images in the directory).
I was trying to force the scrollbar policy to always show the horizontal bar (that is the only one I want visible) but that wasn't working either; I would get compiler errors when that was included. I have tried adjusting sizes of things, and the order that things are added to the main JFrame.
Any suggestions would be appreciated.
Here is the code:
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileFilter;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.border.EtchedBorder;
import javax.swing.filechooser.FileNameExtensionFilter;
* PhotoGUI Browse
* Description: Generate a GUI interface for viewing a large view of an image and previews of thumbnails
* in a directory. There are two parts to the GUI: large upper section for main viewing, and a short lower
* section for viewing the thumbnail previews. The lower section is also split into two parts: the left part
* is a scrollable pane where the thumbnails will be previewed, and then a small section to the right where
* a button for changing directories will be present. (I wanted the button to always be visible so didn't
* put it in the scrollable area.)
public class PhotoGUI extends JFrame {
final int SIZE = 75; //scaling size for images in thumbnail browser
boolean firstRunThrough = true; //Changes behavior of directory requester
private JPanel thumbs;
private JPanel pickNThumbs;
private ImagePanel bigView ;
private JScrollPane scroller;
private JButton pickDirButton;
private thumbSelectedListener thumbPicksNose;
public PhotoGUI () {
this.setDefaultCloseOperation (EXIT_ON_CLOSE);
this.setSize(600,600); //Starting size of the overall container.
this.setTitle("Eye Photo photo browser");
//The upper portion of the GUI, where the large view of the image will be held
bigView = new ImagePanel();
//bigView.setSize (600,500);
//The bottom section of the GUI; will hold the thumbnail previews
//(in a scrollable panel) and a button for changing directories.
pickNThumbs = new JPanel();
pickNThumbs.setBackground(Color.WHITE);
pickNThumbs.setSize(600,100);
pickDirButton = new JButton("Pick directory...");
//pickDirButton.setSize(75,150);
dirPickListener dirButton = new dirPickListener ();
pickDirButton.addActionListener(dirButton);
thumbs = new JPanel(); //The panel that will hold the thumbnail previews
scroller = new JScrollPane(thumbs); //Setting the scroll bar pane to view the thumbnail panel
//scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
//scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
// scroller.setSize(525,100);
scroller.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
pickNThumbs.add(scroller);
pickNThumbs.add(pickDirButton);
this.add(bigView);
this.add(pickNThumbs, BorderLayout.SOUTH);
String pickedDir = pickDir(); //Setting up the while loop so it will keep requesting
if (pickedDir.equals("-1")) {
if (firstRunThrough) System.exit(0); //End program if they don't pick a dir the first time through.
}else {
thumbsUp(pickedDir); //They picked good Dir; populate thumbnails
firstRunThrough = false;
public String pickDir () {
// This is the file chooser method.
JFileChooser dirPicker = new JFileChooser();
dirPicker.setDialogTitle("Pick a directory");
dirPicker.setApproveButtonText("Open directory");
dirPicker.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int x = dirPicker.showOpenDialog(getParent()); //maybe I don't need this?
if (x == JFileChooser.APPROVE_OPTION) {
return dirPicker.getSelectedFile().getAbsolutePath();
} else return "-1"; //Just to cover all possible conditions
public void thumbsUp (String chosenDir) {
// Thumb populater method. It adds each thumb-button to the scroller panel
thumbs.removeAll(); //Need to remove old directory's buttons
File selectedDir = new File(chosenDir);
FileNameExtensionFilter filter = new FileNameExtensionFilter("JPG/GIF/BMP/PNG Images", "bmp", "jpg", "jpeg", "gif", "png");
File [] dirEntries = selectedDir.listFiles();
for (File tempFile : dirEntries) {
if (filter.accept(tempFile) && tempFile.isFile()) { //That way I only get certain types
JButton howToNameMultipleButtons = new JButton();
howToNameMultipleButtons.setActionCommand(tempFile.getAbsolutePath());
// System.out.println(tempFile.getAbsolutePath());
// System.out.println(howToNameMultipleButtons.getActionCommand());
howToNameMultipleButtons.setIcon(new ScaledIcon(tempFile.getAbsolutePath(), SIZE));
howToNameMultipleButtons.addActionListener(thumbPicksNose);
thumbs.add(howToNameMultipleButtons);
this.setVisible(true); //Down here so first run through program opens Dialog before showing
public class dirPickListener implements ActionListener {
public void actionPerformed (ActionEvent ae) {
thumbsUp(pickDir()); //Opens Dir selection dialog and feeds the thumbnail populater
public class thumbSelectedListener implements ActionListener {
public void actionPerformed (ActionEvent ae) {
String thumbPicked = ae.getActionCommand(); //Should return path string of thumbButton clicked
// System.out.println(ae.getActionCommand()); //TSing step; to see if this bit even fires off.
bigView.setImage(thumbPicked);
bigView.setToolTipText(thumbPicked);
// bigView.setBackground(Color.GREEN);
}Ah! I got some of it figured out at least...
Setting the preferred size parameter has caused the scroll bars to display! :) Thanks for the hint on that.
But I get an error when I try and use the scrollbar policy settings. Here are the results:
Exception in thread "main" java.lang.IllegalArgumentException: invalid verticalScrollBarPolicy
at javax.swing.JScrollPane.setVerticalScrollBarPolicy(Unknown Source)
at javax.swing.JScrollPane.<init>(Unknown Source)
at PhotoGUI.<init>(PhotoGUI.java:70)
at PhotoBrowser.main(PhotoBrowser.java:15)And the code I used:
scroller = new JScrollPane(thumbs,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); //Setting the scroll bar pane to view the thumbnail panel
Edited by: Mole_Hunter on Feb 1, 2010 9:57 AM -
Htp.p doesn't work from the custom button event handler ...
Hi,
I am trying to pop up an alert from the custom button event handler. I created a button and put the following code.
htp.p('<script language='JavaScript1.3">
alert ("Test Message");
</script>;
But alter doesn't show up after clicking the button.
ThanksOK i've attached them and copy/pasted the relevent parts. The parent window is the SFLB file.
-----------------------------------------here's the code in the parent window
private function editServerPool():
void
serverPoolPUW = PopUpManager.createPopUp(
this,popups.ServerPoolPopup,true);PopUpManager.centerPopUp(serverPoolPUW
as IFlexDisplayObject);
if (newServerPool.SecondarySPAlgorithm != null){
serverPoolPUW.enableSSCheckBox.selected =true;serverPoolPUW.DisplaySecondaryServerPool();
serverPoolPUW.bigResize.play();// serverPoolPUW.height = 602; //yes...i know i need to move thisserverPoolPUW.switchoverPolicyCB.selectedItem = newServerPool.SwitchOverPolicy;
serverPoolPUW.switchoverThresholdTI.text = newServerPool.SwitchOverThreshold;
----------------------here's the code in teh popup window (popups.ServerPoolPopup.mxml)
<mx:Resize id = "bigResize" heightFrom="506" heightTo="602" target="{this}" />
<mx:Resize id = "littleResize" heightFrom="602" heightTo="506" target="{this}"/>
public function DisplaySecondaryServerPool():void{
//make the screen large if the secondary server checkbox is selected; otherwise small.
if (enableSSCheckBox.selected){
//display secondary server pool tab, expand the screen
//note that we cannot attach a data provider to the data grid until the grid creation is
//completed. This is done in an event handler.secondaryPanel.enabled =
true; switchoverPolicyCB.visible =
true;switchoverThresholdTI.visible =
true;thresholdFI.visible =
true;policyFI.visible =
true;bigResize.play();
else
<mx:CheckBox label="Enable a Secondary Server Pool" width="264" fontWeight="bold" click="DisplaySecondaryServerPool()" id="
enableSSCheckBox" fontSize="12" x="83" y="40"/> -
Execute procedure in pl/sql button event handler
i have a demo application which consists of text boxes
eg : when i enter department no in first text box and click proc
it should display dname and loc in the below text boxes.
my proc is working fine in sql*plus but its showing errors in pl/sql button event handler.
any ideas
my proc is create or replace procedure proc1 (no number)
as
DNAME1 dept.dname%type;
LOC1 dept.loc%type;
begin
select DNAME,LOC into DNAME1,LOC1 from scott.dept where deptno = no;
DBMS_OUTPUT.PUT_LINE (DNAME1);
DBMS_OUTPUT.PUT_LINE (LOC1);
Exception When No_Data_Found then
dbms_output.put_line('Entred name is not found');
When Others then
Null;
End;
/Hi,
you have to use
htp.p('<SCRIPT LANGUAGE="Javascript1.1">
document.all("FORMNAME.DEFAULT.ATTRIBUTENAME.01").value="'||DNAME1||'";
document.all("FORMNAME.DEFAULT.ATTRIBUTENAME.01").value="'||LOC1||'";
</SCRIPT>
instead of
DBMS_OUTPUT.PUT_LINE (DNAME1);
DBMS_OUTPUT.PUT_LINE (LOC1);
where formname is your form name and attribute name is the field name on the page. -
Handling button events for dialog boxes of a used component
Hello,
After I call a dialog box/window for the view of the used component, how can I handle the button events of the window that I called?
I create the window using the method CREATE_WINDOW_FOR_CMP_USAGE of the interface IF_WD_WINDOW_MANAGER. This method returns window reference of type IF_WD_WINDOW.
Thanks & Regards,
ReenaIt's very easy.
Have a look to the document: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9e242bf5-0901-0010-c99c-83c180163c73
You will find the SUBSCRIBE_TO_BUTTON_EVENT on page 6.
Sergio -
Hi all,
i am using a 'When-Validate-item' trigger in this i am doing a validation,
when user try to enter amount greater than the given amount(This is needed validation)
and also i am regenerating new lines(Creating new records when button pressed)
when i am regenerating i should not validate.
How to handle button event
Thnx
RajHi...
The WHEN-VALIDATE-ITEM Trigger fires once you updated a field. Be sure you raise
form_trigger_failure when amount is invalid. So, the cursor stays in field amount. You cant
leave this field until the amount is not valid. -
Handling button events in large app
I'm currently examining a large swing app, and have observed the following with regard to action events.
A number of listeners (for buttons, menu items, JLists etc.) are defined at the top of the app. These variously extend MouseAdapter or implement ActionListener, depending on the type of component whose actions they listen for.
The ButtonListener definition is as follows :
private class ButtonListener implements ActionListener
public void actionPerformed(ActionEvent event)
Object object = event.getSource();
if (object == button1)
// button1 actions
else
if (object == button2)
// button2 actions
.....etc
One instance of this listener is created in the app, and is used as the actionlistener for each button. This means that the buttonlistener is quite large (as it contains the code for each button in the app).
Is this the proper way to handle button events for an app with a large number of buttons?Thanks for the responses.
In response to theDude : I agree that defining the action listener for each button can be useful when you can see the button definition and button action in one place; one could counter that by saying that grouping all the button actions makes it easier to examine all button actions in one place.
Setting the action command isn't really an option because the application creates panels of buttons on the fly, e.g. when notification of a new customer is received, a new panel is created with a JTextPane (customer description) and a row of buttons for "Modify", "Delete" and "Print".
Several customer panels could be in existence at the same time, so setting an action command of "Modify" would not enable one to uniquely identify which "Modify" button was pressed.
This problem is currently handled by associating the panel instance with a "Customer" class instance in a hashtable. The "Customer" class consists of a JTextPane field, and a JButton for each function. When a button is pressed, the button listener traverses up the component's parents until it reaches the panel (i.e. it loops until the parent is a key on the hashtable, at which point it can retrieve the Customer instance and check which button was pressed).
In response to KPSeal : If I understand you, I would define "ApplicationAction" separately from the main app and define extensions of it in the main app for each type of action. Would this add much value over merely defining a method for each type of action in the main app and just calling this method when the relevant button/menu item was pressed/selected?
There doesn't seem to be a universal approach to event handling, but I thought there might have been one accepted strategy when an app has large numbers of buttons (some created on the fly, ruling out action commands). -
Is it possible to create a Event Reciver program as Sandbox solution? - SharePoint 2010
Dear All,
I try to create a Event receiver program as SandBox solution in SharePoint 2010. I want to do a list item updation using this event receiver.
Almost all the internet help & examples seems to be written with Farm solution and I got plenty of
errors in the code(since the code may be written for farm solutions).
So is it good idea that I am trying to do Sandbox Event Receiver???? Can any one please advice me
and if sandbox is feasible can anyone help me with a tutorial( How to create a sandbox event receiver for list item updation).
Somebody please help me soon.Dear All,
hen I run the project, I got this error
There were deployment errors? do you want to continue. I pressed No button but
I cannot see any error list below in visual studio 2010!!! I am not able to
identify where is the error or rectify those error, somebody please help me soon.
I try to create one event receiver for list updation. I selected Event Receiver template
while created new project and added following code for debugging, debugger is not hitting!!!
please note my code below. Am I missing anything?????
EventReceiver1.cs
using Microsoft.SharePoint.Security;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.Workflow;
namespace NewProjEventReceiver.EventReceiver1
/// <summary>
/// List Item Events
/// </summary>
public class EventReceiver1 : SPItemEventReceiver
static void Main(string[] args)
/// <summary>
/// An item is being added.
/// </summary>
public override void ItemAdding(SPItemEventProperties properties)
base.ItemAdding(properties);
/// <summary>
/// An item is being updated
/// </summary>
public override void ItemUpdating(SPItemEventProperties properties)
base.ItemUpdating(properties);
SPListItem CurrentItem = properties.ListItem;
String strCustomer = CurrentItem["SampleList"].ToString();
int startPos = 0;
int endPos = CurrentItem["SampleList"].ToString().IndexOf(";#");
int Cust_ID = Convert.ToInt32(strCustomer.Substring(startPos, endPos));
SPWeb oWeb = properties.Web;
SPList oList = oWeb.Lists["SampleList"];
SPListItem Customers = oList.GetItemById(First_ID);
CurrentItem["Title"] = "One Time";
oWeb.AllowUnsafeUpdates = true;
oWeb.Update();
oWeb.AllowUnsafeUpdates = false; -
Create Repeating Event in Calendar
I work rotating shifts and can’t figure out how to enter my schedule on my Touch with the current Calendar application.
With my palm-top computer I simply created events titled: Day1, Day2, Day3, Mid1, Mid2, & Mid3. Each of these events were created as repeating events — repeating daily every twelfth day. Then I created Off1, Off2, & Off3 as repeating events — repeating every 6th day.
Or another example would be Mother’s Day. It would be nice to be able to create an event that repeats monthly every 12mo (2nd Sunday of every 12th month).
Is there any way to do something similar that I’m overlooking?
Any assistance would be appreciated.
I'd also like to be able to synchronize with my Google calendar.I don't know that it can be turned off, and I don't even use Apple's Calendar much (as a BusyCal user), but you might find it's useful if you learn to use it as intended. That box is pretty smart if you mention the date and location in the box before hitting enter.
Just type the date, time, and place in that "title" box:
"Birthday party Friday 8:00 PM at Joe's Place"
That pops up an event with a start date of the next Friday (e.g., 10/05/2012 today in the US), start time of 8:00 PM, and "Joe's Place" in the location. It strips out the date and time before creating the event title that it pops up; it leaves the location in the title, but the title comes up selected so you can edit it before confirming the event with the "Done" button.
The event is entered in the default calendar, but you can select any calendar by holding down the "+" button a second or two. There may be a way to do it with the menu or the keyboard command-n shortcut, but I haven't found it; you can select another calendar on the popup before hitting the "Done" button.
Maybe you are looking for
-
Send ITAB contents to FTP Server in background
Hi All I am sending the contents of an internal table to FTP server using Function modules HTTP_SCRAMBLE, FTP_CONNECT, FTP_R3_TO_SERVER, FTP_DISCONNECT, RFC_CONNECTION_CLOSE in that sequence. The operation is successful when run in foreground, but
-
I am playing max go. I get sound but no picture
I am trying to play max go on apple tv. I get sound but no picture What do I need to adjust???
-
can an oracle application on 64 bit platform be migrated to another. say from HP-UX 11i to windows server 2003. what is the difference in scalability issues between HP-UX 11i on PA-RISC 8700 ( 8 cpu) v/s windows server 2003 (enterprise edition) on It
-
How to pass BI Query parameters from Function Module
Hi, We are executing the BI queries using the Function Module "RS_VC_GET_QUERY_VIEW_DATA_FLAT" by passing the query name and the provider information. Is there a way, to pass the filter parameter values also to the query by using this function module
-
Error in running sun portal server 7.2 on windows platform
I have downloaded portal-7.2-windows-x86.zip Extract it at C:\ Run C:\PS7.2\setup.bat Opened: http://localhost:8080/portal/dt The following error was displayed: type Exception report message description The server encountered an internal error () tha