p:column rendered attribute does not seem to work with p:dataTable var











up vote
3
down vote

favorite
2












I have written a code like:



<p:column headerText="Edit" width="40" rendered="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
<p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" disabled="true" process="@this" update="leaveDataTable" immediate="false">
<h:graphicImage url="resources/images/edit.JPG"/>
<f:attribute name="userId" value="#{employee.name}"/>
<f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
<f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
<f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
<f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
<f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
</p:commandLink>
</p:column>


But the rendered attribute is not working for the condition. How can I use the logical operator to make the condition work?Using PrimeFaces 3.4.2










share|improve this question




























    up vote
    3
    down vote

    favorite
    2












    I have written a code like:



    <p:column headerText="Edit" width="40" rendered="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
    <p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" disabled="true" process="@this" update="leaveDataTable" immediate="false">
    <h:graphicImage url="resources/images/edit.JPG"/>
    <f:attribute name="userId" value="#{employee.name}"/>
    <f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
    <f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
    <f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
    <f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
    <f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
    </p:commandLink>
    </p:column>


    But the rendered attribute is not working for the condition. How can I use the logical operator to make the condition work?Using PrimeFaces 3.4.2










    share|improve this question


























      up vote
      3
      down vote

      favorite
      2









      up vote
      3
      down vote

      favorite
      2






      2





      I have written a code like:



      <p:column headerText="Edit" width="40" rendered="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
      <p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" disabled="true" process="@this" update="leaveDataTable" immediate="false">
      <h:graphicImage url="resources/images/edit.JPG"/>
      <f:attribute name="userId" value="#{employee.name}"/>
      <f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
      <f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
      <f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
      <f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
      <f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
      </p:commandLink>
      </p:column>


      But the rendered attribute is not working for the condition. How can I use the logical operator to make the condition work?Using PrimeFaces 3.4.2










      share|improve this question















      I have written a code like:



      <p:column headerText="Edit" width="40" rendered="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
      <p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" disabled="true" process="@this" update="leaveDataTable" immediate="false">
      <h:graphicImage url="resources/images/edit.JPG"/>
      <f:attribute name="userId" value="#{employee.name}"/>
      <f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
      <f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
      <f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
      <f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
      <f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
      </p:commandLink>
      </p:column>


      But the rendered attribute is not working for the condition. How can I use the logical operator to make the condition work?Using PrimeFaces 3.4.2







      jsf primefaces datatable tablecolumn conditional-rendering






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 21 '16 at 23:00









      BalusC

      837k29531043186




      837k29531043186










      asked Jun 7 '13 at 11:12









      NDeveloper

      1,87651729




      1,87651729
























          3 Answers
          3






          active

          oldest

          votes

















          up vote
          10
          down vote













          You can't conditionally render a whole column on a per-row basis. This makes logically no utter sense. You can only conditionally render it on a per-table basis. The <p:column rendered> cannot take a condition based on properties of the iterated row. It can only take a condition based on properties of the parent bean.



          If you intend to conditionally hide only the cell of the currently iterated row, then just move the rendered attribute from <p:column> to <p:commandLink> or at least a component which wraps the whole <p:column> content, such as <h:panelGroup>.



          Or if you really intend to conditionally hide a whole column, then move the conditions used in rendered attribute of <p:column> to the #{userLeaveBean} parent bean.






          share|improve this answer























          • I want to do something like this: If the value for leaveDetails.strLeaveStatus is 'Canceled' or 'Availed', the <p:commandLink> should be disabled otherwise <p:commandLink> should be enabled.Dont want to hide the column on any condition.
            – NDeveloper
            Jun 7 '13 at 11:34






          • 2




            Then just put the condition in the disabled attribute of <p:commandLink>? Note that your current code attempt with <p:column rendered> is clearly trying to hide the column on a condition.
            – BalusC
            Jun 7 '13 at 11:38




















          up vote
          0
          down vote













          first import



          <html xmlns:ui="http://java.sun.com/jsf/facelets">


          and add a ui fragment inside the column



          <p:column headerText="Edit" width="40">
          <ui:fragment rendered="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
          <p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" disabled="true" process="@this" update="leaveDataTable" immediate="false">
          <h:graphicImage url="resources/images/edit.JPG"/>
          <f:attribute name="userId" value="#{employee.name}"/>
          <f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
          <f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
          <f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
          <f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
          <f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
          </p:commandLink>
          </ui:fragment>
          </p:column>





          share|improve this answer

















          • 1




            How is this an answer to the question? There is no explanation at all.
            – Kukeltje
            Nov 19 at 18:44










          • @EduardoSalgado Hi there, welcome to StackOverflow. Could you add a description of the significance of the import statement and ui fragment? That would really help readers understand why this may work. Afterwards, please take your time to familiarise yourself with the site by taking the tour. Hope to see you around :-)
            – TrebuchetMS
            Nov 19 at 18:49


















          up vote
          -1
          down vote



          accepted










          The best way I used to resolve my problem with the help of GOD BalusC is:



          <p:column headerText="Edit" width="40">
          <p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" process="@this" update="leaveDataTable"
          immediate="false" disabled="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
          <h:graphicImage url="resources/images/edit.JPG"/>
          <f:attribute name="userId" value="#{employee.name}"/>
          <f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
          <f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
          <f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
          <f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
          <f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
          </p:commandLink>
          </p:column>


          and it works as smooth as butter!






          share|improve this answer

















          • 4




            Note that your initial question isn't formulated as such. You did nowhere state the concrete functional requirement as in "I need to disable the command link on condition X". In the future questions, you'd better do so instead of basically dumping a bunch of lines of wrong code (wrong in such way that the concrete functional requirement isn't immediately obvious from it) and merely saying "It does not work".
            – BalusC
            Jun 7 '13 at 12:18













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f16982720%2fpcolumn-rendered-attribute-does-not-seem-to-work-with-pdatatable-var%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          10
          down vote













          You can't conditionally render a whole column on a per-row basis. This makes logically no utter sense. You can only conditionally render it on a per-table basis. The <p:column rendered> cannot take a condition based on properties of the iterated row. It can only take a condition based on properties of the parent bean.



          If you intend to conditionally hide only the cell of the currently iterated row, then just move the rendered attribute from <p:column> to <p:commandLink> or at least a component which wraps the whole <p:column> content, such as <h:panelGroup>.



          Or if you really intend to conditionally hide a whole column, then move the conditions used in rendered attribute of <p:column> to the #{userLeaveBean} parent bean.






          share|improve this answer























          • I want to do something like this: If the value for leaveDetails.strLeaveStatus is 'Canceled' or 'Availed', the <p:commandLink> should be disabled otherwise <p:commandLink> should be enabled.Dont want to hide the column on any condition.
            – NDeveloper
            Jun 7 '13 at 11:34






          • 2




            Then just put the condition in the disabled attribute of <p:commandLink>? Note that your current code attempt with <p:column rendered> is clearly trying to hide the column on a condition.
            – BalusC
            Jun 7 '13 at 11:38

















          up vote
          10
          down vote













          You can't conditionally render a whole column on a per-row basis. This makes logically no utter sense. You can only conditionally render it on a per-table basis. The <p:column rendered> cannot take a condition based on properties of the iterated row. It can only take a condition based on properties of the parent bean.



          If you intend to conditionally hide only the cell of the currently iterated row, then just move the rendered attribute from <p:column> to <p:commandLink> or at least a component which wraps the whole <p:column> content, such as <h:panelGroup>.



          Or if you really intend to conditionally hide a whole column, then move the conditions used in rendered attribute of <p:column> to the #{userLeaveBean} parent bean.






          share|improve this answer























          • I want to do something like this: If the value for leaveDetails.strLeaveStatus is 'Canceled' or 'Availed', the <p:commandLink> should be disabled otherwise <p:commandLink> should be enabled.Dont want to hide the column on any condition.
            – NDeveloper
            Jun 7 '13 at 11:34






          • 2




            Then just put the condition in the disabled attribute of <p:commandLink>? Note that your current code attempt with <p:column rendered> is clearly trying to hide the column on a condition.
            – BalusC
            Jun 7 '13 at 11:38















          up vote
          10
          down vote










          up vote
          10
          down vote









          You can't conditionally render a whole column on a per-row basis. This makes logically no utter sense. You can only conditionally render it on a per-table basis. The <p:column rendered> cannot take a condition based on properties of the iterated row. It can only take a condition based on properties of the parent bean.



          If you intend to conditionally hide only the cell of the currently iterated row, then just move the rendered attribute from <p:column> to <p:commandLink> or at least a component which wraps the whole <p:column> content, such as <h:panelGroup>.



          Or if you really intend to conditionally hide a whole column, then move the conditions used in rendered attribute of <p:column> to the #{userLeaveBean} parent bean.






          share|improve this answer














          You can't conditionally render a whole column on a per-row basis. This makes logically no utter sense. You can only conditionally render it on a per-table basis. The <p:column rendered> cannot take a condition based on properties of the iterated row. It can only take a condition based on properties of the parent bean.



          If you intend to conditionally hide only the cell of the currently iterated row, then just move the rendered attribute from <p:column> to <p:commandLink> or at least a component which wraps the whole <p:column> content, such as <h:panelGroup>.



          Or if you really intend to conditionally hide a whole column, then move the conditions used in rendered attribute of <p:column> to the #{userLeaveBean} parent bean.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 7 '13 at 11:23

























          answered Jun 7 '13 at 11:18









          BalusC

          837k29531043186




          837k29531043186












          • I want to do something like this: If the value for leaveDetails.strLeaveStatus is 'Canceled' or 'Availed', the <p:commandLink> should be disabled otherwise <p:commandLink> should be enabled.Dont want to hide the column on any condition.
            – NDeveloper
            Jun 7 '13 at 11:34






          • 2




            Then just put the condition in the disabled attribute of <p:commandLink>? Note that your current code attempt with <p:column rendered> is clearly trying to hide the column on a condition.
            – BalusC
            Jun 7 '13 at 11:38




















          • I want to do something like this: If the value for leaveDetails.strLeaveStatus is 'Canceled' or 'Availed', the <p:commandLink> should be disabled otherwise <p:commandLink> should be enabled.Dont want to hide the column on any condition.
            – NDeveloper
            Jun 7 '13 at 11:34






          • 2




            Then just put the condition in the disabled attribute of <p:commandLink>? Note that your current code attempt with <p:column rendered> is clearly trying to hide the column on a condition.
            – BalusC
            Jun 7 '13 at 11:38


















          I want to do something like this: If the value for leaveDetails.strLeaveStatus is 'Canceled' or 'Availed', the <p:commandLink> should be disabled otherwise <p:commandLink> should be enabled.Dont want to hide the column on any condition.
          – NDeveloper
          Jun 7 '13 at 11:34




          I want to do something like this: If the value for leaveDetails.strLeaveStatus is 'Canceled' or 'Availed', the <p:commandLink> should be disabled otherwise <p:commandLink> should be enabled.Dont want to hide the column on any condition.
          – NDeveloper
          Jun 7 '13 at 11:34




          2




          2




          Then just put the condition in the disabled attribute of <p:commandLink>? Note that your current code attempt with <p:column rendered> is clearly trying to hide the column on a condition.
          – BalusC
          Jun 7 '13 at 11:38






          Then just put the condition in the disabled attribute of <p:commandLink>? Note that your current code attempt with <p:column rendered> is clearly trying to hide the column on a condition.
          – BalusC
          Jun 7 '13 at 11:38














          up vote
          0
          down vote













          first import



          <html xmlns:ui="http://java.sun.com/jsf/facelets">


          and add a ui fragment inside the column



          <p:column headerText="Edit" width="40">
          <ui:fragment rendered="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
          <p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" disabled="true" process="@this" update="leaveDataTable" immediate="false">
          <h:graphicImage url="resources/images/edit.JPG"/>
          <f:attribute name="userId" value="#{employee.name}"/>
          <f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
          <f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
          <f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
          <f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
          <f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
          </p:commandLink>
          </ui:fragment>
          </p:column>





          share|improve this answer

















          • 1




            How is this an answer to the question? There is no explanation at all.
            – Kukeltje
            Nov 19 at 18:44










          • @EduardoSalgado Hi there, welcome to StackOverflow. Could you add a description of the significance of the import statement and ui fragment? That would really help readers understand why this may work. Afterwards, please take your time to familiarise yourself with the site by taking the tour. Hope to see you around :-)
            – TrebuchetMS
            Nov 19 at 18:49















          up vote
          0
          down vote













          first import



          <html xmlns:ui="http://java.sun.com/jsf/facelets">


          and add a ui fragment inside the column



          <p:column headerText="Edit" width="40">
          <ui:fragment rendered="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
          <p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" disabled="true" process="@this" update="leaveDataTable" immediate="false">
          <h:graphicImage url="resources/images/edit.JPG"/>
          <f:attribute name="userId" value="#{employee.name}"/>
          <f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
          <f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
          <f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
          <f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
          <f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
          </p:commandLink>
          </ui:fragment>
          </p:column>





          share|improve this answer

















          • 1




            How is this an answer to the question? There is no explanation at all.
            – Kukeltje
            Nov 19 at 18:44










          • @EduardoSalgado Hi there, welcome to StackOverflow. Could you add a description of the significance of the import statement and ui fragment? That would really help readers understand why this may work. Afterwards, please take your time to familiarise yourself with the site by taking the tour. Hope to see you around :-)
            – TrebuchetMS
            Nov 19 at 18:49













          up vote
          0
          down vote










          up vote
          0
          down vote









          first import



          <html xmlns:ui="http://java.sun.com/jsf/facelets">


          and add a ui fragment inside the column



          <p:column headerText="Edit" width="40">
          <ui:fragment rendered="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
          <p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" disabled="true" process="@this" update="leaveDataTable" immediate="false">
          <h:graphicImage url="resources/images/edit.JPG"/>
          <f:attribute name="userId" value="#{employee.name}"/>
          <f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
          <f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
          <f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
          <f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
          <f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
          </p:commandLink>
          </ui:fragment>
          </p:column>





          share|improve this answer












          first import



          <html xmlns:ui="http://java.sun.com/jsf/facelets">


          and add a ui fragment inside the column



          <p:column headerText="Edit" width="40">
          <ui:fragment rendered="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
          <p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" disabled="true" process="@this" update="leaveDataTable" immediate="false">
          <h:graphicImage url="resources/images/edit.JPG"/>
          <f:attribute name="userId" value="#{employee.name}"/>
          <f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
          <f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
          <f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
          <f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
          <f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
          </p:commandLink>
          </ui:fragment>
          </p:column>






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 19 at 18:28









          Eduardo Salgado

          1




          1








          • 1




            How is this an answer to the question? There is no explanation at all.
            – Kukeltje
            Nov 19 at 18:44










          • @EduardoSalgado Hi there, welcome to StackOverflow. Could you add a description of the significance of the import statement and ui fragment? That would really help readers understand why this may work. Afterwards, please take your time to familiarise yourself with the site by taking the tour. Hope to see you around :-)
            – TrebuchetMS
            Nov 19 at 18:49














          • 1




            How is this an answer to the question? There is no explanation at all.
            – Kukeltje
            Nov 19 at 18:44










          • @EduardoSalgado Hi there, welcome to StackOverflow. Could you add a description of the significance of the import statement and ui fragment? That would really help readers understand why this may work. Afterwards, please take your time to familiarise yourself with the site by taking the tour. Hope to see you around :-)
            – TrebuchetMS
            Nov 19 at 18:49








          1




          1




          How is this an answer to the question? There is no explanation at all.
          – Kukeltje
          Nov 19 at 18:44




          How is this an answer to the question? There is no explanation at all.
          – Kukeltje
          Nov 19 at 18:44












          @EduardoSalgado Hi there, welcome to StackOverflow. Could you add a description of the significance of the import statement and ui fragment? That would really help readers understand why this may work. Afterwards, please take your time to familiarise yourself with the site by taking the tour. Hope to see you around :-)
          – TrebuchetMS
          Nov 19 at 18:49




          @EduardoSalgado Hi there, welcome to StackOverflow. Could you add a description of the significance of the import statement and ui fragment? That would really help readers understand why this may work. Afterwards, please take your time to familiarise yourself with the site by taking the tour. Hope to see you around :-)
          – TrebuchetMS
          Nov 19 at 18:49










          up vote
          -1
          down vote



          accepted










          The best way I used to resolve my problem with the help of GOD BalusC is:



          <p:column headerText="Edit" width="40">
          <p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" process="@this" update="leaveDataTable"
          immediate="false" disabled="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
          <h:graphicImage url="resources/images/edit.JPG"/>
          <f:attribute name="userId" value="#{employee.name}"/>
          <f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
          <f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
          <f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
          <f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
          <f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
          </p:commandLink>
          </p:column>


          and it works as smooth as butter!






          share|improve this answer

















          • 4




            Note that your initial question isn't formulated as such. You did nowhere state the concrete functional requirement as in "I need to disable the command link on condition X". In the future questions, you'd better do so instead of basically dumping a bunch of lines of wrong code (wrong in such way that the concrete functional requirement isn't immediately obvious from it) and merely saying "It does not work".
            – BalusC
            Jun 7 '13 at 12:18

















          up vote
          -1
          down vote



          accepted










          The best way I used to resolve my problem with the help of GOD BalusC is:



          <p:column headerText="Edit" width="40">
          <p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" process="@this" update="leaveDataTable"
          immediate="false" disabled="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
          <h:graphicImage url="resources/images/edit.JPG"/>
          <f:attribute name="userId" value="#{employee.name}"/>
          <f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
          <f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
          <f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
          <f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
          <f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
          </p:commandLink>
          </p:column>


          and it works as smooth as butter!






          share|improve this answer

















          • 4




            Note that your initial question isn't formulated as such. You did nowhere state the concrete functional requirement as in "I need to disable the command link on condition X". In the future questions, you'd better do so instead of basically dumping a bunch of lines of wrong code (wrong in such way that the concrete functional requirement isn't immediately obvious from it) and merely saying "It does not work".
            – BalusC
            Jun 7 '13 at 12:18















          up vote
          -1
          down vote



          accepted







          up vote
          -1
          down vote



          accepted






          The best way I used to resolve my problem with the help of GOD BalusC is:



          <p:column headerText="Edit" width="40">
          <p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" process="@this" update="leaveDataTable"
          immediate="false" disabled="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
          <h:graphicImage url="resources/images/edit.JPG"/>
          <f:attribute name="userId" value="#{employee.name}"/>
          <f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
          <f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
          <f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
          <f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
          <f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
          </p:commandLink>
          </p:column>


          and it works as smooth as butter!






          share|improve this answer












          The best way I used to resolve my problem with the help of GOD BalusC is:



          <p:column headerText="Edit" width="40">
          <p:commandLink actionListener="#{userLeaveBean.editAppliedLeave}" title="Edit" process="@this" update="leaveDataTable"
          immediate="false" disabled="#{(leaveDetails.strLeaveStatus == 'Canceled') or (leaveDetails.strLeaveStatus == 'Availed')}">
          <h:graphicImage url="resources/images/edit.JPG"/>
          <f:attribute name="userId" value="#{employee.name}"/>
          <f:attribute name="editFirstHalf" value="#{leaveDetails.strStartTiming}"/>
          <f:attribute name="editSecondHalf" value="#{leaveDetails.strEndTiming}"/>
          <f:attribute name="editFrom" value="#{leaveDetails.dtLeaveFromDate}"/>
          <f:attribute name="editTo" value="#{leaveDetails.dtLeaveToDate}"/>
          <f:attribute name="leaveId" value="#{leaveDetails.strLeaveId}"/>
          </p:commandLink>
          </p:column>


          and it works as smooth as butter!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jun 7 '13 at 11:56









          NDeveloper

          1,87651729




          1,87651729








          • 4




            Note that your initial question isn't formulated as such. You did nowhere state the concrete functional requirement as in "I need to disable the command link on condition X". In the future questions, you'd better do so instead of basically dumping a bunch of lines of wrong code (wrong in such way that the concrete functional requirement isn't immediately obvious from it) and merely saying "It does not work".
            – BalusC
            Jun 7 '13 at 12:18
















          • 4




            Note that your initial question isn't formulated as such. You did nowhere state the concrete functional requirement as in "I need to disable the command link on condition X". In the future questions, you'd better do so instead of basically dumping a bunch of lines of wrong code (wrong in such way that the concrete functional requirement isn't immediately obvious from it) and merely saying "It does not work".
            – BalusC
            Jun 7 '13 at 12:18










          4




          4




          Note that your initial question isn't formulated as such. You did nowhere state the concrete functional requirement as in "I need to disable the command link on condition X". In the future questions, you'd better do so instead of basically dumping a bunch of lines of wrong code (wrong in such way that the concrete functional requirement isn't immediately obvious from it) and merely saying "It does not work".
          – BalusC
          Jun 7 '13 at 12:18






          Note that your initial question isn't formulated as such. You did nowhere state the concrete functional requirement as in "I need to disable the command link on condition X". In the future questions, you'd better do so instead of basically dumping a bunch of lines of wrong code (wrong in such way that the concrete functional requirement isn't immediately obvious from it) and merely saying "It does not work".
          – BalusC
          Jun 7 '13 at 12:18




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f16982720%2fpcolumn-rendered-attribute-does-not-seem-to-work-with-pdatatable-var%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Create new schema in PostgreSQL using DBeaver

          Deepest pit of an array with Javascript: test on Codility

          Fotorealismo