Changing Element Attribute Values
I spent far to long trying to figure out how to change an element attribute value without the FDK's SetAttributes function, so I thought I'd spare someone else the time.
Basically, you still get the attributes using the GetAttributes() function, but now you just set the beg.child.Attributes property to the updated attribute value.
//starting with a selected element
elemSelect=app.ActiveDoc.ElementSelection
//get the current attributes
var childattributes =elemSelect.beg.child.GetAttributes()
//find the attribute and value you want to change, and change it to a new value.
childattributes[0].values[0] = "New_Value"
//now assign the edited attributes to the selected element.
elemSelect.beg.child.Attributes=childattributes
Depending on how you selected the element, I assume you could do the above with beg.parent as well, but it wasn't something I needed to consider.
~Christen
Thanks for this--you've likely saved me a headache.
While I hadn't hit this yet, it does apply to several of the projects on my to-do list. Based on the info in the OMV, I would have expected to be able to simply use a statement like myElement.Attributes[i].value[i] = "New_Value" which, as I'm sure you discovered, has no apparent effect at all.
The other thing I noticed in my quick testing is that defining your attributes variable by using the method (x = myElement.GetAttributes()) or by referenceing the Attributes property (x = myElement.Attributes) seem to be functionally equivalent.
Similar Messages
-
Change a attribute value with XSLT before importing an XML
I need change the attribute value with XSLT before importing an XML
<table class="x" style="width="50pt">...
I have to divide by 200 the value of "width", and the result multiplied by 100:
(50/200) * 100
It's possible with a XLST?Hi,
Yes you can do this via XSLT.
You can try similar to the one below:
<table>
<xsl:attribute name="width">
<xsl:value-of select="((./width) div 200)*(100)" />
</xsl:attribute>
</table>
I have not tested yet... Try it....
Green4ever
(I am back after long time).... -
Change an attribute value in the last level of a tree
Hi,
I'm using jdev 11.1.1.0.1
I have a tree composed of 5 VO. Each VO represent a level of the tree. I made an "executeWithParam" in my VO level 1 to pass some parameters.
I would like to make a "setAttribute" on my VO level 5. I'm working with a tree, so i can't do : "getMyVo.getCurrentRow.setAttribute..."
How can i do?
ideas :
- Today, i use bind variable to pass parameters from first level VO to last level VO : can i put the bind variable value in an attribute value?
- Is there a method to override in the viewRowImpl.java to catch the "setAttributeInternal" made by ADF? so i could change the value of this attribute
- Is there a method to override in the viewImpl.java which can help me?
I try a lot of think without success... hope someone can help me
Thanks in advance
ClémentHi Frank,
Thanks for your help.
My need is to initialize all the rows of my VO level 5. Not only the selected ones. But i keep your solution for later :)
Today, that is what i'm doing :
- First, i use "executeWithParam" to complete a bind parameter of the first VO.
public void executeWithParamTreeNiv1() {
VoLvl1ViewImpl view =
(VoLvl1ViewImpl) getLvl1View ();
VoSourceId rowSrc =
(VoSourceIdRowImpl) getVoSourceIdView().getCurrentRow();
if (rowSrc != null) {
saisPrevTreeView.setFkId(rowSrc.getId());
}- Then, i use the method "createViewLinkAccessorRS" of the viewImpl, to pass bindParmeters between VOs.
protected ViewRowSetImpl createViewLinkAccessorRS(AssociationDefImpl assocDef, ViewObjectImpl accessorVO,
Row masterRow, Object[] values) {
ViewRowSetImpl v = super.createViewLinkAccessorRS(assocDef, accessorVO, masterRow, values);
Number fkId = (Number)((ViewRowImpl)masterRow).getViewObject().getNamedWhereClauseParam("FkId");
accessorVO.setNamedWhereClauseParam("FkId", fkId );
v.setNamedWhereClauseParam("FkId", fkId );- Finally, i use the method "isAttributeUpdateable" of my VO level 5, to get the bind parameter and make a setAttribute.
@Override
public boolean isAttributeUpdateable(int i) {
Number fkId= (Number)this.getViewObject().getNamedWhereClauseParam("FkId");
if (fkId!= null) {
this.setFkId(fkId);
}What do you think about this method?
Thanks
Clément -
.change IUCONFIG attribute value in an event-handler of IUICCON (move in)
Hi there,
I have been searching for over a week now both on SDN and using the debugger, hopefully this brings more luck.
On the web-client there is this new contracts page with 3 tabs.
On the first tab you can choose a product, select a contract and then click Configuration.
There you can change parameters. (this is View IUCONFIG/ConfigTree) with contextnode ISUORDERITEMCONFIG.
In this case it is not wanted that this configuration page needs to be opened.
So I need to change the value of 1 of these attributes (always the same attribute) automatically when switching to the 2nd tab, or when clicking the save button on the last tab. Or any event on the 2nd or 3rd tab are okay. As long as they are sure to be executed in the process.
I would prefer changing the attribute from within IUICCON/ProcessSaveButtonBar>EH_ONBT_SAVE_PROCESS
or IUICCON/ProcessBar>EH_ONNAVTOACCOUNTDATA
I just don't have a clue how to automatically set one value of these configuration attributes.
Can anybody provide a solution or a workaround?
Is there any way to change the parameters without ever going to the configuration page in the browser?
Thanks in advance for your ideas
Could this thread be moved to CRM webclient?Solved, the solution can be supplied in trade for the right amount of money
(okay is was CRM_ISU_CONT_CHANGE_OW) -
Error in changing row attribute value
Hi,
I am using JDeveloper 11.1.1.4 and developing a project using ADF-BC.
In my application,I am displaying an adf table from DataControl->view object.
The view object is based on an entity object which has composite primary key [Ex: Name and Rank]
I have an requirement to swap selected row and its previous row's rank values on click of a button.
I have written following code to achieve this.
public void swapRows(ActionEvent actionEvent) {
ViewObject rscMapVo = getRscMapViewObj();
Row currRow = rscMapVo.getCurrentRow(); //------------->Current Row
int currRowIndex = rscMapVo.getRangeIndexOf(currRow);
Row prevRow = getRscMapVoIter().getRowSetIterator().getRowAtRangeIndex(currRowIndex - 1); // ------------> Previous Row
Long currRowRank = ((Number)currRow.getAttribute("Rank")).longValue();
Long prevRowRank = ((Number)prevRow.getAttribute("Rank")).longValue();
//Actual Swapping
prevRow.setAttribute("Rank", new Number(currRowRank));
currRow.setAttribute("Rank", new Number(prevRowRank));
adfFacesContext.addPartialTarget(tblRSCMap);
}//End of method
This is giving me the exception
1)Rank Too many objects match the primary key oracle.jbo.Key[Group_1 7 ]. [Name is Group_1 and Rank is 7]
2)Rank Too many objects match the primary key oracle.jbo.Key[Group_1 8 ] .[Name is Group_1 and Rank is 8]
If instead of actual rank values I update it to some random number it updates properly. i.e for example prevRow.setAttribute("Rank", new Number(900)); and currRow.setAttribute("Rank", new Number(800));
The exception occurs when I change one row value with a value that is already present in other row there by giving unique constraint problem.
How to overcome this problem??
Is there any other way of implemeting this solution.
I want the changed attribute values to commit to DB only after final commit but not immediately.
Please advice/suggest.
Thanks,
PraveenHi RajGopal,
Even in the model layer it gives the same error.
steps done
1.Create an attribute in entity and set its value
2.Override the method doDML in EntityImpl
protected void doDML(int operation, TransactionEvent e) {
try{
if(this.getTestRank() != null){
this.setRank(this.getTestRank());
}else{
System.out.println("Test rank null");
super.doDML(operation, e);
}catch(Exception excep){
System.out.println("Eceptin in update");
excep.printStackTrace();
Exception
oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key[Group_1 28 ].
at oracle.jbo.server.EntityCache.throwTooManyObjectsException(EntityCache.java:588)
at oracle.jbo.server.EntityCache.handleDuplicateKey(EntityCache.java:596)
at oracle.jbo.server.EntityCache.addForAltKey(EntityCache.java:990)
at oracle.jbo.server.EntityCache.replaceForAltKey(EntityCache.java:1739)
at oracle.jbo.server.EntityImpl.setAttributeValueInternal(EntityImpl.java:3952)
Thanks,
Praveen -
Select element attribute value
For the following XML:
<?xml version="1.0" encoding="UTF-8" ?>
<rowset extract_id="54321">
<candidate>
...Is there a way to select or get the attribute value? This will be in the process of uploading data from a text file to the database (10g R2) in a 6i Oracle Form using text_io.get_line.
Thank you.extractValue(xml,'/rowset/@id')
-
Tricky! Change of navi-attribute values in ABAP and use in selections
Hi gurus,
now I have a teaser that really keeps me busy, and which might be interesting for some of you:
we use several statuses in our <u>Demand Planning in SCM 5.0</u>, some of which can be switched by using a user-function macro which just basically is a ABAP function module that <u>changes navigation attribute values directly on the database</u>, meaning in the master data tables of the respective characteristic.
Now, the code works, the values are changed accordingly, leaving the data set in object status "active" - <b>BUT</b>:
<i>when we call a selection, it still shows the old values, even after activating master data or running the attribute change run!</i>
This is not what we expected. Our wish was, that once the table was updated with the correct field values, we would also see them in our selections.
<u>Details:</u>
we have two statuses as navi-attributes to an article:
<i>DP:</i> YES/NO, and
<i>oDP:</i> YES/NO
Combinations originally are: <i>DP</i> YES/<i>oDP</i> NO
After the status change macro, the table shows the following, as expected:
<i>DP</i> NO/<i>oDP</i> YES
As we have two selections, one on DP status "YES", the other one on oDP status "YES", we would like to see the article vanish in the first selection and show up in the other one...
Does anybody have an idea what is wrong and what we can do to have to proper navi-attribute values from the master data table in the selection? Does the selection not read from the database but from a buffer?
Looking forward to your answers,
KlausHi Fabrice,
yes indeed, I did check the object version, and it is A.
Problem is, the function module changes the data record which is "A" anyway. So the changed data record is active - however, I just had a look at the SID master data table, and it looks that direct changes to the P-table do not affect the X-table where the SIDs are stored. So I guess I will also have to update the X-table with the correct SID-values.
If this works, I let you know. We will be using this change by ABAP quite often, it is rather useful.
Regards and thanks for your prompt reply,
Klaus -
Selcect/ update attribute value using xpath navigator/ linq to xml
Hi Folks,
below is my xml string and the highlighted bold attribute value needs to update. Since this element contains prefix im not able to select teh particular element. if i remove the prefixx im able to select but i need to keep prefix.
<IOP:MtvnSvcReq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:IOP="mtvnCWExternInteropReq" xmlns:IOP1="mtvnExtInteropReqData" xmlns:PR1="mtvnPRInteropReqData">
<IOP:Svc>
<IOP1:PR1>
<PR1:PRExternSSOReqData>
<PR1:UserId>abcd</PR1:UserId>
</PR1:PRExternSSOReqData>
</IOP1:PR1>
</IOP:Svc>
</IOP:MtvnSvcReq>
ThanksHi Pulikk,
Do you mean you want to change the attribute value(abcd)? If so,
Please try the following code, i tested on my side, it changed successfully.
//Here is the variable with which you assign a new value
string newValue = string.Empty;
XDocument objDoc = XDocument.Load(@"yourdata.xml");
XNamespace IOP = "mtvnCWExternInteropReq";
XNamespace IOP1 = "mtvnExtInteropReqData";
XNamespace PR1 = "mtvnPRInteropReqData";
foreach (var node in objDoc.Descendants(PR1 + "UserId"))
node.Value = newValue;
objDoc.Save(@"yourdata.xml");
Have a nice day!
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How to inherit attribute values in object tables?
I am trying to implement object inheritance with oracle 10g express. What i have done so far is created some types and subtypes. And some tables based on those types and sub types. So far i have understood that the subtypes inherit the attributes and methods from its super types.
But is there a way to inherit the attribute values from the object table of the super type to the object table of the sub type?
For example: The object O1 , explicitly labeled with (sIPO1 , wIPO1) , also inherits the intended purpose (sIPT 1 wIPT 1) from T1 . Similarly, the object O3 inherits the intended purposes from T3 , O1 and T1 . Note, however, that O2 , which is not labeled, inherits the intended purpose from T2 , but not from O1 nor T1 , as the intended purposes are not inherited through the reference-of relation.
_a visual of the above description [http://picasaweb.google.com/lh/photo/1YBAQbCMQMBmd8oyw9SyNw?feat=directlink]_
How can the types and objects be labeled as mentioned above? And how can these labels be made inheritable by the subtypes and objects based on those subtypes?
Possible Solution*
Only way which i could think of is using relational tables, like this: type_label(type_name, label1, label2) and a similar table table_label(table_name, label1, label2) for labeling the object tables. Then refer to these labels through some java programming. Will this be a right approach. I doubt that this will defeat the very intentions of the object database. And i hope there is a straight solution in Object Relational methods instead of java programming.
nested tables and vararrays... will using them help solving the above problem some how?From those examples i can see that although the nested tables will have the super type attributes and values with them, if i have to change those attribute values the values in the whole table gets changed.
is it possible to change the super type attribute values which is corresponding to the nested table values alone and not disturb the over all table? -
I have been reading the documentation for the XSQL servlet in the hopes of using it to get XML data out of a relational database.
Whilst it seems straight forward to get the column entries into their own elements I have not seen how to get them into an element attribute instead of their own element (other than the id attribute which you can only use once per row).
Is this correct or is there a way to get column values into element attribute values instead of element values?
Any help appreciated.
Ron QuartelIf you're using XSQL, the best solution
is to use XSL stylesheets.
You could write XSL file to include
DTD/Schema in your output xml file.
Basic XSL sample is used in the XSQL demo.
There is short discussion in the readme.html
file. If you're only moving elements to
attributes, they probably would be enough. -
How to change general attribute of text element
hi
who now how to change general attribute of text element on screen dinamically? I wish to change text value dinamically for example.Hi Denis,
I am not too sure on what you want.
If you require that the text value be different based on some conditions you can declare as many text elements as conditions and call the relevant text element.
But I dont think that you can assign dynamic texts to a single text element.
Regards,
Saurabh -
Change htmlb element attribute
Hi all
Can we change the htmlb element attribute in the layout section using event handler?
I want to set the value of an element attribute to 'TRUE' or 'FALSE' based on the user input and there is only one page in the BSP application.
Thanks
johnYes U can do that
U have to declare the element attribute as a variable
using <%= x_attr %>
Then change the value of x_attr in the Oninputprocesing event based on certain conditions.
Volia , when the page is rendered , it will pick up the new value.
Because onLayout is called after oninputprocessing , so it will always pick the new value. -
Column value substitution in tabular form element attributes
We started to discuss this at Re: Tabular form with Ajax
I also mentioned this at Re: how to make only some rows editable in html db.
but thought that this deserves its own thread.
In Doug's sample Sudoku application in that thread, he uses #COLUMN# substitution in the Form Element Attributes and it works fine, but in my example page at http://htmldb.oracle.com/pls/otn/f?p=24317:219 I used the same technique and no matter what I do, the #COLUMN# substitution is not expanded by the Apex engine.
This is driving me nuts, any ideas why it works in one application but not in another?
ThanksHm, you might be right.
I copied your row template and modified it at http://htmldb.oracle.com/pls/otn/f?p=24317:219
The styling looks terrible, not sure why, the template is simply
<tr>
<td class="t10data">#EMPNO_DISPLAY#</td>
<td class="t10data">#ENAME#</td>
<td class="t10data">#JOB#</td>
<td class="t10data">#MGR#</td>
<td class="t10data">#HIREDATE#</td>
<td class="t10data">#SAL#</td>
<td class="t10data">#COMM#</td>
<td class="t10data">#DEPTNO#</td>
</tr>I had a lot of trouble getting this to work because the wizard generated tabular form appends 2 hidden fields containing the PK and the row-checksum to the last (editable?) field on each row. If the last editable field has #COL# substitution, it expands the substitution and forgets to close the INPUT tag thus causing malformed HTML (I think this is a bug in the rendering engine).
The readonly condition is sal>1000 which now works. The SAL>1000 fields are now readonly.
But now the update process is broken. If I enter a number in the first blank SAL field (empno=3641) and click Submit, I get no errors but the change is not saved. Wonder why.
Hopefully, Scott (Spadafore) will take mercy on our amateurish experiments and give us some definitive answers soon!
Thanks. -
I have a provider hosted app in sharepoint which works locally without problem. I followed this tutorial to publish it to azure
http://blogs.technet.com/b/sharepointdevelopersupport/archive/2013/09/05/how-to-deploy-a-provider-hosted-app-as-an-azure-site.aspx
However after publishing the webservice doesnt work I get this exception:
[InvalidOperationException: The type 'x.IntranetWeb.Services.AppEventReceiver', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.]
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +62739
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +1429
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +52
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +598
[ServiceActivationException: The service '/Services/AppEventReceiver.svc' cannot be activated due to an exception during compilation. The exception message is: The type 'x.IntranetWeb.Services.AppEventReceiver', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found..]
System.Runtime.AsyncResult.End(IAsyncResult result) +486572
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +174
System.ServiceModel.Activation.ServiceHttpModule.EndProcessRequest(IAsyncResult ar) +345998
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +9683593
My web.config which I didnt touch.
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="ClientId" value="xx-04e7-4caf-854a-89c20577d7da" />
<add key="ClientSecret" value="ljguTvxHR+xx+Pl1IMg1Hjt5rsQ=" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<customErrors mode="Off"/>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.0.0" newVersion="5.2.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<!--Used by app for SharePoint-->
<binding name="secureBinding">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<protocolMapping>
<add binding="basicHttpBinding" scheme="https" bindingConfiguration="secureBinding" />
</protocolMapping>
</system.serviceModel>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
</configuration>
and a piece of the code of the remote event receiver
<%@ ServiceHost Language="C#" Debug="true" Service="x.IntranetWeb.Services.AppEventReceiver" CodeBehind="AppEventReceiver.svc.cs" %>
namespace x.IntranetWeb.Services
public class AppEventReceiver : IRemoteEventService
Follow me on Twitter
levalencia BlogHi,
The issue here is the mapping of the interface to the service in question, and usually points to a possible mistype or rename of something within your service architecture.
You need to make sure your namespace and service name here match your service name itself.
For detailed information, you could refer to:
https://haddicus.wordpress.com/2011/06/06/service-attribute-value-not-found-wcf-services/
http://stackoverflow.com/questions/9557221/the-type-restservice-weddingservice-provided-as-the-service-attribute-value-i
Regards -
Is it possible to change the display value of a domain-based attribute?
Hello,
I've selected a domain-based attribute for one of the leaf member attributes in the same entity, aka parent id, since it's a self-referencing entity. However, I cannot find a way to display anything but the code value in the drop-down (see below).
Is there a way to change the display value so that I can choose the attribute from the entity from which I want the user to choose? In other words, I would like to display the hierarchy name instead of the code, which is really just the primary id.
Thanks in advance!
Ben Lezin1. In the explorer page, settings dialog, you can change the display format to show only name.
2. We cannot use other freeform attribute as DisplayFormat, rather than Code Name. So there are 2 option here:
a. Remove HierarchyName attribute and just use Name attribute. In the next release, we will allow give Name, Code attribute a displayname, so you can give Name display name as "HierarchyName" in the SQL Vnext release.
b. Make a Business Rule to update Name when HierarchyName is changed.
Maybe you are looking for
-
Acrobat 9.4.4 crashes when running batch process to remove metadata
I am attempting to run a batch process to remove metadata from all documents within a folder. Only one or two documents will process before Acrobat crashes. Any suggestions? Thank you.
-
PO release: Modification of PO = block having to release again
Hi, Purchase orders are relased/ approved. After the PO has been already approved, if the partner role invoicing party is changed on the PO, the PO goes back to the approval flow. Is it possible to to prevent double approval? Can this be handled via
-
Can i use my computer from canada in europe?
i'm going to a conference in paris this week. if i buy a prong adapter for the outlet in paris, will my computer convert the energy there into a useful form...and not fry my computer? thanks so much. ellen
-
ICal to iPhone synching deleted events
When synching iCal to my iPhone, I get multiple deleted items added back to my iPhone. I then have to go through and delete them on the iPhone manually. These items are no longer on iCal on my MacBook Pro, but everytime I synch these old deleted even
-
Directory Server & Calendar: permission problems
When users of the Calendar server subscribe to calendars, they get no errors but the Calendar is not added to the list. In the LDAP logs I found an error about updating the user's profile: [08/Nov/2004:11:36:02 +0100] conn=1406 op=35 msgId=36 - SRCH