Passing data from user exit to workflow.
HI,
Please consider the below scenario.
In the user exit 'MV50AFZ1' I have created an include in the form 'USEREXIT_SAVE_DOCUMENT_PREPARE.'.
In this include based on some certain conditions a workflow is triggered.
I am using the function module 'SWE_EVENT_CREATE' to trigger the workflow.
Now the requirement is to pass some data from this user exit ('USEREXIT_SAVE_DOCUMENT_PREPARE') into the workflow.
Could someone please explain me how to pass this data from the user exit into the workflow ?
Thanks in advance.
With regards
Abhishek
Hello everybody,
Thanks a lot for your responses.
I am using the fuction module 'SAP_WAPI_CREATE_EVENT' to trigger the workflow, I am also able to pass the delivery number through the paramater 'OBJECT_KEY' of the function module in to the workflow container.
But I am unable to pass the line item number and the material number into the workflow.
I am following the below process:
I have defined a stucture ZST_DELIVERY containing the POSNR and MATNR in the data dictionnary.
I have pouplated the internal table of this structure inside my user exit.
Then I m passing the values of the above internal table into another internal table - 'Container''which is of structure type 'SWR_CONT'.
And I am passing the internal table 'Container' into the paramater 'INPUT_CONTAINER' of the function module 'SAP_WAPI_CREATE_EVENT'.
And in the workflow I have created a container 'ST_DELIVERY' which is of the structure ZST_DELIVERY and I have made it 'import', 'export.'
And in my business object ZLIKP in the custom event CheckPrice I have defined a paramater 'ST_DELIVERY' of the structure ZST_DELIVERY and I have made it multiline.
And in I have binded my workflow container 'ST_DELIVERY' and the ZLIKP paramater with the same name.
Please do let me know if the above steps that I have followed is correct.
Please do let me know if any further information is required.
Thanks in advance,
~Regards
Abhishek
Similar Messages
-
PASS DATA FROM ABAP PROGRAM TO WORKFLOW CONTAINER
Hello Everybody,
I am a workflow beginner and I want to pass a data from my ABAP code to a workflow container. This workflow container is used in the Send Mail step.
The ABAP Program is:
REPORT zdb_work_flow.
tables : vbak.
DATA : k TYPE sweinstcou-objkey,
e TYPE swetypecou-event.
DATA : st TYPE swcont,
itab TYPE STANDARD TABLE OF swcont.
PARAMETERS : vbeln TYPE vbak-vbeln.
start-of-selection.
st-element = 'VBELN'. "This is my WORKFLOW CONTAINER
st-tab_index = 1.
st-elemlength = 10.
st-type = 'C'.
st-value = vbeln.
append st to itab.
k = vbeln.
e = 'TRIGGER' "This is an event in my BUS OBJ ZDB_WFLOW
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = 'ZDB_WFLOW' "My BUS OBJ
objkey = k
event = e "Event TRIGGER in ZDB_WFLOW
tables
event_container = itab
exceptions
objtype_not_found = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. .
COMMIT WORK.
Now I have created a workflow in SWDD as ZDB_WF_SW.
In this WF I have created a container as VBELN.
In the SEND MAIL I have given a header as "Worflow Triggered for &VBELN&"
PROBLEM.
The Workflow is getting triggered. I am also getting a mail "Workflow Triggered for" in my mailbox but the &VBELN& is missing from the header.
I have set the IMPORT EXPORT flag of the WF CONTAINER "VBELN"
Please Help.
Edited by: Deepankar.B on Feb 22, 2011 4:08 PM
Edited by: Deepankar.B on Feb 22, 2011 4:10 PMYou wouldn't use a SMA as an assistance class - but refer to one within it.
I would use Shared Memory Area classes - but I'd also build a SMA that could talk across multiple application servers.
Thomas Jung proposed this in a forum reply some time ago.
It shouldn't be too difficult to use RFC's to access the content of SMA's in multiple app servers - ensuring synchronisation across multi app servers. I've not yet had the need, so haven't attempted.
The long polling in 7.02 apparently uses this approach, so in a 7.02 system there may even be standard components/ SMAs that you could use.
I do not think global areas in FM's are available across sessions - I don't think you could use that as a data transport. -
Hi,
Wanted to know how to pass data from check FM to workflow container?
We are not able to add parameters for event container as it is standard event.
Can we set attribute of object ? I could not find macro for setting property.
Expecting urgent help.
Regards,
AkshayHi Akshay,
Trying to pass data from check FM to workflow container is the wrong approach to use. The purpose of a check FM is ONLY to see if the workflow should be started by the event or not. You cannot and should not even attempt to change the event container in a check FM.
What you need to do is to take a step back and think about your options:
1. "Not able to add parameters ... as it is a standard event". Well you can extend the event parameters on a standard event by creating a delegated subtype of the standard object type. However if the event is raised by standard code this may not help you anyway. It's worth reading the SAP Library doco on this as some types of events do pass additional information provided you define the event parameter names correctly, e.g. change document events will automatically pass the old/new value of certain fields.
2. Is the data you are trying to pass related to:
a) The object - then use attributes of the object instead to calculate the value
b) The person creating the event - then use attributes of the event creator, i.e. as soon as the workflow starts, add a step to instantiate an instance of an object representing the user such as USR01 or USR01DOHR.
c) Other standard data in the event container such as the calling program id, the date/time - any of that info can be passed to your workflow container and then used to derive further info from there.
3. If the data you are trying to pass is only available in the standard calling application, then you need to find another way to raise the event or raise a custom event. E.g. in a user exit or BADI.
4. And one final option of last resort - create your own RECEIVER function module - this does allow you to fill the workflow container during the event linkage. But I would still consider this a "last resort" option.
Regards,
Jocelyn
Message was edited by: Jocelyn Dart -
How to pass data from smartform to user exits in appl form print workbench
Dear All,
I am using print workbench + smartforms to develop a form.
But facing problem with passing data from the smartform back to
the user exits includes in the application form of the print workbench.
For eg:- Supppose the case , passing the total number of pages 'sfsy-formapages' to the application form .
I tried with the export interface of the smartform, still it doesn't works!
Any suggestions/solutions
Thanks
santhvHi Prashanti,
Thank you very much...
Using EXPORT/IMPORT , I am able to pass the data.
But I would like to know whether it is the final solution.
As there is export interface is available for smartform....
why it is not possible to get back the data in Application form.
Please confirm, so that I can close the post.
Anyway thank you once again....
Regards,
santhv -
Pass the data from a form in workflow to z table
Hi all,
How can I pass the data from a form in workflow to z table?Thanks for your answer, I tried the solution 2, I create "Submit" button, and ser the mapping scope to be "All data rows", it only works when I select at least one row, otherwise the data would not be passed.
Another question is I have serveral imported table parameter, for each table I have one "submit" event, I want these tables to be submitted at the same time, but if I click the submit button in one table toolbar, I can only submit the table data which has a submit button clicked, for other tables, the data is not passed, how can I achieve it?
Thanks. -
Regarding how to pass the data from web dynpro to workflow
hi gurus,
how to pass the data from web dynpro to workflow.
Regards
vijayCheck this [thread|SAP_WAPI_START_WORKFLOW;
-
How to pass the data from web dynpro to workflow.
hi gurus,
how to pass the data from web dynpro to workflow.
Regards
vijayHi
you can use function module
data ls_input_container TYPE swr_cont.
data lt_input_container TYPE TABLE OF swr_cont.
CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
EXPORTING
task = ptask
IMPORTING
return_code = lv_return_code
new_status = lv_new_status
TABLES
input_container = pinput_container
message_lines = lt_message_lines
message_struct = lt_message_struct.
where you pass the data in imnternal table "pinput_container" as
ls_input_container-element = 'KUNNR'.
ls_input_container-value = ls_skna1-kunnr ."wd_this->lv_kunnr.
APPEND ls_input_container TO lt_input_container .
ls_input_container-element = 'CLUSER'.
ls_input_container-value = lv_cluser.
APPEND ls_input_container TO lt_input_container .
ls_input_container-element = 'BUKRS'.
ls_input_container-value = lv_bukrs. " youe value as per requirement.
APPEND ls_input_container TO lt_input_container .
ls_input_container-element = 'VKORG'.
ls_input_container-value = ls_sknvv-vkorg. " youe value as per requirement
APPEND ls_input_container TO lt_input_container .
ls_input_container-element = 'VTWEG'.
ls_input_container-value = ls_sknvv-vtweg. "youe value as per requirement.
APPEND ls_input_container TO lt_input_container .
ls_input_container-element = 'SPART'.
ls_input_container-value = ls_sknvv-spart. "youe value as per requirement.
APPEND ls_input_container TO lt_input_container .
*Also Forgot to mention where ptask is your workflow ID *
Regards,
Arvind
Edited by: Arvind Patel on May 14, 2010 7:38 AM -
Collect data from User workflow error updating list item
Hi, can someone please help me with WSS 3 workflows?!
I'll keep it simple - I have a workflow step "Collect data from user" that will fail with Unknown Error when attempting to update list item (this is after the user has clicked Complete Task). The workflow does not continue past this step and I have
to terminate the workflow.
What is odd, is that if I do another Collect data from User in the same step but following the 1st collect, both will work!! How can this be?? This proves the 1st collect is OK so why won't it run without another Collect data after it?! Doesn't make sense to
me.
I was just trying the second Collect to troubleshoot the issue. I've tried other actions there but having another Collect does seem to be the action that kicks things into life. Is there a clue here?
Any clues would be much appreciated as I'm not able to turn much up when I Google.
ThanksWell, surprise, surprise, this has come back (thought it might!). The trace logs show it's a task locked error but I can't see how. Can anyone please provide me with some clues??
03/14/2014 12:30:25.11 w3wp.exe (0x7698) 0x5EA4 Windows SharePoint
Services Web Controls 88wy Medium SPDataSourceView.ExecuteSelect()
- selectArguments: IsEmpty=True, MaximumRows=0, RetrieveTotalRowCount=False, SortExpression=, StartRowIndex=0, TotalRowCount=-1
03/14/2014 12:30:28.39 w3wp.exe (0x7698) 0x6C4C Windows SharePoint Services
Web Controls 88wy Medium SPDataSourceView.ExecuteSelect() - selectArguments:
IsEmpty=True, MaximumRows=0, RetrieveTotalRowCount=False, SortExpression=, StartRowIndex=0, TotalRowCount=-1
03/14/2014 12:30:28.47 w3wp.exe (0x7698) 0x6C4C Windows SharePoint Services
Web Controls 88wy Medium SPDataSourceView.ExecuteSelect() - selectArguments:
IsEmpty=True, MaximumRows=0, RetrieveTotalRowCount=False, SortExpression=, StartRowIndex=0, TotalRowCount=-1
03/14/2014 12:30:29.86 w3wp.exe (0x7698) 0x7A94 Windows SharePoint Services
Workflow Infrastructure 72er Medium Microsoft.SharePoint.SPException: This task is currently locked by a running workflow and cannot
be edited. at Microsoft.SharePoint.SPListItem.PrepareItemForUpdate(Guid newGuidOnAdd, SPWeb web, Boolean bMigration, Boolean& bAdd, Boolean& bPublish, Object& objAttachmentNames, Object& objAttachmentContents, Int32&
parentFolderId) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean
suppressAfterEvents) at Microsoft.SharePoint.SPListItem.Update() at Microsoft.SharePoint.Workflow.SPWinOEWSSService.CommitUpdateListItem(Transaction txn, Object[] transData)
03/14/2014 12:30:29.86 w3wp.exe (0x7698) 0x7A94 Windows SharePoint Services
Workflow Infrastructure 72fe High Error in commiting pending workflow batch items: Microsoft.SharePoint.SPException: This
task is currently locked by a running workflow and cannot be edited. at Microsoft.SharePoint.SPListItem.PrepareItemForUpdate(Guid newGuidOnAdd, SPWeb web, Boolean bMigration, Boolean& bAdd, Boolean& bPublish, Object& objAttachmentNames,
Object& objAttachmentContents, Int32& parentFolderId) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion,
Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents) at Microsoft.SharePoint.SPListItem.Update() at Microsoft.SharePoint.Workflow.SPWinOEWSSService.CommitUpdateListItem(Transaction txn, Object[]
transData) at Micro...
03/14/2014 12:30:29.86* w3wp.exe (0x7698) 0x7A94 Windows SharePoint Services
Workflow Infrastructure 72fe High ...soft.SharePoint.Workflow.SPPendingWork.PerformWorkNow(Transaction txn)
at Microsoft.SharePoint.Workflow.SPPendingWorkBatch.Commit(Transaction transaction, ICollection items)
03/14/2014 12:30:30.05 w3wp.exe (0x7698) 0x7A94 Windows SharePoint Services
Workflow Infrastructure 88xr Unexpected WinWF Internal Error, terminating workflow Id# 2dc6002d-9f9d-474f-84cf-329025347ec5
03/14/2014 12:30:30.05 w3wp.exe (0x7698) 0x7A94 Windows SharePoint Services
Workflow Infrastructure 98d4 Unexpected System.Workflow.Runtime.Hosting.PersistenceException: This task is currently locked by a running workflow
and cannot be edited. ---> Microsoft.SharePoint.SPException: This task is currently locked by a running workflow and cannot be edited. at Microsoft.SharePoint.SPListItem.PrepareItemForUpdate(Guid newGuidOnAdd, SPWeb web, Boolean
bMigration, Boolean& bAdd, Boolean& bPublish, Object& objAttachmentNames, Object& objAttachmentContents, Int32& parentFolderId) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion,
Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents) at Microsoft.SharePoint.SPListItem.Update() at Microsoft.SharePoint.Workflow.SPWi...
03/14/2014 12:30:30.05* w3wp.exe (0x7698) 0x7A94 Windows SharePoint Services
Workflow Infrastructure 98d4 Unexpected ...nOEWSSService.CommitUpdateListItem(Transaction txn, Object[] transData) at
Microsoft.SharePoint.Workflow.SPPendingWork.PerformWorkNow(Transaction txn) at Microsoft.SharePoint.Workflow.SPPendingWorkBatch.Commit(Transaction transaction, ICollection items) at System.Workflow.Runtime.WorkBatch.PendingWorkCollection.Commit(Transaction
transaction) at System.Workflow.Runtime.WorkBatch.Commit(Transaction transaction) at System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback commitWorkBatchCallback)
at System.Workflow.Runtime.Hosting.DefaultWorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback commitWorkBatchCallback) at System.Workflow.Runtime.WorkflowExecutor.CommitTransaction(Activity activityContext)
03/14/2014 12:30:30.05* w3wp.exe (0x7698) 0x7A94 Windows SharePoint Services
Workflow Infrastructure 98d4 Unexpected ... at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean
unlock, Boolean needsCompensation) --- End of inner exception stack trace --- at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation)
at System.Workflow.Runtime.WorkflowExecutor.System.Workflow.ComponentModel.IWorkflowCoreRuntime.PersistInstanceState(Activity activity) at System.Workflow.ComponentModel.Activity.MarkClosed() at System.Workflow.ComponentModel.Activity.ReleaseLockOnStatusChange(IActivityEventListener`1
eventListener) at System.Workflow.ComponentModel.FaultAndCancellationHandlingFilter.SafeReleaseLockOnStatusChange(ActivityExecutionContext context) at System.Workflow.ComponentModel.FaultAndCancella...
03/14/2014 12:30:30.05* w3wp.exe (0x7698) 0x7A94 Windows SharePoint Services
Workflow Infrastructure 98d4 Unexpected ...tionHandlingFilter.OnEvent(Object sender, ActivityExecutionStatusChangedEventArgs e)
at System.Workflow.ComponentModel.ActivityExecutorDelegateInfo`1.ActivityExecutorDelegateOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime) at System.Workflow.Runtime.Scheduler.Run()
03/14/2014 12:30:30.38 w3wp.exe (0x7698) 0x6C9C Windows SharePoint Services
General 0 Unexpected ERROR: request not found
in the TrackedRequests. We might be creating and closing webs on different threads. ThreadId = 59, Free call stack = at Microsoft.SharePoint.SPRequestManager.Release(SPRequest request) at Microsoft.SharePoint.SPWeb.Invalidate()
at Microsoft.SharePoint.SPWeb.Close() at Microsoft.SharePoint.SPSite.Close() at Microsoft.SharePoint.SPSite.Dispose() at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflow(SPWorkflow
workflow, Collection`1 events, SPRunWorkflowOptions runOptions) at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflow(SPWorkflow workflow, Collection`1 events) at Microsoft.SharePoint.Workflow.SPWinOEItemEventReceiver.RouteWorkflowEvent(SPItemEventProperties
properties, SPWeb web, SPListItem item, Boolean fNeedTas...
03/14/2014 12:30:30.38* w3wp.exe (0x7698) 0x6C9C Windows SharePoint Services
General 0 Unexpected ...kReset)
at Microsoft.SharePoint.Workflow.SPWinOEItemEventReceiver.ItemUpdated(SPItemEventProperties properties) at Microsoft.SharePoint.SPEventManager.RunItemEventReceiver(SPItemEventReceiver receiver, SPItemEventProperties properties, SPEventContext
context, String receiverData) at Microsoft.SharePoint.SPEventManager.RunItemEventReceiverHelper(Object receiver, Object properties, SPEventContext context, String receiverData) at Microsoft.SharePoint.SPEventManager.<>c__DisplayClass8`1.<InvokeEventReceivers>b__0()
at Microsoft.SharePoint.SPSecurity.CodeToRunElevatedWrapper(Object state) at Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken userToken, Boolean bResetContext, WaitCallback code, Object param) at Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken
03/14/2014 12:30:30.38* w3wp.exe (0x7698) 0x6C9C Windows SharePoint Services
General 0 Unexpected ...userToken, CodeToRunElevated
code) at Microsoft.SharePoint.SPEventManager.InvokeEventReceivers[ReceiverType](SPUserToken userToken, RunEventReceiver runEventReceiver, Object receivers, Object properties, Boolean checkCancel) at Microsoft.SharePoint.SPEventManager.InvokeEventReceivers[ReceiverType](Byte[]
userTokenBytes, RunEventReceiver runEventReceiver, Object receivers, Object properties, Boolean checkCancel) at Microsoft.SharePoint.SPEventManager.HandleEventCallback[ReceiverType,PropertiesType](Object callbackData)
at Microsoft.SharePoint.Utilities.SPThreadPool.WaitCallbackWrapper(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCo...
03/14/2014 12:30:30.38* w3wp.exe (0x7698) 0x6C9C Windows SharePoint Services
General 0 Unexpected ...de backoutCode, Object
userData) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback
tpWaitCallBack) at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state) , Allocation call stack (if present) null -
Sending mail to external mailid from user exit EXIT_SAPLEBNF_005
Hai ALL,
iam facing problem with sending mail to external id from user exit exit_saplebnf_005 , this user exit for ROLE Determination of releasing of PO .
in this user exit i passed a user name for this role from one z table.
through workflow the mails are send to workplace of resposible person maintained in ztable.
now user requirement is they want some intimation in their outlook for they got mail in workplace .
can anybody help me.
Thanks .
sushmita.kthey can either define automatic forwarding in their SAP office to external e-mail OR they can set their external e-mail as preferred method of communication and they should receive mail to their external mailbox assuming that sending to external mail is supported in your system (check with BASIS folks).
-
Problem in passing data from one .jsp page to another .jsp page
i have a problem here
Actually i have 2 jsp pages. What im trying to do here is actually i want to pass data from the first jsp page to the second for updating
The first jsp page contains data that user wants to update in the form of table.
<td><img src = "edit.gif" alt = "edit" border="0" ><td>
<TD><%= Name %></td>
<TD><%= rs.getInt("Age") %></td>
<TD><%= rs.getString("Gender") %></td>
So this page displays the data that users wants to update plus one image button (edit button). So when user clicks this button, all the data in this page will be brought to the second .jsp page called updatePersonal for updating.
The problem here is that it is not displaying the existing data in the second .jsp page.
The second page basically contains forms
<INPUT TYPE="text" NAME="FirstName" maxlength="30" value = "<%=FirstName%>">
Can someone please help me. I really dont know what to do..How do i get the data displayed in the text field that is passed from the first .jsp page..thankx in advancePlease modify below code to:
td><img src = "edit.gif" alt = "edit" border="0" ><td>
-----------------modified code
td><a href="updatePersonal.jsp?FirstName=<%=rs.getString(FirstName")%">&LastName=<%=rs.getString("LastName")%>&Age=<%=rs.getInt("Age")%>&Gender=<%=rs.getString("Gender")%>"><img src = "edit.gif" alt = "edit" border="0" ></a><td>
I'm sure it works</a> -
How to access the global data in user exit.
Hi All,
How to access the global data in user exit.
the question is that when we were writing a code in the FM. i need to read data from the standard program like newly created documen and this document number need to be accessed in my program.
this document number is not imported to the FM i needed to access for frther proceed.
Thanks in advance.Hi,
See the below PDF file by Jeff Goldstein. There you can find all the details about accessing data outside of the exit.
[SAP User Exits and the People Who Love Them|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/208811b0-00b2-2910-c5ac-dd2c7c50c8e8]
This will help you to solve your problem.
Regards
Karthik D
Edited by: Karthik D on Dec 2, 2008 4:18 PM -
How can I pass data from a form guide to another form in a business process
How do we pass data from a form guide to another form(not necessarily a guide) without having to open the form. For example we have a small form guide to capture the contract id so we can then get data from contracts table to present to the user in a form. We want the user to open the guide (either Flex guide or form guide) to enter the contract id. Upon submission we want the process to get the contract data and put it into the form that will be opened at the next step by the user without having a user interact with the form to get the data into it. In other words we need the process to get the data and populate a different form than the form guide the contract id was entered in and this new form needs to be opened in the next step by the user.
Firstly, I'm assuming that you have a Forms ES Server if you are rendering a Guide. This could be either version ES1, ES2/2.5 or ES3/ADEP
If you submit the form back to the server, you can populate a second (PDF/XDP) form with the data bound to the same schema/Data Model using Forms ES.
You referred to the next user in the chain - If you are using Process Management, this is very easy, as you define what form is used to render the data in the "Presentation & Data" section of the Assign Task activity -
Passing data from a panel to a frame / disposing of a frame from in a panel
Hello, I have recently created a program where all windows are made of seperate frames, now, to make the whole thing a bit more appealing and professional looking, i'd like to make 1 main frame, and load my content panels into this 1 frame. Problem i'm having with this is passing data from the loaded in panel to the main frame, so the main frame can hide one panel to load another with data inserted in the first panel. OR another solution to my problem would be a way to dispose of a frame, but from within the seperate panel class. I have searched the www for a solution, but haven't found one so far, so, any suggestions or references to some info about this kind of issue? Any pointer is greatly appreciated
kennethdm wrote:
EDIT: I took a look at the cardlayout, and, although i see its relevance to my question, it still leaves me with the question how exactly i will pass data the user inputs into the first panel, to the second panel. The second panel is built by the info which is provided in the first panel.Stop thinking of them as Panels and start thinking of them as OOP objects that have data that must be shared. It's often a matter of using getters and setters and sometimes requiring a sprinkling of the Observer design pattern. -
Passing data from one frame to another frame
hello all, i am having a problem with passing data from one frame from another. I have a main frame when you click on connect button it display the second frame(class) that has 2 text fields and 2 buttons. When i click on connect it check if the data is correct. If the data is correct i want that frame to close and pass the data back to main frame. How can i do that.
thank youhello all, i am having a problem with passing data
from one frame from another. I have a main frame when
you click on connect button it display the second
frame(class) that has 2 text fields and 2 buttons.
When i click on connect it check if the data is
correct. If the data is correct i want that frame to
close and pass the data back to main frame. How can
i do that.
thank you
the original problem sounded like an ideal opportunity to use Modal Dialog. if you want one frame to display another to get user input then you need to stop the method in the main frame from executing until you recieve a valid input.
you can use your own class and keep all of the components that you have in the connect frame but you would have to extend JDialog instead of JFrame.
there is a way around it!
if you must use JFrame for both, then you need to have access to the main frame in the connect frame, maybe pass the pointer to the constructor??
anyway, when the connect frame is done with its duties, you have to use the pointer to call another method in the main frame that will continue the process. otherwise main frame doesn't know when connect frame is done and by that time, the method in main frame that instantiated the connect frame has long since died.
also, it allows things to happen in the other window that you may not want to happen until the connect frame is done
typically users of software start clicking around on things and you could have three or four connect frames going at the same time
it's really best to use a Modal Dialog, it really can look just like a JFrame!!!!!!!!!!!!!! -
Passing data from a container to another
Hi,
Let's say I have two containers (Container1=application , Container2). Container1 gets some data from user, perform some database lookup and displays Container2 with the results from database lookup.
Container1 --(call and display)--> Container2
Below shows how I am using a bindable variable in Container1 to pass the data from Container1 to Container2. Also shows how I display Container2 from Container1.
<!-- Container1 -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
[Bindable] public var foo:String = "bar";
private function loginHandler(event:LoginEvent):void
mycontainer2 = new Container2();
mycontainer2.name = "mycontainer2";
this.addChild(mycontainer2);
</mx:Application>
I am accessing the data in Container2 as follow:
<!-- Container2 -->
{mx.core.Application.application.foo}
Q1) Is there a better way to pass data from one container to another and access the data?
Q2) Is this the only way to call and display Container2 from Container1?
Q3) How can I move back to Container1 from Container2, i.e. Container2 call and display Container1
Container2 --(back to)--> Container1Best practices call for using custom events to share data between components. Here is my Flex 3 Cookbook post on the topic:
http://cookbooks.adobe.com/index.cfm?event=showdetails&postId=15466
To switch easily between containers 1 & 2 use a ViewStack, the gold standard for such interaction, and manipulate the selectedIndex or selectedChild property:
http://livedocs.adobe.com/flex/3/html/help.html?content=navigators_3.html
If this post answered your question or helped, please mark it as such.
Maybe you are looking for
-
IDOC Ack from BPM to SAP R3 runs into an error
Hi All, I have a scenario which sends an DEBMAS IDOC to an Integration Process "IP_SPLIT_Site" which process the IDOC and sends it to multiple systems. When the IDOC is sent from SAP R3 to the receiving Integration Process "IP_SPLIT_Site" in XI, it i
-
How do i fix an ipod that wont restore
ij
-
No mouse cursor in TextWrangler
ARD 3.3.2 on MBP Desktop 10.5.8 accessing Server 10.6.2 (3.3.2 client). When using TextWrangler the mouse cursor disappears when over the code window - it's there when over the side drawer. The active line highlight and text insertion cursor show - i
-
Implemenet/Extend interface/class in default package
Filename: DeaultInterface.java public interface DefaultInterface { // Abstract Methods... Filename: ConcreteClass.java package com.company; import DefaultInterface; public class ConcreteClass implements DefaultInterface { // Implementation of
-
Why wont my computer update the new software ?